Skip to content

How to Use Coinbase for Agents with MCP and CLI (2026)

Connect an AI agent to Coinbase for Agents via remote MCP or local CLI, scope a portfolio, then trade and pay for x402 research from USDC on Base.

Table of Contents

AI agents that can trade and pay need a Coinbase account connection with hard portfolio boundaries, not another developer wallet SDK.

The named object is Coinbase for Agents: a remote MCP at https://agents.coinbase.com/mcp plus the local @coinbase/coinbase-cli that can trade Advanced Trade products and settle curated x402 research payments from retail USDC on Base. That is not Coinbase AgentKit paying arbitrary x402 APIs, not a Coinbase Agentic Wallet provisioning flow, and not Coinbase Business Checkouts for merchant acceptance.

📌
Stablecoin Insider's framing: use this guide to connect an agent harness to Coinbase for Agents, isolate a funded portfolio, verify balances, then run a dry-run order preview and a capped x402 research fetch. Use How to Pay for an x402 API with Coinbase AgentKit when the agent must pay third-party APIs from a developer wallet. Use How to Create a Coinbase Agentic Wallet when you need a dedicated USDC wallet object rather than Advanced Trade account access.

Facts below come from Coinbase Developer Platform's Coinbase for Agents overview and the Coinbase for Agents skill docs as of September 24, 2026. Tool names, CLI flags, and payment caps are copied from those pages. No invented fee tiers, portfolio limits, or unsupported harnesses.

Key Takeaways

  • Remote MCP URL is https://agents.coinbase.com/mcp via OAuth; local CLI uses a CDP API key with Trade and Transfer scopes.
  • Create a separate Advanced portfolio, fund only what you can lose, and scope the agent to that portfolio on approval or key creation.
  • Preview every order with coinbase orders preview (or orders_preview) before coinbase orders create.
  • x402 research pays from retail Coinbase USDC on Base; discovery is free, fetch is capped at 5 USDC per payment.
  • This stack is account access plus trading and curated x402 data, not AgentKit wallet payments or Business Checkouts acceptance.
⚠️
Named downside: hosted chat clients sometimes draft orders and stop short of executing them, equity tooling is thinner than spot crypto, and x402 payments are irreversible once settled on Base. Portfolio isolation and explicit authorization language are operator controls, not a guarantee the model will refuse a bad trade.

Who this is for

Use this path if you run an MCP-compatible agent (Claude, Claude Code, ChatGPT with developer plugins, Grok, or a custom harness), you already understand USDC, Base, and x402 at a high level, and you want the agent to act inside a Coinbase Advanced Trade account.

Skip it if you need a programmatic AgentKit wallet paying arbitrary x402 endpoints (see How to Pay for an x402 API with Coinbase AgentKit), you need a dedicated agentic wallet object (see How to Create a Coinbase Agentic Wallet for USDC), you are accepting agent payments as a merchant (see Coinbase Business Checkouts and Accept x402 USDC from AI Agents), or you only need funding patterns (see How to Fund an AI Agent Wallet with USDC).

What Coinbase for Agents is

Coinbase for Agents connects AI apps to Coinbase Advanced Trade for spot crypto, eligible equities, US Derivatives (futures) in the default portfolio, portfolio management, and x402 payments for curated research. The agent can pay for trading data from existing Coinbase USDC, then propose or place trades you authorize.

Stablecoin Insider's take: treat remote MCP as the fastest human-in-the-loop setup, and treat the local CLI as the reliability path when hosted models refuse to place orders. Both are account connectors. Neither replaces spend-policy tooling you still need when an agent holds an independent USDC wallet (see How to Set Spend Limits for an AI Agent USDC Wallet).

PathAuthBest forx402 research
Remote MCPOAuth to Coinbase accountChatGPT, Claude, Grok, Claude Code HTTP MCPYes (core MCP tools)
Local CLI + MCPCDP API key + OS keyringConsistent trade execution across modelsYes (coinbase x402 *)
AgentKit (different product)Developer wallet / CDP SDKPaying arbitrary x402 APIsSeparate guide

