Codex CLI
Connect OpenAI Codex CLI to the CoreClaw MCP Server so you can discover CoreClaw workers, run them, monitor runs, and retrieve results directly from your terminal conversations.
Prerequisites
Section titled “Prerequisites”- Codex CLI installed (
npm install -g @openai/codex) - A CoreClaw account with an API key from Console -> Settings -> API & Integrations
Configuration
Section titled “Configuration”Codex CLI supports MCP via Streamable HTTP transport. You can configure it with 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 use your preferred MCP config location:
{ "mcpServers": { "coreclaw": { "url": "https://mcp.coreclaw.com/mcp", "headers": { "api-key": "YOUR_CORECLAW_API_KEY" } } }}Replace YOUR_CORECLAW_API_KEY 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, place the config at ~/.config/codex/mcp.json on macOS/Linux or %APPDATA%\codex\mcp.json on Windows if your Codex installation loads that path automatically.
Verify the Connection
Section titled “Verify the Connection”- Start Codex with the MCP configuration.
- Ask Codex: “Find Amazon workers on CoreClaw.”
- Codex should call
list_store_workersand return matching workers.
Example Conversation
Section titled “Example Conversation”You: Find a Google Maps worker and extract restaurant data near Times Square, New York.
Codex: I’ll find a Google Maps worker, inspect its input schema, and run it for you. [Calls
list_store_workers->get_worker_input_schema->run_worker->get_worker_run->list_worker_run_results]
Useful Tool Flow
Section titled “Useful Tool Flow”- Use
list_store_workersto find public marketplace workers. - Use
get_worker_input_schemabefore composingrun_workerinput. - Use
run_workerwithinput_jsonfor ad-hoc runs. - Use
get_worker_runto poll run status. - Use
list_worker_run_results,export_worker_run_results, orget_worker_run_logafter the run starts.
Troubleshooting
Section titled “Troubleshooting”MCP config not loading
Section titled “MCP config not loading”- Verify the JSON file path passed to
--mcp-config. - Ensure the JSON is valid.
- Restart the Codex session after config changes.
Authentication errors
Section titled “Authentication errors”- Ensure the
api-keyheader value matches your CoreClaw API key exactly. - The hosted MCP service also accepts
X-API-KeyandAuthorization: Bearer YOUR_CORECLAW_API_KEY. - Verify your key is active in the Console.
Tools not available
Section titled “Tools not available”- Confirm Codex CLI supports Streamable HTTP MCP.
- Check the Codex session logs for MCP connection errors.