Codex

Developer integration guide — connect GoldenClaw to OpenAI Codex CLI via MCP.

Prerequisites

Setup

1. Set Your API Key

Store your GoldenClaw API key as an environment variable:

Terminal
export GOLDENCLAW_API_KEY="YOUR_API_KEY"

Add this to your shell profile (~/.zshrc, ~/.bashrc) to persist across sessions.

2. Add GoldenClaw MCP Server

Option A: CLI Command

Terminal
codex mcp add goldenclaw \
  --transport http \
  --url https://stage.goldenclaw.sh/mcp \
  --bearer-token-env-var GOLDENCLAW_API_KEY

Option B: Config File

Edit ~/.codex/config.toml (global) or .codex/config.toml (project-scoped):

~/.codex/config.toml
[mcp_servers.goldenclaw]
url = "https://stage.goldenclaw.sh/mcp"
bearer_token_env_var = "GOLDENCLAW_API_KEY"

Project-scoped config

Project-scoped .codex/config.toml requires the project to be trusted first. Global config at ~/.codex/config.toml works everywhere.

3. Verify Connection

Launch Codex and type /mcp to see active servers. Then test with:

"What's the current BTC/USDT price on Binance futures?"

Example Prompts

"Calculate RSI for ETH/USDT on the 4h timeframe on Bybit"

"What are my open positions on Binance futures?"

"Show me Bollinger Bands for SOL/USDT on OKX"

"Analyze BTC/USDT: get price, RSI, and MACD on the 4h chart"

Remove Server

Terminal
codex mcp remove goldenclaw

Available Tools

CategoryTools
Market Dataget_price, get_ohlcv, get_ticker, get_pairs, get_symbols, get_timeframes
Tradingplace_order, cancel_order, get_orders, get_positions, close_position
Accountget_balance, get_account
Analysiscalculate_indicator (35+ indicators)
Discoverylist_exchanges

See MCP Tools for full tool documentation.

Troubleshooting

"Unauthorized" error

Verify GOLDENCLAW_API_KEY is set correctly:

Terminal
echo $GOLDENCLAW_API_KEY

If empty, set it again. If the key is expired, generate a new one from your Dashboard.

Server not connecting

Check that you're using --transport http. Codex supports both stdio and HTTP transports — GoldenClaw requires HTTP.

Tools not appearing

Run /mcp in the Codex TUI to check server status. If GoldenClaw is listed but tools aren't loading, restart Codex.