Get started
If you’re using Claude or ChatGPT (browser, mobile, or desktop), connect to the Coinbase remote MCP via a Claude or ChatGPT connector. Here’s how it looks in Claude:The skill file is a machine-readable setup guide. Your agent will identify the best connection method, walk you through authentication, and verify the connection.
Remote MCP connector
Add Coinbase as an MCP connector in Claude or ChatGPT. Sign in with OAuth 2.1 — no local install required.
AI-native
JSON output by default, MCP tool-calling, and a bundled skill file for agent self-onboarding.
Preview before you execute
Every CLI write operation supports
--dry-run and order preview. See fees, slippage, and estimated fill price before committing.Terminal-ready
Market and limit orders, portfolio management, and USDC/USD conversions from the command line.
What’s supported today
Coinbase for Agents currently supports:- Spot crypto trading: buy and sell 900+ trading pairs on Coinbase Advanced Trade
- Isolated agent portfolios: spot crypto only, scoped to a specific portfolio selected when logging in or creating an API key
- Portfolio management: create portfolios, move funds, check balances and positions
- USDC/USD conversions: instant zero-fee conversions between USDC and USD
Coming soon: x402 payments for agent-consumed services (paywalled research, data APIs, compute), equities, prediction markets, and additional asset classes. If it’s on Coinbase, your agent will be able to trade it.
Portfolio isolation
Recommended setup: Create a separate Advanced portfolio, fund it with only what you’re willing to risk, and scope your agent’s access to that portfolio. This limits the blast radius if the agent makes an unexpected trade.Setup options
The skill file above handles Coinbase CLI setup automatically, but if you prefer to configure things manually:Coinbase MCP
Connect any MCP-compatible AI app to the Coinbase MCP server athttps://agents.coinbase.com/mcp. Authentication uses OAuth 2.1 to sign in with your Coinbase account.
- Claude (web & desktop)
- ChatGPT
- Coding agents
- Click the Customize toolbox icon in the left sidebar
- Go to Connectors
- Click the + button, then Add custom connector
- Name it (e.g., “Coinbase”) and enter the server URL:
https://agents.coinbase.com/mcp - Leave all other fields blank — click Create
- Sign in with your Coinbase account when prompted
- On the approval screen, select which portfolios to give the agent access to. See Portfolio isolation for the recommended setup.
To disconnect Coinbase from an app, go to Coinbase Account > Security > Connections and revoke the connection.
Coinbase CLI
An agent-first CLI for Coinbase Advanced Trade with JSON output, order preview, and a built-in local MCP server. Use it standalone or to run the local MCP server for your coding agents.1. Install the CLI
Node.js 22 or later is required.
2. Create a CDP API key
- Go to API Keys in the CDP Portal (a project is auto-created on first sign-in)
- Click Create API Key and give it a name (e.g.,
my-trading-agent) - Under Advanced Settings > Coinbase App & Advanced Trade:
- a. Select the portfolio you want the agent to trade from (Primary is selected by default — see Portfolio isolation for the recommended setup).
- b. Enable Trade and Transfer (View is on by default). Transfer allows moves between your portfolios only and does not allow withdrawals to external addresses.
- Click Create & Download and save the JSON key file
3. Configure and verify
4. Check a price and place a trade
client_order_id makes the order idempotent. If your connection drops and you retry with the same ID, the API returns the existing order instead of creating a duplicate. Always include one.Tools
Market data
| CLI command | MCP tool | Description |
|---|---|---|
coinbase products get <product_id> | products_get | Price, 24-hour volume/change, and size limits |
coinbase products list | products_list | All tradable products (900+ results, filter with symbol or --jq) |
coinbase products list symbol==USD | products_list | Products with USD as the base or quote currency |
coinbase products ticker <product_id> | products_ticker | Recent trades with best bid/ask |
coinbase products book <product_id> | products_book | Full order book (bids + asks) |
coinbase products candles <product_id> granularity==1h | products_candles | OHLCV price history |
coinbase products best-bid-ask product_ids=BTC-USD | — | Current best bid and ask |
Orders
| CLI command | MCP tool | Description |
|---|---|---|
coinbase orders preview ... | orders_preview | Dry-run: returns fill estimate, fees, and slippage |
coinbase orders create ... | orders_create | Execute an order |
coinbase orders list | orders_list | All orders with status, fill percentage, and fees |
coinbase orders get <order_id> | orders_get | Single order detail |
coinbase orders fills | orders_fills | All trade fills with price, size, and commission |
coinbase orders edit <order_id> | orders_edit | Modify an existing order |
coinbase orders cancel order_ids:='["<id>"]' | orders_cancel | Batch cancel orders |
coinbase orders close-position product_id=<id> size=<n> | orders_close_position | Close an open position |
Market buys use
quote_size (the amount to spend in USD). Market sells use base_size (the amount of the asset to sell). When switching between buy and sell, explicitly clear the other field (e.g., add quote_size= to clear a stale value).Portfolios and balances
| CLI command | MCP tool | Description |
|---|---|---|
coinbase balance | balance | All account balances (crypto + fiat) |
coinbase portfolios list | portfolios_list | All portfolios with UUID, name, and type |
coinbase portfolios get <portfolio_id> | portfolios_get | Breakdown: balances, positions, allocation %, unrealized PnL |
coinbase portfolios create name=<name> | portfolios_create | Create a new portfolio |
coinbase portfolios edit <portfolio_id> name=<n> | portfolios_edit | Rename a portfolio |
coinbase portfolios delete <portfolio_id> | portfolios_delete | Delete a portfolio (must be empty) |
coinbase transfer amount=<n> currency=<c> from=<uuid> to=<uuid> | transfer | Move funds between portfolios |
Conversions
| CLI command | MCP tool | Description |
|---|---|---|
coinbase convert quote from=<c> to=<c> amount=<n> | convert_quote | Get a conversion quote (rate + fee) |
coinbase convert execute <quote_id> from=<c> to=<c> | convert_execute | Execute a quoted conversion |
coinbase convert get <quote_id> | convert_get | Check conversion status |
Info and session
| CLI command | MCP tool | Description |
|---|---|---|
coinbase fees | fees | Fee tier (maker/taker rates) and 30-day volume |
coinbase env | — | View and manage credential environments |
coinbase mcp | — | Start the local MCP server (stdio) |
Global flags
These flags work on any CLI command:| Flag | What it does | When to use |
|---|---|---|
--template | Print the expected request body without sending | Before your first call to any command. Discover field names instead of guessing. |
--dry-run | Assemble the full request and print it without sending | Before any write operation to verify what will be sent |
--jq <expr> | Filter the JSON response with a jq expression | Extract specific fields: --jq '.price', --jq '.accounts[].currency' |
-e <env> | Override the active environment | Switch between configured environments |
Field syntax
CLI commands use the following field syntax:| Syntax | Meaning | Example |
|---|---|---|
key=value | String body field | product_id=BTC-USD |
key:=value | Raw JSON (arrays, numbers, Boolean values) | order_ids:='["abc","def"]' |
key==value | Query parameter | product_type==SPOT |
@file.json | Load body from a JSON file | @order.json |
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
HTTP 401 | Expired credentials | Create a new key in the CDP Portal |
HTTP 403 Missing required scopes | API key missing Trade or Transfer permission | Check key permissions in the Portal |
insufficient fund | Account balance too low | Run coinbase balance to check available funds |
coinbase: command not found | CLI not on PATH | Run npm install -g @coinbase/coinbase-cli; on Windows, add %APPDATA%\npm to PATH |
MISSING_FIELDS | Required fields not provided | Run coinbase <command> --template to see expected fields |
INVALID_VALUE | Unrecognized enum value | Check the error message for accepted values |
INVALID_FORMAT | Wrong date/time format | Use RFC 3339 with timezone (e.g., 2024-01-01T00:00:00Z) |