Install in Your AI Client
Connect Hive to Codex CLI
Add Hive to Codex CLI and OpenAI's coding agent gets live crypto data without a wrapper script. Drop one block into ~/.codex/config.toml and Codex picks up every Hive tool on the next session.
Before you start
- Codex CLI installed:
npm install -g @openai/codex(orbun install -g @openai/codex). Verify withcodex --version. - A free Hive API key from /dashboard/keys.
Codex stores its config at ~/.codex/config.toml. Create the file if it doesn't exist.
Option 1: Remote HTTP (recommended)
Codex's mcp_servers table speaks streamable HTTP natively when you set url. Pair it with bearer_token_env_var so your key isn't written to disk.
Export the key in your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish):
export HIVE_API_KEY="your_hive_api_key"
Then add this to ~/.codex/config.toml:
[mcp_servers.hive]
url = "https://mcp.hiveintelligence.xyz/mcp"
bearer_token_env_var = "HIVE_API_KEY"
That's the whole setup. Codex reads HIVE_API_KEY at session start and sends Authorization: Bearer … on every request to mcp.hiveintelligence.xyz. No local Node process, no npx re-download.
If you prefer to inline the key (not recommended for shared dotfiles), use http_headers instead:
[mcp_servers.hive]
url = "https://mcp.hiveintelligence.xyz/mcp"
http_headers = { Authorization = "Bearer YOUR_HIVE_API_KEY" }
Option 2: Local stdio wrapper
If your machine can't reach mcp.hiveintelligence.xyz directly (corporate proxy, air-gapped setup), spawn the wrapper as a subprocess. Requires Node 18+.
[mcp_servers.hive]
command = "npx"
args = ["-y", "hive-intelligence@latest"]
env = { HIVE_API_KEY = "YOUR_HIVE_API_KEY" }
The wrapper still authenticates with Authorization: Bearer upstream — it's the same auth path, just routed through your local Node.
Verify it worked
Start a new Codex session:
codex
Then ask:
"What is the current price of BTC, ETH, and SOL?"
Codex should call Hive's get_price tool and surface the result inline. If you don't see a tool call, run /mcp inside Codex to confirm hive is listed and healthy.
Version note
Codex's MCP keys (url, bearer_token_env_var, http_headers, env) are recognized by the upstream Codex CLI; the canonical schema lives in the Codex source (codex-rs/codex-mcp/src/mcp/auth.rs) and the Codex config reference. The published config.md only shows stdio examples today, but HTTP fields work in current builds — verify with codex /mcp after restart.
What to ask in Codex
Codex shines at multi-step coding work that needs live data. Try:
- "Generate a TypeScript client that calls Hive's wallet-balances tool and types the response strictly — no
any." - "Scan the top 20 DeFi pools on Base by APY, then write a Node script that emails me when a new pool enters the top 5."
- "Run a honeypot check on this token before I hardcode the address in
src/contracts.ts: 0x6B175474E89094C44Da98b954EedeAC495271d0F." - "Pull funding rates for BTC perpetuals across Binance, Bybit, and OKX, then commit a Markdown summary to
docs/funding.md."
Codex chains tool calls and file edits in the same turn — you don't need to name specific Hive tools.
Troubleshooting
codex: command not found. The global install didn't land on your PATH. Try npm root -g and confirm that directory's bin is on PATH, or reinstall with bun install -g @openai/codex.
TOML parse error on startup. Codex prints the line number. Most failures are unquoted strings or a missing =. The [mcp_servers.hive] table header must come before its keys, and string values must be double-quoted.
401 Unauthorized on tool calls. The bearer_token_env_var value points to an env var name — not the key itself. Make sure echo $HIVE_API_KEY returns your key in the same shell that launches codex. If you used http_headers, the format is Authorization = "Bearer <key>" with a literal space after Bearer.
hive doesn't appear in /mcp. Restart your shell so the exported HIVE_API_KEY is visible to Codex. If the table is in config.toml but Codex still skips it, check for a typo in the table header — [mcp_servers.hive] (singular hive) is the server id, and Codex is case-sensitive.
stdio transport — "npx: command not found". Install Node 18+ from nodejs.org, restart Codex.
Other clients
- Cursor — IDE-native crypto queries with one-click deeplink
- Claude Code —
claude mcp addCLI flow for Anthropic's agent - All clients — full list
Next steps
- Quick Start — REST, MCP, and CLI basics
- Tools Reference — every tool Codex can call
- JavaScript SDK — strongly typed Hive client for code Codex generates