paidmcp-client is an optional managed-wallet MCP proxy for x402-enabled MCP servers.
Use it when you want spend caps, payment approvals, and guided onboarding. You can also connect natively to /mcp without this proxy.
- Node.js 20+ (22 recommended)
- npm
Use one of these options:
# run without installing globally
npx paidmcp-client --help
# or install globally
npm install -g paidmcp-clientAfter global install, use the paidmcp command directly:
paidmcp --help- Create a local payer wallet config:
npx paidmcp-client initThis creates ~/.paidmcp/config.json with:
- your seed phrase
- testnet defaults (Base Sepolia) plus spend guardrails
- Check wallet address and balances:
npx paidmcp-client wallet-
Fund the wallet (testnet first, then live if needed).
-
Connect to your paid MCP endpoint:
npx paidmcp-client connect https://your-mcp-host.dev- Add the printed snippet to your MCP client config (Cursor or Claude Desktop).
npx paidmcp-client init
npx paidmcp-client wallet
npx paidmcp-client wallet:import --force --confirm OVERWRITE_PAIDMCP_CONFIG < seed.txt
npx paidmcp-client doctor <endpoint>
npx paidmcp-client connect <endpoint>
npx paidmcp-client run <endpoint>Examples:
npx paidmcp-client connect http://localhost:4021
npx paidmcp-client run https://your-mcp-host.devEndpoints must use https:// (plain http:// is only allowed for localhost), so nobody on the network can change where a payment goes.
Set in ~/.paidmcp/config.json (amounts in US dollars):
| Setting | Default | What it does |
|---|---|---|
maxPerCallUsdt |
0.25 |
Never pay more than this for one call |
maxSessionUsdt |
5 |
Total per running proxy (resets when the MCP client restarts it) |
maxDailyUsdt |
10 |
Total per UTC day across all proxies on this machine (kept in ~/.paidmcp/spend-ledger.json) |
confirmAboveUsdt |
0.05 |
Payments at or above this need your approval |
How payments are checked:
- Approval: the proxy asks through your MCP client's approval prompt (MCP elicitation). If the client cannot show prompts, the payment is refused with an explanation. It is never approved silently. To allow larger payments without a prompt, raise
confirmAboveUsdt. - Tokens: only USDC on Base (Base Sepolia in test mode) and, in live mode, USDT0 on Plasma, at their official contract addresses. A server asking for any other token is refused.
- Caps are reserved before signing, so parallel calls and multiple proxies cannot exceed them. A signed payment counts toward the caps even if the server never collects it.
- Test mode never pays on Plasma, which only has a mainnet.
Set "networkMode": "live" to pay on mainnet. RPC URLs and token addresses follow the mode automatically.
Paid MCP servers ask for payment in different ways. The proxy handles all three that appear on paidmcp.dev, with the same caps and approvals:
| Style | How the server asks | How the proxy pays |
|---|---|---|
| HTTP 402 (e.g. paidmcp/template) | the /mcp request gets HTTP 402 |
retries the request with a PAYMENT-SIGNATURE header |
| x402 MCP transport (official spec) | a tool result containing { x402Version, accepts } |
retries the tool call once with _meta["x402/payment"] |
| Payment link | a tool result with { url, status: 402, challenge } |
pays that URL over HTTP 402 and returns its response (same host and https only) |
The proxy pays at most once per tool call. If a server asks again after being paid, the call fails with an explanation instead of paying again.
Generate a config snippet for a paid MCP endpoint:
npx paidmcp-client connect https://your-mcp-host.devThe command prints JSON like:
{
"mcpServers": {
"your-mcp-host-dev": {
"command": "npx",
"args": ["paidmcp-client", "run", "https://your-mcp-host.dev"]
}
}
}Paste this into your MCP config file and restart your MCP client if needed.
Inside client/:
npm install
npm run buildRun commands from source:
npm run init
npm run wallet
npm run wallet:import -- --force --confirm OVERWRITE_PAIDMCP_CONFIG < seed.txt
npm run doctor -- http://localhost:4021
npm run connect -- http://localhost:4021
npm run run -- http://localhost:4021Use one of:
npx paidmcp-client <command>npm install -g paidmcp-clientthenpaidmcp <command>- from source:
npm run <script>
If you see an error like Run "paidmcp init" first, create the local config:
npx paidmcp-client init- when
~/.paidmcp/config.jsonalready exists,init/wallet:importwill not overwrite by default - overwrite requires both
--forceand--confirm OVERWRITE_PAIDMCP_CONFIG - before overwrite, a timestamped backup is created in
~/.paidmcp/asconfig.backup-*.json(readable only by you) - your existing settings (mode, caps) are kept; only the seed phrase changes
wallet:importchecks that the seed phrase is valid before changing anything, and reads it from stdin when not given as an argument (arguments can end up in shell history)
- verify your wallet has funded USDC (Base) or USDT0 (Plasma)
- verify endpoint URL and network availability
- run
npx paidmcp-client walletto confirm balances are readable - run
npx paidmcp-client doctor <endpoint>for a quick endpoint check
- the tool result says which limit stopped it
- adjust
maxPerCallUsdt,maxSessionUsdt,maxDailyUsdtorconfirmAboveUsdtin~/.paidmcp/config.json - restart the MCP client after changing config
~/.paidmcp/config.jsoncontains your seed phrase in plaintext. It is created readable only by you (mode 600).- Never commit or share this file.
- Back up your seed phrase securely. Losing it means losing access to funds.
MIT. See LICENSE.