MCP and x402: how an AI agent plugs in and pays
An AI agent is only as useful as the tools it can reach, and some of the good tools cost money. Two open standards cover the two halves of that problem: MCP for plugging in, x402 for paying. This is how they work together, without the jargon.
The plug: MCP
Until recently, every tool an agent used needed its own adapter. Search worked one way, a database another, a calendar a third. Each integration was written by hand, for one agent at a time.
The Model Context Protocol (MCP) replaces that with one common connection. Anthropic introduced it as an open standard in late 2024, and in December 2025 donated it to the Agentic AI Foundation, a fund under the Linux Foundation that Anthropic co-founded with Block and OpenAI.
The easiest way to picture it is USB-C for AI tools. Someone writes one MCP server for a tool, and any agent that speaks MCP can use it.
The toll gate: x402
HTTP has had a status code for "Payment Required", 402, since the 1990s. Almost nothing used it. x402 puts it to work. Coinbase created it and published it as an open protocol under the Apache-2.0 license.
The flow has four steps:
- The agent asks a server for something.
- The server answers 402, with the price, the network and where the payment will be checked.
- The agent signs a payment, usually a stablecoin such as USDC on Base or Solana, and sends the request again with the signature attached.
- A "facilitator" verifies the signature and settles it on-chain, and the server returns the data.
There's no account to create, no API key and no card form. That's what makes payments of a few cents practical, and a machine can complete every step on its own.
Putting them together
The x402 documentation has a guide for exactly this combination. An MCP server calls a paid API, sees the 402, pays from a wallet it has been given, and hands the result back to the agent. In the guide's example the agent is Claude Desktop. From the agent's side, the paid API is just one more tool.
The budget belongs in code
This is the part I'd underline. The guide's sample approves every payment automatically, because it's meant for local testing. For production it says to check each payment before signing: the amount, the currency, the network, the server and the tool, plus limits per user or per session. It also says it plainly: "Avoid relying only on model prompts for spend controls." The SDK ships with a default spend cap of $1 unless you change it.
A line in the prompt that says "don't spend more than $5 a day" is a wish. A check in the payment code is a limit. If the agent wants to go over it, the right behaviour is to stop and ask a person.
Where Salvor fits
Salvor OS, the part that exists today, is about memory, not payments. It's free and open source (MIT), and it keeps the lessons an agent learns as plain files in the project, after a person approves them.
Salvor Labs has said it is building toward agents that buy premium context, indexing and tools through Salvor+ over MCP and APIs, with x402 payments and spending controls. None of that is live yet. It's in development, so I'm describing a direction, not a product you can use today.
In short
- MCP: one plug, so a tool written once works with many agents.
- x402: pay per request over plain HTTP, with no account or card.
- Limits in code: the budget is enforced where the payment is signed, not in the prompt. Over the limit, the agent asks a person.
Get new articles by email
Only when a new article is out. No ads. Details →