Skip to main content

Prerequisites

Codex CLI requires Node.js 22+. Install it from nodejs.org. Install Codex CLI globally:
npm install -g @openai/codex
Verify the installation:
codex --version
The Codex CLI and Codex IDE extension share the same ~/.codex/config.toml configuration. If you’ve already set up Danube in the IDE extension, it will work in the CLI automatically.

Setup

1

Add the Danube MCP Server

Use the Codex CLI to add Danube as a Streamable HTTP server:
codex mcp add danube --url https://mcp.danubeai.com/mcp \
  --header "danube-api-key: YOUR_API_KEY"
This writes the configuration to ~/.codex/config.toml.
2

Verify Connection

Launch Codex CLI and use the /mcp command to verify the server is connected:
codex
Then type:
/mcp
You should see danube listed with its available tools.

Manual Configuration

You can also configure the server directly in ~/.codex/config.toml:
[mcp_servers.danube]
url = "https://mcp.danubeai.com/mcp"

[mcp_servers.danube.http_headers]
danube-api-key = "YOUR_API_KEY"
For project-scoped configuration, create .codex/config.toml in your project root instead.

Troubleshooting

  1. Verify installation:
    npm list -g @openai/codex
    
  2. Check npm global bin directory is in PATH:
    npm config get prefix
    
    The codex command should be in {prefix}/bin/
  3. Add to PATH (if needed):
    export PATH="$(npm config get prefix)/bin:$PATH"
    
  • Check your internet connection
  • Verify the URL is correct: https://mcp.danubeai.com/mcp
  • Test the health check: curl https://mcp.danubeai.com/mcp/health
  • Increase the timeout in config: startup_timeout_sec = 30
  • Run /mcp in Codex to check the server status
  • Verify the config file syntax: cat ~/.codex/config.toml
  • Restart Codex after configuration changes