Codex CLI
Connect OpenAI Codex CLI to the CoreClaw MCP Server so you can search for scrapers, run them, and retrieve data directly from your terminal conversations.
Prerequisites
Section titled “Prerequisites”- Codex CLI installed (
npm install -g @openai/codex) - A CoreClaw account with an API key — get it from Console → Settings → API & Integrations
Configuration
Section titled “Configuration”Codex CLI supports MCP via Streamable HTTP transport. You can configure it via a JSON config file.
Step 1: Create or edit the MCP configuration file
Section titled “Step 1: Create or edit the MCP configuration file”Create a file named codex-mcp.json in your project directory (or anywhere you prefer):
{ "mcpServers": { "coreclaw": { "url": "https://mcp.coreclaw.com/mcp", "headers": { "api-key": "scraper_api_YOUR_KEY_HERE" } } }}Replace scraper_api_YOUR_KEY_HERE with your actual CoreClaw API key.
Step 2: Launch Codex with the MCP config
Section titled “Step 2: Launch Codex with the MCP config”codex --mcp-config codex-mcp.jsonAlternatively, you can place the config at ~/.config/codex/mcp.json (macOS/Linux) or %APPDATA%\codex\mcp.json (Windows) for automatic loading.
Verify the connection
Section titled “Verify the connection”- Start Codex with the MCP configuration
- Ask Codex: “Search for Amazon scrapers on CoreClaw”
- Codex should invoke
search_scrapersand return results
Example conversation
Section titled “Example conversation”Once connected, you can perform scraping tasks directly from your terminal:
You: Find a Twitter scraper and extract the latest tweets from @elonmusk
Codex: I’ll search for a Twitter scraper and run it for you. [Calls
search_scrapers→get_scraper_details→run_scraper→ polls status → returns results]
Troubleshooting
Section titled “Troubleshooting”MCP config not loading
Section titled “MCP config not loading”- Verify the JSON file path is correct when using
--mcp-config - Ensure the JSON is valid (no trailing commas, proper quotes)
- Check Codex CLI version — MCP support requires recent versions
Authentication errors
Section titled “Authentication errors”- Ensure the
api-keyheader value matches your CoreClaw API key exactly - Verify your key is active in the Console
Tools not available
Section titled “Tools not available”- Confirm Codex CLI supports Streamable HTTP transport
- Try restarting the Codex session after config changes