Skip to main content
Set mcp: true in your SellerConfig to expose Key0 as an MCP server. The Express router automatically mounts all MCP routes alongside the existing A2A and x402 HTTP endpoints.
import express from "express";
import { key0Router } from "@key0ai/key0/express";

const app = express();

app.use(
  key0Router({
    config: {
      mcp: true,
      agentName: "My Service",
      // ...rest of SellerConfig
    },
    adapter,
    store,
    seenTxStore,
  }),
);
This adds four routes:
RouteMethodPurpose
/.well-known/mcp.jsonGETMCP discovery document
/mcpPOSTStreamable HTTP transport — handles all tool calls
/mcpGETReturns 405 (SSE not supported in stateless mode)
/mcpDELETEReturns 405 (session management not supported)
For full documentation on the two exposed tools (discover_plans and request_access), payment flow paths, error handling, curl examples, and architectural rationale, see Protocol → MCP.

Connect from Claude Code

Add the seller’s MCP endpoint to .mcp.json in your project root:
{
  "mcpServers": {
    "my-service": {
      "type": "http",
      "url": "https://my-service.example.com/mcp"
    }
  }
}
Or via the CLI:
claude mcp add my-service --transport http --url https://my-service.example.com/mcp

Next Steps