Skip to main content
CO

Coinbase Commerce

v0.2.1API Key

Merchant-side crypto accept: buyer pays BTC/ETH/USDC at checkout, Coinbase settles to merchant's chosen crypto or fiat. Distinct from MoonPay/Transak (onramp) and UnblockPay (corridor) — zero overlap.

18 tools3 env vars🌐 GLOBALstable on npm

What your agent can do

Coinbase Commerce gives your agent 18 tools it calls directly — pick the ones it needs, in Claude, Cursor, or any MCP client.

  • create_chargeCreate a crypto charge — a one-time merchant invoice priced in local fiat that a buyer can settle in BTC, ETH, USDC, and other supported assets. Returns a hosted_url the buyer can be redirected to, plus per-asset payment addresses.
  • retrieve_chargeRetrieve a charge by its Coinbase Commerce id OR its short code (the 8-character code embedded in the hosted URL). Returns current status, timeline, and payments.
  • list_chargesList charges, newest first. Supports cursor pagination via starting_after / ending_before.
Example call
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_charge", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-coinbase-commerce

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "coinbase-commerce": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-coinbase-commerce"
      ],
      "env": {
        "COINBASE_COMMERCE_API_KEY": "<your_coinbase_commerce_api_key>"
      }
    }
  }
}

After restart, your agent can call any of the 18 tools below — try create_charge first.

Environment variables · 3

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

COINBASE_COMMERCE_API_KEY
requiredsecret

Coinbase Commerce API key. Create one at https://beta.commerce.coinbase.com/settings/security.

COINBASE_COMMERCE_API_VERSION
optional

Coinbase Commerce API version pin (X-CC-Version header). Defaults to 2018-03-22.

COINBASE_COMMERCE_WEBHOOK_SECRET
optionalsecret

Shared secret used to verify X-CC-Webhook-Signature on incoming webhooks. Only required for the verify_webhook_signature tool.

Available tools · 18

Each tool is independent — your agent loads only what it needs to reduce context and response time.

WRITEcreate_charge
Create a crypto charge — a one-time merchant invoice priced in local fiat that a buyer can settle in BTC, ETH, USDC, and other supported assets. Returns a hosted_url the buyer can be redirected to, plus per-asset payment addresses.
WRITEretrieve_charge
Retrieve a charge by its Coinbase Commerce id OR its short code (the 8-character code embedded in the hosted URL). Returns current status, timeline, and payments.
WRITElist_charges
List charges, newest first. Supports cursor pagination via starting_after / ending_before.
DELETEcancel_charge
Cancel a charge that has not yet been paid. Only charges in NEW status can be cancelled; once pending or completed the call will fail.
WRITEresolve_charge
Manually resolve a charge as paid. Used for out-of-band settlement (e.g. underpayment you accept, delayed confirmation you want to honour).
WRITEcreate_checkout
Create a reusable hosted checkout — think product-page-style link that can be paid multiple times. Good for evergreen SKUs and donation pages.
READretrieve_checkout
Retrieve a checkout by id.
READlist_checkouts
List reusable hosted checkouts, newest first. Cursor pagination via starting_after / ending_before.

Compatible frameworks

MCP is a protocol — any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-coinbase-commerce` and add the config block above to your MCP client — Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Coinbase Commerce — MCP server · 18 tools | CodeSpar