Skip to content
MCP server

X402 Bazaar MCP

Check, then act, on Base and NEAR: token-safety gates, then swaps at the best price —…

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.3.0
Listing updated
6 days ago

About X402 Bazaar MCP

X402 Bazaar MCP is an open-source MCP server. It runs locally on your machine and is started by your AI client.

Check, then act, on Base and NEAR: token-safety gates, then swaps at the best price — over x402.

Install

Run in a terminal

claude mcp add x402-bazaar-mcp --env X402_CREDIT_TOKEN='<X402_CREDIT_TOKEN>' --env AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' -- npx -y x402-bazaar-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "x402-bazaar-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "x402-bazaar-mcp"
      ],
      "env": {
        "X402_CREDIT_TOKEN": "<X402_CREDIT_TOKEN>",
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "x402-bazaar-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "x402-bazaar-mcp"
      ],
      "env": {
        "X402_CREDIT_TOKEN": "<X402_CREDIT_TOKEN>",
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "x402-bazaar-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "x402-bazaar-mcp"
      ],
      "env": {
        "X402_CREDIT_TOKEN": "<X402_CREDIT_TOKEN>",
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "x402-bazaar-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "x402-bazaar-mcp"
      ],
      "env": {
        "X402_CREDIT_TOKEN": "<X402_CREDIT_TOKEN>",
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "x402-bazaar-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "x402-bazaar-mcp"
      ],
      "env": {
        "X402_CREDIT_TOKEN": "<X402_CREDIT_TOKEN>",
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • X402_CREDIT_TOKENPrepaid credit token (ck_…) from the buy-credits service. Sent as the x-credit-token header; each call debits your balance. No wallet or signing needed. Recommended paid mode. Buyable with USDC on Base, or with USDC/USDT/NEAR on NEAR at https://402.com.tr/credits.
  • AGENT_PRIVATE_KEYHex private key of a Base wallet holding USDC. Used locally to sign x402 payments — never sent anywhere. Use a dedicated low-balance wallet. Optional: without it (and without a credit token) the server runs on the free tier.
  • X402_BAZAAR_CATALOGOverride the catalog URL (default https://402.com.tr/api/catalog).

Pricing

Open source

X402 Bazaar MCP FAQ

Is X402 Bazaar MCP free?

Yes. X402 Bazaar MCP is open source, so you can use and self-host it for free.

How do I add X402 Bazaar MCP to Claude Code?

Run this command in your terminal: claude mcp add x402-bazaar-mcp --env X402_CREDIT_TOKEN='<X402_CREDIT_TOKEN>' --env AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' -- npx -y x402-bazaar-mcp

Where this comes from

  • Description: from the official MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers