Pay for MCP tools: wallet proxies or prepaid credits
Updated 2026-11-11
Hit a payment-required result at https://tanod.dev/mcp? There are two ways to continue from an MCP client: use a wallet proxy that signs x402 payments, or add a prepaid tnd_ credit key in the client's request headers. Tanod uses Streamable HTTP. Most tools have a free daily allowance per IP address; some document and media tools are paid from the first call. Check the current prices and allowances.
- Wallet proxy: run a local MCP server with a dedicated USDC wallet and spending caps. It handles payment for your client.
- Prepaid key: make one x402 top-up, then paste the key into the Cursor, VS Code or Claude Code setup below. The client needs no wallet for later calls.
What happens on a paid MCP call
Without a credit key, a tool that needs payment does not fail the HTTP request. It returns a normal tool result with isError: true, and its structuredContent is an x402 v2 PaymentRequired object. Its accepts list offers USDC on Base (eip155:8453) first, then Polygon, Solana, BNB Chain and Arbitrum, all at the same price. Two more entries offer Base and Polygon again through Circle Gateway (batched settlement); exact-scheme clients such as the ones below use the first. The client signs a payment and repeats the call with it in params._meta["x402/payment"]. The receipt comes back in _meta["x402/payment-response"]. Only answers are charged, except a contract scan, which is charged when it starts; see when a paid call is charged.
Way 1: a wallet proxy for your MCP client
Our open source (MIT) tanod-mcp client runs locally over stdio and connects to the hosted Tanod server. With a dedicated USDC wallet on Base it signs x402 MCP payments, subject to per-call and daily caps. Without a wallet key it makes no payments. See the wallet and spending-cap setup.
{
"mcpServers": {
"tanod": {
"command": "npx",
"args": ["-y", "tanod-mcp"]
}
}
}This entry alone does not enable spending. Configure the wallet and caps using the linked setup before expecting paid results. Do not paste a wallet's private key into a chat or commit it to a project.
Other x402 client proxies — checked 2026-10-22
The following are capabilities described by each project's official repository or docs, not verified Tanod integrations. We have not tested each one with Tanod; none of the three below has a paid Tanod compatibility result from us.
- Civic
@civic/x402-mcp:client-proxyconnects non-payment-aware MCP clients to a payment-enabled MCP server. The local side supports stdio (default) or HTTP. It takes a target URL, an EVM wallet and a viem network name; the default isbaseSepolia, not Base mainnet. Civic's docs showbasefor Base mainnet. - MCPay:
mcpay connect --urlsexposes one or more remote MCP servers through a local stdio proxy. It accepts an MCPay API key, an EVM private key or a Solana secret key. The project lists Base, Avalanche, IoTeX and Sei for EVM, plus Solana; its CLI examples use testnets. Its SDK documentsmaxPaymentValue, but that is not proof of a CLI spending cap. - OpenCMC
x402-mcp-proxy: a local stdio bridge to remote Streamable HTTP or SSE MCP servers, with server-prefixed tool names. It documents USDC payments on Base (EIP-3009) and Solana, network/asset allowlists, and request and session spending caps. Its session cap resets when the process restarts.
Compatibility matters: these projects' READMEs describe HTTP 402 payment handling and do not establish support for Tanod's x402 v2 tool-result payment flow above. HTTP-only 402 handling is not enough. Before giving any proxy a key, review and pin its source, check its network, asset and recipient rules, and require spending limits before signing. Use a dedicated wallet holding only what you are willing to spend. A Tanod credit key is not an MCPay API key or a wallet private key.
Way 2: prepaid credits — add your key
Live since 22 October 2026, prepaid credits let one x402 payment fund a tnd_ key for later HTTP and MCP calls. You need an x402-capable payer for the top-up, but Cursor, VS Code and Claude Code do not need a wallet to spend the resulting balance.
- Read how to buy credits and the live available top-ups. Send
POST /v1/credits/topupwith{"amount_usd":"1"}or{"amount_usd":"5"}and pay the returned x402 request. The amount paid is the amount credited. - Save the new key returned in the paid answer, outside the agent's conversation (a secrets file or an environment variable your client reads): it is shown once, and a conversation's context can be cleared. If you lose it, do not buy again; see your key. A key is
tnd_followed by 43 URL-safe characters (letters, digits,_or-). Use your actual key, not a shortenedtnd_...placeholder. - Add the key in
Authorization: Bearer <key>. The API and MCP server also acceptX-Tanod-Credits: <key>; pick one header. The examples below keep credentials out of the server URL.
A key pays from its balance from the first call: the free daily allowance does not apply. Calls are charged at their listed prices only when they return an answer. A low balance returns a payment-required result, not an automatic top-up. Check it with the free get_credit_balance MCP tool or GET /v1/credits/balance with the same header. Unused credit expires 12 months after the purchase that added it; purchases are final. See credit terms and charging.
Cursor: .cursor/mcp.json
The official Cursor docs use mcpServers, a remote url and headers. Set TANOD_CREDITS_KEY to your saved key in the environment available to Cursor, then use this project configuration. Do not commit a literal key.
{
"mcpServers": {
"tanod": {
"url": "https://tanod.dev/mcp",
"headers": {
"Authorization": "Bearer ${env:TANOD_CREDITS_KEY}"
}
}
}
}VS Code: .vscode/mcp.json
The official VS Code configuration reference uses servers, not mcpServers. The input prompt hides the key; enter the full tnd_ key when prompted. This is the workspace VS Code format, not a portable MCP configuration or a Copilot harness session configuration.
{
"inputs": [
{
"type": "promptString",
"id": "tanodCreditsKey",
"description": "Tanod prepaid credit key (tnd_...)",
"password": true
}
],
"servers": {
"tanod": {
"type": "http",
"url": "https://tanod.dev/mcp",
"headers": {
"Authorization": "Bearer ${input:tanodCreditsKey}"
}
}
}
}Claude Code: HTTP with a header
The official Claude Code MCP docs support --transport http and --header. This project-scoped example stores a variable reference, not the secret: single quotes stop your shell from expanding it during setup. Set TANOD_CREDITS_KEY in the environment where you run Claude Code.
claude mcp add --transport http --scope project tanod https://tanod.dev/mcp \
--header 'Authorization: Bearer ${TANOD_CREDITS_KEY}'Remove an existing server named tanod before replacing its configuration, rather than adding a duplicate. Restart or reconnect the client after changing its key, and use its MCP status view to confirm the connection. Treat the key like cash: anyone with it can spend its balance. Never put it in prompts, source control, screenshots or shared URLs.
Claude Desktop: connector or mcp-remote bridge
A custom-connector dialog that offers only OAuth settings cannot add a static credit header. Use the local mcp-remote bridge below in that case. However, it is no longer accurate to call all built-in custom connectors OAuth-only: the official connector docs describe a limited-beta Request headers option. If your dialog has it, choose No sign-in and set Authorization to Bearer followed by your full key.
For the bridge, add this entry to claude_desktop_config.json. The mcp-remote README documents the header-variable pattern; keeping the space inside the variable also avoids the documented Windows argument-spacing problem. Replace the placeholder locally, keep the file private, and review and pin the bridge package before using it.
{
"mcpServers": {
"tanod": {
"command": "npx",
"args": [
"mcp-remote",
"https://tanod.dev/mcp",
"--header",
"Authorization:${TANOD_AUTH_HEADER}"
],
"env": {
"TANOD_AUTH_HEADER": "Bearer <paste your full tnd_ key here>"
}
}
}
}The bridge forwards a prepaid key; it does not sign an x402 payment or buy credits. These client configuration shapes were checked against official documentation on 2026-10-22, not validated by a paid call in each app.
TypeScript: @x402/mcp
Coinbase's @x402/mcp package wraps the MCP client. It reads the requirements from the tool result and retries with the payment. Install with npm install @x402/mcp @x402/evm @modelcontextprotocol/sdk viem.
import { createx402MCPClient } from "@x402/mcp";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { toClientEvmSigner } from "@x402/evm";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { privateKeyToAccount } from "viem/accounts";
const signer = toClientEvmSigner(privateKeyToAccount(process.env.AGENT_KEY));
const client = createx402MCPClient({
name: "my-agent", version: "1.0.0",
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(signer) }], // USDC on Base
autoPayment: true,
onPaymentRequested: async ({ paymentRequired }) => {
const base = paymentRequired.accepts.find((a) => a.network === "eip155:8453");
return Number(base?.amount) <= 50_000; // pay at most USD 0.05 a call (USDC has 6 decimals)
},
});
await client.connect(new StreamableHTTPClientTransport(new URL("https://tanod.dev/mcp")));
const result = await client.callTool("pdf_ocr", { url: "https://example.com/scan.pdf" });
console.log(result.content, result.paymentMade);The callback onPaymentRequested runs before anything is signed. Returning false throws Payment request denied. Fund the wallet with only what you are willing to spend.
Python: x402.mcp
The Python example uses x402 2.25.0 and its x402.mcp module. Install with pip install "x402[evm]" mcp. The x402 client expects a call_tool(params) method that returns camelCase fields. The official MCP SDK session does not match that shape, so the short SessionAdapter below converts between the two. It also turns the timeout into seconds, which MCP SDK 2.x requires. Set AGENT_KEY to the wallet's private key.
import asyncio
import os
from types import SimpleNamespace
from eth_account import Account
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client
from x402.mcp import create_x402_mcp_client_from_config
from x402.mechanisms.evm.exact import ExactEvmClientScheme
BASE = "eip155:8453" # USDC on Base
MAX_PER_CALL = 50_000 # USD 0.05 (USDC has 6 decimals)
class SessionAdapter:
"""Gives x402's client the call_tool(params) shape it expects."""
def __init__(self, session):
self._s = session
async def call_tool(self, params, read_timeout_seconds=None, **_):
if read_timeout_seconds is not None: # x402 passes a timedelta, mcp 2.x wants seconds
read_timeout_seconds = read_timeout_seconds.total_seconds()
r = await self._s.call_tool(
params["name"],
params.get("arguments"),
read_timeout_seconds=read_timeout_seconds,
meta=params.get("_meta"),
)
d = r.model_dump(by_alias=True, exclude_none=True)
return SimpleNamespace(
content=d.get("content", []),
isError=d.get("isError", False),
structuredContent=d.get("structuredContent"),
_meta=d.get("_meta", {}),
)
def __getattr__(self, name):
return getattr(self._s, name)
def approve(ctx):
base = next((a for a in ctx.payment_required.accepts if a.network == BASE), None)
return base is not None and int(base.amount) <= MAX_PER_CALL
async def main():
account = Account.from_key(os.environ["AGENT_KEY"])
async with streamable_http_client("https://tanod.dev/mcp") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
client = create_x402_mcp_client_from_config(
SessionAdapter(session),
{
"schemes": [{"network": BASE, "client": ExactEvmClientScheme(account)}],
"auto_payment": True,
"on_payment_requested": approve,
},
)
result = await client.call_tool("pdf_ocr", {"url": "https://example.com/scan.pdf"})
print(result.content, result.payment_made)
asyncio.run(main())A denied payment raises PaymentRequiredError with the message Payment request denied. The x402 client also applies its own default limit of USD 1 per payment, on top of your callback.
No wallet: pay by card
Some tools also run as Apify actors, billed by card through an Apify account, with no wallet and no USDC. This is separate from Tanod prepaid credits. See pay by card on Apify.
Other clients
For Cloudflare's Agents SDK, see the Cloudflare MCP payment guide.
What is charged
You pay only when a call returns an answer. The rules are on when a paid call is charged.
The TypeScript and Python examples were tested on 13 October 2026 against https://tanod.dev/mcp with @x402/mcp 2.28.0 (TypeScript) and x402 2.25.0 with mcp 2.3.0 and eth-account 0.14.0 (Python 3.11). Back to connect Tanod or tanod.dev.