Step 1: Isolate a portfolio before any connector

Create a separate Advanced portfolio in Coinbase. Fund it with only the cash and USDC you are willing to risk with an agent. On the OAuth approval screen or when creating the CDP API key, scope access to that portfolio.

Coinbase's own guidance is explicit: portfolio isolation limits blast radius if the agent places an unexpected trade. US Derivatives only work in the default portfolio, so keep futures out of an agent-scoped portfolio unless that risk is intentional.

Operator check: list portfolios after connect with coinbase portfolios list (CLI) or the MCP portfolios_list tool and confirm the UUID matches the funded agent portfolio.

Step 2: Connect remote MCP (fastest path)

Point a supported harness at https://agents.coinbase.com/mcp. Coinbase documents ChatGPT (developer mode plugin), Grok / Grok Bot, Muse, Perplexity Computer, Claude custom connector, and Claude Code HTTP MCP.

Claude Code example from the docs:

claude mcp add coinbase --transport http https://agents.coinbase.com/mcp
# then in Claude: /mcp → coinbase → Authenticate

After OAuth, ask the agent to list portfolios. If the list is empty or wrong, reconnect and reselect the agent portfolio on the approval screen. Deleting a chat is not the same as revoking access; revoke under Coinbase Account → Security → Connections when you want the connector gone.

Step 3: Install the local CLI for reliable execution

Hosted high-reasoning modes sometimes draft an order and stop. Coinbase documents the local CLI as the most consistent execution path. Requirements from the overview: Node.js 22+, then:

npm install -g @coinbase/coinbase-cli
coinbase --version

# CDP Portal → API Keys → Create API Key
# Advanced Settings → Coinbase App & Advanced Trade:
#   Accounts: select the agent portfolio
#   Enable Trade and Transfer (Transfer is portfolio-to-portfolio only)
#   Opt out of IP allowlisting if you have not set IPs

coinbase env live --key-file ./cdp_api_key.json
coinbase env
coinbase balance

Transfer scope moves funds between your portfolios only. It does not allow withdrawals to external addresses. Still treat the key like production credentials: store it in the OS keyring path the CLI uses, rotate if leaked, and never paste the secret into a chat transcript.

Step 4: Verify market data, then preview an order

Before any live order, confirm product IDs and balances. Useful CLI and MCP pairs from the docs:

  • coinbase products get BTC-USD / products_get: price, 24h volume, size limits
  • coinbase balance / balance: crypto and fiat balances
  • coinbase orders preview ... / orders_preview: fill estimate, fees, slippage

Market buy example (quote size is the USD amount to spend):

coinbase orders preview product_id=ETH-USDC side=BUY type=market quote_size=25
# only after preview looks correct:
coinbase orders create product_id=ETH-USDC side=BUY type=market quote_size=25

Prompt the agent with one explicit instruction that includes order type, amount, asset, and portfolio. Coinbase's testing notes show vague prompts cause wrong product IDs (for example ETH-USD instead of ETH-USDC). Prefer: "Buy 25 USDC of ETH in my agent portfolio."

Step 5: Pay for curated x402 research from USDC

Coinbase for Agents can pay per request for curated trading data and research (providers listed in the catalog such as Arkham, Glassnode, Nansen, and others) from your retail Coinbase USDC balance on Base. You do not need a separate wallet or provider API key for those catalog resources.

Operator loop from the docs:

  • Discover (free): coinbase x402 resources or MCP coinbase_x402_resources
  • Set a research budget in chat (instruction only; not a server-enforced session cap)
  • Fetch: coinbase x402 fetch / coinbase_x402_fetch with optional max_amount in atomic USDC (1000000 = 1 USDC)
  • Review: cite data, report spend, propose a trade only if instructed

