/.well-known/mcp/pay.json
A static, cacheable JSON manifest served with no auth required to read. Agents fetch it before calling a paid tool to learn what a call costs and how to pay.
Features
mcp-pay keeps its surface small on purpose: a manifest, a flow, a set of rails, and a reference implementation. Here is the full picture.
The manifest
A static, cacheable JSON manifest served with no auth required to read. Agents fetch it before calling a paid tool to learn what a call costs and how to pay.
Attach a pricing rule to a default, a named tool, a resource pattern, or a prompt. Supported models: free, per_call, subscription, tiered, and metered.
Optional per-rail settlement time and a refund policy, so an agent can budget for latency and pick a rail that fits its constraints.
pay.json references /.well-known/mcp/server-card.json. Identity and capabilities live in SEP-2127; pricing lives here. No field duplication.
The 402 flow
Paid tools respond with the standard 402 status code. No bespoke envelope — agents and proxies already understand it.
The 402 response carries everything an agent needs to construct a payment proof for any accepted rail.
The agent retries the same request with an X-PAYMENT header carrying the constructed proof.
The server verifies the proof out-of-band with a facilitator before serving results — settlement never blocks inside mcp-pay itself.
Rail-agnostic
HTTP/EVM-shaped payments. The reference server implements x402 first because that path is shortest.
Declared in the schema as an accepted rail; planned for the reference server in a later phase.
Bitcoin Lightning is expressible in the accepts array via an LNURL; planned for the reference server.
Traditional card rails are part of the schema, so a single manifest can advertise on-chain and off-chain payment side by side.
Reference implementation
The JSON Schema and typed Rust representation of the pay.json manifest.
An axum-based reference server that returns 402 on paid tools and verifies X-PAYMENT proofs with a facilitator.
A command-line tool for working with manifests and exercising the 402 flow during development.
mcp-pay is a v0.1 draft. The spec and schema are versioned so feedback can land before it is submitted as a SEP.
Read the 402 handshake in the architecture, browse use cases, or follow a guide.