cdp-setup
Set up the CDP CLI: install, configure API key and wallet secret, verify.Steps
-
Check Node.js:
node --version— must be >= 22. If missing or too old, install from https://nodejs.org/en/download Warning (nvm/fnm users): If you upgrade your default Node version, globally installed tools (e.g., Claude Code) will need to be reinstalled since each Node version has its own global packages. After upgrading, open a new terminal and reinstall any global tools you had on the previous version. -
Linux only — install keyring support (prevents secrets from being stored in plaintext):
-
Check if
cdpis installed:If not found: -
Create a CDP project and API key:
Go to https://portal.cdp.coinbase.com/projects/api-keys
- Sign in (a project is auto-created on first sign-in).
- Click Create API Key → Download the JSON key file.
- Provide the path to the downloaded file.
-
Generate a wallet secret (required for server wallet operations):
Go to https://portal.cdp.coinbase.com/products/server-wallet/accounts
- Click Generate Wallet Secret → Download the file.
-
Verify:
Assert:
liveappears with key ID and(wallet)indicator.Assert: returns JSON (no auth error). May return{"accounts":[]}. -
Quick test — create and fund an account (optional):
Server wallet accounts are network-agnostic — the same address works on any EVM network.Faucet tokens:
eth,usdc,eurc,cbbtc. Solana:cdp solana faucet address=<addr> token=sol. -
Set up MCP server (optional — gives your agent direct tool access to all CDP APIs):
The CDP CLI includes an MCP server (
cdp mcp) that exposes every API endpoint as a tool. Claude Code:Other agents — add to your agent’s MCP config (format varies by agent): -
Install agent skills (optional):
If non-interactive, determine your agent’s skills directory and pass it:
-
Codex users: If not running with
--sandbox danger-full-access(full access mode), the default sandbox cannot access OS keychain secrets. Options:- Prompt Codex to run
cdpcommands with “elevated access” (safest) - Or use the
cdp mcpserver instead of direct CLI commands (MCP has expected keychain access in Codex)
- Prompt Codex to run
- Troubleshooting:
- “Must use a CDP Entity scoped API key” → need a v2 portal key, not legacy
- “Wallet authentication error” → wallet secret missing or incorrect
- “forbidden” → API key permissions issue
- After upgrading Node via nvm/fnm → open a new terminal, reinstall global tools that were on the old version
- Windows:
cdpnot found afternpm i -g→ add npm’s global bin to PATH:%APPDATA%\npm