MCP over streamable HTTP is JSON-RPC on one endpoint, so Roundlot prices each tool call, not the endpoint. initialize, tools/list and catalog never ask for payment.
In-band carrier#
- Call a paid tool. The result has
isError: trueand carries the x402PaymentRequiredobject instructuredContent(and JSON-encoded incontent[0].text). - Sign the payment exactly as for REST.
- Call the same tool again with the payload in
_meta["x402/payment"]. - The result arrives with the settlement receipt in
_meta["x402/payment-response"].
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call",
"params": { "name": "quote",
"arguments": { "symbol": "NVDA", "side": "buy", "size": "250" },
"_meta": { "x402/payment": { "x402Version": 2, "payload": { "signature": "0x…", "authorization": { } } } } } }
This is the wire format of Coinbase's @x402/mcp, so its clients can pay Roundlot. The server side is built on OKX's @okxweb3/app-x402-core rather than @x402/mcp, which is built on a different x402 core.
HTTP carrier#
- Call a paid tool. The HTTP response is
402with aPAYMENT-REQUIREDheader; the body is the same JSON-RPC result. - Repeat the same
tools/callwith aPAYMENT-SIGNATUREheader. - The response is
200with the tool result and aPAYMENT-RESPONSEheader.
This is what OKX's onchainos payment CLI and the OKX Agent Payments skill expect.
How Roundlot picks#
| Request | Carrier |
|---|---|
Has a PAYMENT-SIGNATURE header | HTTP |
Has a payment in _meta["x402/payment"] | in-band |
Sends MCP-Protocol-Version (the official MCP SDKs do) | in-band |
| Doesn't send it (OKX's CLI) | HTTP |
URL has ?payment=http or ?payment=meta | the one you ask for |
The official SDKs reject non-2xx responses, which is why they get the in-band carrier. Both carriers go through the same payment gate, so pricing, verification and "refused calls are never charged" are identical.
curl -i https://api.roundlot.0xo.in/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"quote","arguments":{"symbol":"NVDA","side":"buy","size":"250"}}}'
# HTTP/2 402 + payment-required header
Claude Desktop, Cursor and other MCP clients without a wallet see the price and the REST alternative in a second text block.