neul-labs/mcp-pay
Payment awareness layer for MCP (Model Context Protocol)
Platform-specific configuration:
{
"mcpServers": {
"mcp-pay": {
"command": "npx",
"args": [
"-y",
"mcp-pay"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Payment awareness layer for MCP (Model Context Protocol)
[](LICENSE)
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.mdServe at /.well-known/mcp/pay.json:
{
"mcp_pay": "0.1",
"server_card": "/.weLoading reviews...