Skip to main content
CO

Coinbase Commerce

v0.2.0API 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

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

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets โ€” it receives scoped, short-lived session tokens.
Servers โ€” Every LatAm commerce API your agent needs | CodeSpar