mcpField
M
mcp-coinbase-cdp

mcp-coinbase-cdp

Local
github.com/codesparFinance275Updated 4w ago

About mcp-coinbase-cdp

mcp-coinbase-cdp is an MCP server for the Coinbase Developer Platform (CDP), covering Trading, Wallets and Payments under one CDP key. It is aimed at developers who need onchain swaps, wallet operations and payments. It authenticates with ES256 JWTs, unlike the other Coinbase servers in the catalog.

Key features

  1. 01Covers Trading, Wallets and Payments CDP surfaces
  2. 02Single CDP key authenticates all three surfaces
  3. 03Onchain swap creation, lookup and cancellation
  4. 04Wallet creation, balance listing and transfers
  5. 05Onchain payment creation, lookup and cancellation

Use cases

  1. 01Letting an agent quote and execute onchain swaps
  2. 02Managing wallet balances and transaction history
  3. 03Creating and tracking onchain payments

MCP support

The server exposes 15 operations as MCP tools for swaps, wallets and payments. It runs over stdio by default or over HTTP.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-coinbase-cdp": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-coinbase-cdp"
],
"env": {
"COINBASE_CDP_KEY_NAME": "<COINBASE_CDP_KEY_NAME>",
"COINBASE_CDP_PRIVATE_KEY": "<COINBASE_CDP_PRIVATE_KEY>"
}
}
}
}
Run commandnpx -y @codespar/mcp-coinbase-cdp
Environment variables to set
COINBASE_CDP_KEY_NAMESecretCDP key id of the form organizations/<org>/apiKeys/<id>. Mint at https://portal.cdp.coinbase.com.
COINBASE_CDP_PRIVATE_KEYSecretPEM-encoded ECDSA P-256 private key downloaded once at mint time from https://portal.cdp.coinbase.com. Pass the full PEM including BEGIN/END lines.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-coinbase-cdp0.1.1

Tools

15

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
limitintegerNoPage size
cursorstringNoPagination cursor from a previous response

Details

From the project README

@codespar/mcp-coinbase-cdp

MCP server for the Coinbase Developer Platform (CDP) — single npm package covering three CDP product surfaces under one key:

  • Trading — onchain swap / trade API
  • Wallets — Smart / Embedded / MPC wallet primitives
  • Payments — onchain outbound payment infrastructure

All three live on the same CDP account, share one ES256 JWT-signed key, and share one base URL (https://api.cdp.coinbase.com) — so they ship as one package, not three.

Positioning vs the rest of the catalog

ServerCoinbase surfaceAuth
@codespar/mcp-coinbaseAdvanced Trade exchange (legacy retail)HMAC API keys (CB-ACCESS-*)
@codespar/mcp-coinbase-commerceCommerce merchant gateway (accept BTC/ETH/USDC at checkout)API key (X-CC-Api-Key)
@codespar/mcp-coinbase-cdpDeveloper Platform (Trading + Wallets + Payments)ES256 JWT (this package)

Each surface has a separate API host, a separate key type, and a separate dashboard — they do not share credentials. Mint the right key for the surface you want.

Tools (15)

Trading (4)
ToolPurpose
list_quotesList recent swap quotes minted under the authenticated CDP account.
create_swapCreate an onchain swap between two assets.
get_swapGet a single swap by id — full status, executed amounts, gas, tx hash.
cancel_swapCancel a pending swap before it lands onchain.
Wallets (7)
ToolPurpose
create_walletCreate a new wallet (smart / embedded / MPC).
list_walletsList wallets under the authenticated CDP account.
get_walletGet a single wallet by id.
list_balancesList asset balances across all addresses + networks.
transferSend a transfer from a wallet to a destination address.
get_transactionGet a single transaction by id.
list_transactionsList historical transactions for a wallet.
Payments (4)
ToolPurpose
create_paymentCreate an onchain payment (outbound transfer to a payee).
list_paymentsList historical payments.
get_paymentGet a single payment by id.
cancel_paymentCancel a pending payment before it lands onchain.

Install

npm install -g @codespar/mcp-coinbase-cdp

Environment

COINBASE_CDP_KEY_NAME="organizations/<org>/apiKeys/<id>"
COINBASE_CDP_PRIVATE_KEY="-----BEGIN EC PRIVATE KEY-----
...
-----END EC PRIVATE KEY-----"

Mint the key (and download the PEM once — it is not recoverable later) at https://portal.cdp.coinbase.com. The same key authenticates Trading, Wallets, and Payments.

Important — the PEM must be the full multi-line block including BEGIN/END lines. When supplying via shell env, wrap in double quotes and preserve newlines (or use $'...' / a .env file).

Authentication

CDP signs every request with a fresh ES256 JWT in the Authorization: Bearer … header.

JWT claims (per request):

ClaimValue
subCOINBASE_CDP_KEY_NAME
iss"cdp"
aud["cdp_service"]
nbfnow (unix seconds)
expnow + 120
uri"<METHOD> api.cdp.coinbase.com<path>" (path includes any query string)

JWT header:

FieldValue
alg"ES256"
typ"JWT"
kidCOINBASE_CDP_KEY_NAME
noncerandom 16-byte hex (per request)

Signed with the ECDSA P-256 private key from COINBASE_CDP_PRIVATE_KEY. The PEM is imported once at startup and cached — only the JWT is minted per request.

Run

# stdio (default — for Claude Desktop, Cursor, etc.)
npx @codespar/mcp-coinbase-cdp

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-coinbase-cdp

Enterprise

Need governance, budget limits, and audit trails for agent-driven onchain transactions? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.