Transport.mcp
Raw JSON-RPC MCP transport
MCP transport for server-side payment handling with raw JSON-RPC.
Usage
import { , , } from 'mppx/server'
const = .({
: [.()],
: .(),
})Behavior
- Reads and validates Credentials from
_meta["org.paymentauth/credential"]; malformed values produce an invalid-params payment error - Maps payment required to
-32042, verification failures to-32043, malformed Credentials and invalid payloads to-32602, and internal payment errors to-32603 - Attaches Receipts in
_meta["org.paymentauth/receipt"]
Use this transport when handling raw JSON-RPC messages directly. For use with @modelcontextprotocol/sdk, use Transport.mcpSdk() instead.
Return type
import type { Mcp } from 'mppx'
type ReturnType = Transport<Mcp.JsonRpcRequest, Mcp.Response>