@receptum/mcp
v0.2.1
Published
Turn MCP tools into paid tools: price per call, x402 payment, receipt per result.
Downloads
359
Maintainers
Readme
@receptum/mcp
Signed receipts for paid MCP tools.
- Server:
withReceipts(paid(handler), { seller, price })wraps an@x402/mcppayment-wrapped tool and adds a seller-signed receipt toresult._meta["receptum/receipt"]on every settled call. The output hash is SHA-256 ofJCS(result.content). - Bindings: pass
bindings(SPEC §4.1) towithReceiptsto attach them to every receipt; on the client,verifyToolResult(result, allowedSellers, { requireBinding: true, bindingVerifiers: [evmBindingVerifier] })requires one that covers the payee (setprice.payToso receipts name it). - Client:
verifyToolResult(result, allowedSellers);captureReceipts(x402McpClient)recovers_meta, which the x402 MCP client doesn't return.
Live run: E2E_RESULTS.md.
Mainnet: withReceipts runs after settlement, so it has no gate of its own — the gate is the x402 resource server you hand to @x402/mcp. Configure it with facilitatorUrlFor from @receptum/server (explicit mainnet facilitator + allowMainnet); see docs/MAINNET.md.
