Skip to content
MCP server

x402 Micro Tollgate

x402 HTTP 402 + MCP paywall: charge USDC per agent call. Self-host via npx or Docker.

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.3.3
Listing updated
4 days ago

About x402 Micro Tollgate

x402 Micro Tollgate is an open-source MCP server. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

claude mcp add x402-micro-tollgate --env CDP_API_KEY_ID='<CDP_API_KEY_ID>' --env CDP_API_KEY_SECRET='<CDP_API_KEY_SECRET>' -- npx -y x402-micro-tollgate

Add to claude_desktop_config.json

{
  "mcpServers": {
    "x402-micro-tollgate": {
      "command": "npx",
      "args": [
        "-y",
        "x402-micro-tollgate"
      ],
      "env": {
        "CDP_API_KEY_ID": "<CDP_API_KEY_ID>",
        "CDP_API_KEY_SECRET": "<CDP_API_KEY_SECRET>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "x402-micro-tollgate": {
      "command": "npx",
      "args": [
        "-y",
        "x402-micro-tollgate"
      ],
      "env": {
        "CDP_API_KEY_ID": "<CDP_API_KEY_ID>",
        "CDP_API_KEY_SECRET": "<CDP_API_KEY_SECRET>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "x402-micro-tollgate": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "x402-micro-tollgate"
      ],
      "env": {
        "CDP_API_KEY_ID": "<CDP_API_KEY_ID>",
        "CDP_API_KEY_SECRET": "<CDP_API_KEY_SECRET>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "x402-micro-tollgate": {
      "command": "npx",
      "args": [
        "-y",
        "x402-micro-tollgate"
      ],
      "env": {
        "CDP_API_KEY_ID": "<CDP_API_KEY_ID>",
        "CDP_API_KEY_SECRET": "<CDP_API_KEY_SECRET>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "x402-micro-tollgate": {
      "command": "npx",
      "args": [
        "-y",
        "x402-micro-tollgate"
      ],
      "env": {
        "CDP_API_KEY_ID": "<CDP_API_KEY_ID>",
        "CDP_API_KEY_SECRET": "<CDP_API_KEY_SECRET>"
      }
    }
  }
}

Configuration

  • CDP_API_KEY_IDCoinbase CDP API key ID for the x402 facilitator
  • CDP_API_KEY_SECRETCoinbase CDP API key secret for the x402 facilitator
  • X402_PAY_TOEVM address that receives USDC settlements
  • UPSTREAM_URLUpstream HTTP API to proxy after payment (omit for built-in mock)
  • PRICEDollar price per paid call, e.g. $0.001
  • NETWORKCAIP-2 network id (eip155:84532 Base Sepolia or eip155:8453 Base)
  • X402_ENVIRONMENTdevelopment or production

Pricing

Open source

x402 Micro Tollgate FAQ

Is x402 Micro Tollgate free?

Yes. x402 Micro Tollgate is open source, so you can use and self-host it for free.

How do I add x402 Micro Tollgate to Claude Code?

Run this command in your terminal: claude mcp add x402-micro-tollgate --env CDP_API_KEY_ID='<CDP_API_KEY_ID>' --env CDP_API_KEY_SECRET='<CDP_API_KEY_SECRET>' -- npx -y x402-micro-tollgate