MCP server

Download the complete public OpenAPI schema

MCP server

Every public v1 endpoint above is also callable as a Model Context Protocol (MCP) tool over Streamable HTTP at /mcp/v1, with the same pr_sk_test_… / pr_sk_live_… Bearer token as a REST call. The MCP tool name equals the route's operationId — e.g. v1_create_purchase_intent exposes the same shape as POST /v1/purchase_intents. Use this when wiring OpenMerchant into an LLM tool palette (Claude Desktop, Cursor, Cline, the OpenAI Agents SDK, …) without writing per-route REST adapters yourself.

Each MCP-eligible operation's request panel has two extra code tabs:

  • MCP (Streamable HTTP) — a raw tools/call JSON-RPC curl you can copy verbatim; works against any HTTP client, no SDK required.
  • MCP SDK (TS) — a @modelcontextprotocol/sdk snippet that calls client.callTool({ name, arguments }) against a Client you've already connected (see "Connect a client" below).

Mount

https://api.openmerchant.dev/mcp/v1     (production)
https://api.staging.openmerchant.dev/mcp/v1   (staging)

Authorize every request with the same Bearer token used for the REST API — pr_sk_test_… for test mode, pr_sk_live_… for live mode. The server reads the Authorization header on each tool invocation and routes through the same auth middleware as a direct REST call, so mode, account scoping, and rate-limiting all behave identically.

Connect a client

import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport }
  from "@modelcontextprotocol/sdk/client/streamableHttp.js"

const transport = new StreamableHTTPClientTransport(
  new URL("https://api.openmerchant.dev/mcp/v1"),
  { requestInit: { headers: { Authorization: "Bearer pr_sk_test_..." } } },
)
const client = new Client({ name: "my-app", version: "1.0.0" })
await client.connect(transport)

const result = await client.callTool({
  name: "v1_create_purchase_intent",
  arguments: { profile_id: "pr_pf_...", items: [...] },
})

The MCP tools/list method (and GET /mcp/v1/manifest.json over plain HTTP) enumerates every available tool with its full inputSchema. Schemas, validation, and error responses match the REST surface 1:1 — anything you see in this reference applies to the equivalent MCP tool.