← Learn
mcp payments

MCP Payments: Adding Pay-Per-Call Billing to MCP Tool Servers

MCP payments are per-call, stablecoin-settled charges attached to tools exposed through the Model Context Protocol. When an AI agent in Claude Desktop or Cursor invokes a paid MCP tool, the x402 protocol handles the payment handshake inline, so the agent pays only for what it uses without API keys or vendor signups.

What the Model Context Protocol is and why tools need payment gates

The Model Context Protocol (MCP) is a standard that lets AI coding assistants, such as Claude Desktop and Cursor, discover and invoke external tools at runtime. An MCP server exposes a set of tool definitions, each with a name, input schema, and description. The host application presents these tools to the language model, which can call them during a conversation or autonomous task.

Without a payment layer, every MCP tool is either free or gated behind a per-vendor API key the developer must obtain and configure manually. This works for a handful of services but breaks down as the ecosystem grows. Payment gates let tool authors charge per call, turning any MCP server into a monetized endpoint while keeping the integration surface uniform for the agent.

Why MCP payments matter in 2026

The number of MCP-compatible hosts has grown steadily since the protocol's introduction, and tool authors now face a real distribution problem: how to charge for compute, data, or inference without forcing every user through a signup flow. Traditional billing, based on monthly subscriptions or credit-card-backed API keys, adds friction that autonomous agents cannot navigate on their own.

MCP payments solve this by embedding billing into the protocol layer. An agent with a funded USDC balance can discover a paid tool, pay for the call, and receive results in a single interaction. For a deeper look at why stablecoin-based billing suits autonomous agents specifically, see our guide on payments for AI agents at /learn/payments-for-ai-agents.

How x402 slots into an MCP server response

When an MCP tool wraps an x402-protected API, the payment handshake happens inside the tool's HTTP call rather than at the MCP protocol level itself. The tool implementation makes an HTTP request to the upstream API. The API responds with status 402 Payment Required and a JSON body containing the price, accepted chain, and recipient address. The client wallet signs a USDC transfer and retries the request with an X-Payment header containing the signed transaction. The API verifies the payment on-chain, fulfills the request, and returns data that the MCP tool then surfaces to the model. For a full breakdown of the 402 handshake, see our x402 explainer at /learn/what-is-x402.

From the language model's perspective, nothing changes. It calls the tool by name and receives structured output. The payment negotiation is invisible to the model, handled entirely by the wallet layer between the MCP server and the upstream API.

Practical example: a paid geocoding tool in an MCP server

Consider an MCP server that exposes a geocode_address tool. The tool accepts a street address string and returns latitude, longitude, and a normalized address. Under the hood, it calls a commercial geocoding API protected by x402.

When the agent calls geocode_address, the MCP server issues an HTTP GET to the geocoding endpoint. The endpoint returns 402 with a price of, say, $0.028 per call. The AgentCash wallet signs the USDC payment on Base, retries with the X-Payment header, and the geocoding API returns coordinates. The MCP server packages the result and hands it back to the model. The entire round-trip adds only the on-chain settlement latency, typically under two seconds on Base.

The developer who built the agent never registered for the geocoding service. They funded one USDC balance and installed the AgentCash MCP server. Every paid tool in the server's catalog works the same way.

How AgentCash installs as an MCP server that routes paid calls

AgentCash ships as both a CLI and an MCP server. Running npx agentcash registers the MCP server with your coding agent (Claude Desktop, Cursor, or any MCP-compatible host). Once installed, the server exposes every x402-protected endpoint in the AgentCash index as a callable tool.

AgentCash currently indexes 1 payment-protected origin spanning 1 API category, with 30 priced endpoints available. The observed median price per paid call is $0.028, and the range runs from $0.002 to $0.440 as of April 2026. Users fund a single USDC balance on Base, Solana, or Tempo, and the router handles chain selection and payment signing per call.

Because the MCP server advertises tool schemas dynamically, new endpoints appear in the agent's tool list as they are added to the index. No reinstallation or configuration change is required on the developer's side.

What MCP payments replace compared to API-key-per-vendor billing

The conventional approach to paid API access in an agent involves three steps per vendor: sign up for an account, generate an API key, and inject the key into the agent's environment. Each vendor has its own billing dashboard, rate limits, and credential rotation policy. For an agent that calls ten different services, the developer manages ten sets of credentials.

MCP payments collapse this into one wallet balance and one authentication surface. The agent does not carry API keys for upstream providers. Instead, each call is authenticated by the USDC payment itself: the signed transaction proves the caller is willing to pay, and the x402 server validates it on-chain before fulfilling the request. Credential management disappears entirely for the agent developer.

This also changes the economics for tool authors. Instead of building user management, billing integrations, and key-provisioning systems, an API author adds x402 support to their HTTP server and starts earning USDC per call with no invoicing overhead.

Frequently asked questions

Does the language model need to know about payments to use a paid MCP tool?

No. The payment handshake happens between the AgentCash wallet layer and the upstream API. The model calls the tool by name and receives structured output. It never sees the 402 status code or the X-Payment header.

Which MCP-compatible hosts work with AgentCash for MCP payments?

AgentCash installs as a standard MCP server, so it works with any MCP-compatible host. Claude Desktop and Cursor are the most common. Any host that supports the Model Context Protocol tool-calling interface can use it.

Can I set spending limits so my agent does not drain its USDC balance?

Yes. The AgentCash wallet supports developer-configured spending caps. The wallet will refuse to sign a payment that would exceed the cap, and the tool call will return an error to the model rather than silently failing.

What happens if the upstream API returns 402 but the wallet has insufficient balance?

The MCP tool returns an error indicating insufficient funds. The model receives this as a tool error and can inform the user or take an alternative action depending on its instructions.

Which blockchains does AgentCash settle MCP payments on?

Settlement is supported on Base, Solana, and Tempo. All three chains use USDC as the payment currency. The AgentCash router selects the chain based on what the upstream x402 server accepts.

How do I add a new paid API to the AgentCash MCP tool catalog?

API authors add x402 support to their HTTP server by returning 402 with payment terms on protected endpoints. Once the endpoint is indexed by AgentCash, it automatically appears as a tool in the MCP server's schema for all connected agents.

Is there latency overhead from the x402 payment handshake inside an MCP tool call?

The handshake adds one extra HTTP round-trip plus on-chain settlement time. On Base, this typically totals under two seconds. The model waits for the tool response as it would for any network call.

Do I need a separate USDC balance for each MCP tool or API provider?

No. One USDC balance, funded on Base, Solana, or Tempo, covers calls to every x402-protected endpoint in the AgentCash index. The router handles payment to each provider from the single balance.

Related

Get started with AgentCash

One balance, USDC on Base · Solana · Tempo. Call any payment-protected API from your agent — no API keys.

This page is compiled from live OpenAPI specs published by each API provider. Content last reviewed Apr 7, 2026 by the AgentCash team. How we build these pages.