Payment awareness layer for MCP (Model Context Protocol)
mcp-pay is an early-stage Rust project in the AI payments / x402 ecosystem, focused on agent-payments, agentic-commerce, agents, ai-agents. It currently has 1 GitHub stars and 1 forks, and sits alongside related tools like piprail, routeweiler-python-sdk, inflow-cli, agent-payment-protocols, APIbase, sardis.
Payment awareness layer for MCP (Model Context Protocol)
Website: mcp-pay.neullabs.com · Docs: docs.neullabs.com/mcp-pay · Source: github.com/neul-labs/mcp-pay
mcp-pay extends the MCP ecosystem with payment capabilities. It provides:
mcp-pay.json) for declaring pricing and payment rails| Ecosystem | Discovery | Payment |
|---|---|---|
| MCP Registry | Tools, resources, prompts | None |
| x402 Bazaar | After payment | x402 only |
| Tempo MPP | In-network | MPP only |
| mcp-pay | At .well-known |
All rails |
mcp-pay bridges these ecosystems by providing a rail-agnostic payment manifest that works with all payment protocols.
# Clone and build
git clone https://github.com/neul-labs/mcp-pay
cd mcp-pay
cargo build --release
# Configure (optional)
export PAY_TO_ADDRESS=0x1234567890abcdef1234567890abcdef12345678
export HTTP_ADDR=127.0.0.1:3000
# Run
cargo run -p mcp-pay-server
# Get payment manifest
curl http://localhost:3000/.well-known/mcp/pay.json | jq
# Get weather (FREE)
curl "http://localhost:3000/api/weather?city=London" | jq
# Get forecast (PAID - returns 402)
curl -i "http://localhost:3000/api/forecast?city=Tokyo"
# HTTP/1.1 402 Payment Required
# X-PAYMENT-REQUIRED: eyJ4NDAyX3ZlcnNpb24i...
mcp-pay/
├── crates/
│ ├── mcp-pay-schema/ # Schema types + validation
│ ├── mcp-pay-server/ # Reference implementation
│ └── mcp-pay-cli/ # Registry queries (Phase 2)
├── specs/
│ ├── schema/
│ │ └── mcp-pay.schema.json
│ └── mcp-pay-specification.md
└── README.md
Serve at /.well-known/mcp/pay.json:
{
"mcp_pay": "0.1",
"server_card": "/.well-known/mcp/server-card.json",
"pricing": {
"default": { "model": "free" },
"tools": {
"get_forecast": {
"model": "per_call",
"amount": "0.003",
"currency": "USD"
}
}
},
"accepts": [
{
"rail": "x402",
"network": "eip155:8453",
"asset": "USDC",
"pay_to": "0x1234..."
},
{
"rail": "lightning",
"lnurl": "lnurl1dp68gurn8ghj7..."
}
],
"payment_sla": {
"settlement_time_seconds": { "x402": 2, "lightning": 5 },
"refund_policy": "full_refund_on_failure"
}
}
use mcp_pay_schema::{
McpPayManifest, Pricing, PricingRule, PaymentRail,
};
// Create a manifest
let mut pricing = Pricing::with_default(PricingRule::free());
pricing.add_tool("get_forecast", PricingRule::per_call("0.003", "USD"));
let manifest = McpPayManifest::new(
"0.1",
pricing,
vec![PaymentRail::x402_base_usdc("0x1234...")],
);
// Serialize to JSON
let json = serde_json::to_string_pretty(&manifest)?;
| Variable | Default | Description |
|---|---|---|
HTTP_ADDR |
127.0.0.1:3000 |
Server bind address |
PAY_TO_ADDRESS |
0x0... |
Payment recipient |
X402_FACILITATOR |
https://x402.org/facilitator |
x402 facilitator URL |
NETWORK |
eip155:8453 |
Chain ID (Base) |
ASSET |
USDC |
Payment asset |
PRICE_PER_CALL |
0.003 |
Price in USD |
Agent MCP Server Facilitator
| | |
| GET /api/forecast | |
|------------------------------->| |
| | |
| 402 Payment Required | |
| X-PAYMENT-REQUIRED: {...} | |
|<-------------------------------| |
| | |
| [Create payment proof] | |
| | |
| GET /api/forecast | |
| X-PAYMENT: {...} | |
|------------------------------->| |
| | POST /verify |
| |----------------------------->|
| | |
| | { valid: true } |
| |<-----------------------------|
| | |
| 200 OK | |
| X-PAYMENT-RESPONSE: {...} | |
| { forecast: ... } | |
|<-------------------------------| |
| Rail | Network | Status |
|---|---|---|
| x402 | Base, Solana | Implemented |
| MPP | Tempo | Planned |
| Lightning | Bitcoin | Planned |
| Card | Stripe | Planned |
See specs/mcp-pay-specification.md for the full specification.
Key design principles:
Licensed under the MIT license (LICENSE or https://opensource.org/licenses/MIT).
Contributions welcome! Please read the specification before submitting PRs.
Part of the Neul Labs agent-infrastructure toolchain:
| Project | Description |
|---|---|
| agentvfs | Workspace runtime and execution boundary for AI agents. |
| memorg | Give your LLM a memory that actually works. |
| ormai | Give your AI agents database access without the risk — safe text-to-SQL. |
| closegate | The policy chokepoint for finance AI agents. |
| regulus | The EU & UK compliance plane for Google ADK. |
x402 (HTTP 402 Payment Required) SDK + MCP server: let any API charge for itself and any AI agent pay for itself, USDC & stablecoins across EVM, Solana & 8 more chain families, in a couple of lines. Backendless, no fee, self-custodial, paid straight to your wallet. TypeScript, MIT.
The financial operating system for AI agents. A single HTTP client that intercepts '402 Payment Required', routes across x402, L402, and MPP, persists credentials as recoverable assets, enforces per-envelope budgets, and emits a structured trace.
A wallet for your agents to onboard and pay. Agentic MPP / x402 payments from your machine - CLI + MCP server.
A neutral landscape analysis of AI agent payment protocols (x402, MPP, L402, Google AP2, Visa TAP + ICC, Mastercard Agent Pay, Amex ACE, Google/Shopify UCP, OpenAI ACP, and others). Maintained by Genesis Software Group, Copenhagen. Updated April 2026. CC BY 4.0.
Universal MCP gateway for AI agents — 1108 tools, 307 providers. One endpoint (https://apibase.pro/mcp), pay-per-call with x402 USDC on Base + MPP USDC on Tempo.
The open authority layer + SDKs for AI-agent payments. Thin Python/TS clients, an MCP server, framework adapters (LangChain/CrewAI/Hermes/OpenClaw/…), and @sardis/reference — a pure policy simulator + AP2/TAP/x402 verifiers showing exactly how Sardis decides if an agent may spend. The hosted engine that moves money is private.
Agent behavior that compiles
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
x402 payments in Rust: verify, settle, and monitor payments over HTTP 402 flows
The self-improving LLM router that optimize your agentic workflows with every runs, works with any harnesses, any models, any loops.
Production-ready x402 facilitator server.
Rust SDK for the x402 payment protocol.