Hard limits documented by Coinbase: payments are capped at 5 USDC per payment; max_amount can lower but not raise that ceiling; settled x402 payments are irreversible on Base. Generate an idempotency_key UUID before a payment and reuse it if the outcome is unknown. A successful payment authorization does not guarantee usable provider data.

💡
Stablecoin Insider's take: keep research authorization separate from trade authorization. Paying 1 USDC for a flow report must never silently authorize a market buy. If you need enforceable onchain spend policies around a developer wallet, use AgentKit or another wallet stack with policy rails instead of this account connector.

Step 6: Smoke-test before production prompts

Run this checklist on a Monday morning before handing the connector to an unsupervised agent session:

  • Remote or CLI auth returns the expected agent portfolio UUID.
  • balance shows only the intended funded amounts.
  • orders preview succeeds for a tiny notional; do not create until preview fees look sane.
  • x402 resources returns catalog entries with advisory prices; run one sub-1 USDC fetch if research is in scope.
  • Revoke path is documented for the operator (Connections page or key delete).

FAQ

Is Coinbase for Agents the same as Coinbase AgentKit?

No. Coinbase for Agents connects an agent to a Coinbase Advanced Trade account via MCP or CLI for trading, portfolio tools, and curated x402 research paid from retail USDC. AgentKit is a developer wallet SDK path for paying arbitrary x402 APIs. Use the AgentKit guide when the wallet, not the brokerage account, is the payment instrument.

Do I need a CDP API key for remote MCP?

No. Remote MCP uses OAuth to your Coinbase account. The CDP API key is for the local @coinbase/coinbase-cli path and for operators who need consistent execution outside hosted chat clients.

How do x402 payments settle?

Catalog fetches settle in USDC on Base through the x402 protocol from your Coinbase USDC balance. Discovery is free. Each payment is capped at 5 USDC, and settled payments are irreversible.

Can the agent withdraw USDC to an external address?

Transfer scope on the CDP key moves funds between your portfolios only. It does not allow withdrawals to external addresses. Still isolate the portfolio and keep funding minimal.

Which harnesses work with remote MCP today?

Coinbase documents ChatGPT (developer mode), Grok, Grok Bot, Muse, Perplexity Computer, Claude, and Claude Code. Other harnesses should use the CLI, or request support through Coinbase's Discord channel listed in the docs.

What should I do if the agent only previews trades?

Ask it explicitly to place the order, or switch to the local CLI. Coinbase notes that high-reasoning modes on hosted clients sometimes draft orders without executing them.

Should I use ETH-USD or ETH-USDC in prompts?

Specify the exact product_id you want. Coinbase testing found lower-tier models sometimes pick ETH-USD when operators meant ETH-USDC. Include portfolio, side, type, and size in one instruction.


Stablecoin Insider's take

💬
Stablecoin Insider's take: Coinbase for Agents is the right first connector when the job is "act inside my Coinbase account with a hard portfolio fence." It is the wrong first connector when the job is "agent holds USDC and pays arbitrary APIs under a policy engine." Pick the named object that matches the custody model, then write prompts that separate research spend from trade authority.

Next Monday: isolate the portfolio, connect one harness, run balance + orders preview, and only then enable a capped x402 research prompt. Keep AgentKit and Business Checkouts on separate runbooks.

How to Pay for an x402 API with Coinbase AgentKit (2026)
Use AgentKit when the agent must pay third-party x402 APIs from a developer wallet rather than a Coinbase Advanced Trade account.

Need the merchant-side accept path instead? Start with accepting x402 USDC from AI agents, then compare Coinbase Business Checkouts.

Accept x402 USDC from agents

This content is provided for informational and educational purposes only and does not constitute financial, investment, legal, or tax advice; no material herein should be interpreted as a recommendation, endorsement, or solicitation to buy or sell any financial instrument, and readers should conduct their own independent research or consult a qualified professional.

Latest