{"slug": "codex-cli-mcp-setup", "title": "Codex CLI MCP setup", "summary": "AdaptOrch published setup instructions for connecting its hosted MCP server to OpenAI's Codex CLI through the `~/.codex/config.toml` file, using an `[mcp_servers.adaptorch]` table with a `url` of https://adaptorch.com/mcp and a `bearer_token_env_var` pointing to ADAPTORCH_API_KEY. AdaptOrch states the connection has not been tested end to end in Codex CLI, that no free hosted LLM is bundled, and that a SUCCEEDED run is not a test pass because repository code checks require a separately configured execution environment. The guide includes a read-only `tools/list` curl request that returns HTTP 401 with \"Missing bearer token\" when no key is supplied, and a single bounded `adaptorch_run` payload with a 20-second global timeout budget.", "body_md": "INTEGRATION · UPDATED\n\n# Connect Codex CLI to AdaptOrch in config.toml.\n\nCodex CLI reads MCP servers from `~/.codex/config.toml`. The AdaptOrch entry points Codex at the hosted endpoint and reads your AdaptOrch key from an environment variable. No free hosted LLM is bundled; BYOK provider headers are optional.\n\n§ 01\n\n## Before you start\n\nCreate an account at [/app/signup](https://adaptorch.com/app/signup?entrypoint=integration-codex) and an API key at /app/api-keys. Authenticate with your AdaptOrch API key. No free hosted LLM is bundled; BYOK provider headers are optional when you want model calls. Set the key only in your local environment, never in a shared transcript or committed file.\n\n```\nexport ADAPTORCH_API_KEY=\"ado_...\"\n```\n\n§ 02\n\n## Configure Codex CLI\n\nMerge the block into `~/.codex/config.toml` without replacing existing servers. The file is TOML, not JSON. After setup, check the server list with `/mcp` inside Codex.\n\n```\n[mcp_servers.adaptorch]\nurl = \"https://adaptorch.com/mcp\"\nbearer_token_env_var = \"ADAPTORCH_API_KEY\"\n```\n\nCodex reads the AdaptOrch key from the named environment variable, so the key itself never appears in the file. Keep it in your own secret environment. To use your own provider account instead (BYOK), also set ADAPTORCH_PROVIDER, ADAPTORCH_PROVIDER_MODEL and ADAPTORCH_PROVIDER_KEY, and add `env_http_headers` that map X-Provider, X-Provider-Model and X-Provider-Key to those variable names.\n\n§ 03\n\n## Confirm authentication without running a model\n\nThis read-only `tools/list` request checks the endpoint and your AdaptOrch key. It does not submit a run or spend plan allowance. A valid key returns a `result.tools` array that includes `adaptorch_run`. Without a key the endpoint answers HTTP 401 with `Missing bearer token`, which still proves it is reachable.\n\n```\ncurl --fail --silent --show-error https://adaptorch.com/mcp \\\n  -H \"Authorization: Bearer $ADAPTORCH_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\"}'\n```\n\n§ 04\n\n## Submit one bounded run\n\nAsk Codex CLI to call `adaptorch_run` once with the single-task payload below. This consumes plan allowance; optional BYOK model tokens are billed by your provider. Do not resubmit it while polling.\n\n```\n{\n  \"payload\": {\"subtasks\": [{\"id\": \"ping\", \"description\": \"Reply exactly PONG\", \"estimated_tokens\": 16}]},\n  \"synthesis_mode\": \"paper\",\n  \"budget_policy\": {\"global_timeout_budget_seconds\": 20}\n}\n```\n\nUse the returned `run_id` with `adaptorch_get_run` and `adaptorch_get_artifacts`, or open /app/runs.\n\n§ 05\n\n## What the record shows, and what it does not\n\nThe run record shows the inputs, the selected model and outputs, recorded commands and check outcomes when an execution environment is configured, and open review items. A SUCCEEDED run is not a test pass: a repository code check needs a separately configured execution environment, and missing or skipped checks stay unverified.\n\nAdaptOrch documents the Codex CLI configuration format above, but this connection has not been tested by AdaptOrch end to end in Codex CLI. Read the [claim boundary](https://adaptorch.com/claim-boundary) before relying on run records in a review process, and see the [AI PR review guide](https://adaptorch.com/ai-pr-review/) for what to inspect.\n\n§ 06\n\n## Codex CLI integration FAQ\n\n## Q.01Where does Codex CLI configure MCP servers?\n\nIn ~/.codex/config.toml under an [mcp_servers.<name>] table. AdaptOrch uses [mcp_servers.adaptorch] with url and bearer_token_env_var. Provider headers are optional for BYOK.\n\n## Q.02Is the Codex configuration JSON?\n\nNo. Codex CLI uses TOML. A JSON mcpServers block from another client will not work in config.toml.\n\n## Q.03Does a SUCCEEDED run mean my tests passed?\n\nNo. A completed run is not a test pass. A repository code check needs a separately configured execution environment, and only a record that shows the check actually ran counts as verification.\n\n## Q.04Has AdaptOrch tested this client?\n\nAdaptOrch documents this configuration format, but the connection has not been tested by AdaptOrch end to end in this client. Confirm it with the read-only tools/list request on this page.\n\nNEXT\n\n## Other clients\n\nSee all [AdaptOrch integrations](https://adaptorch.com/integrations/), or the full [MCP documentation](https://adaptorch.com/mcp-docs) for Gemini CLI, VS Code and Windsurf configuration formats.\n\nPro is $39 a month for 200 admitted runs and 5 workspace users. Team is $149 a month for 1,000 admitted runs and 15 workspace users. Both start with a 3-day free trial. No free hosted LLM is bundled; bringing your own API key and endpoint (BYOK) is optional. [Compare plans](https://adaptorch.com/#pricing) · [Start a 3-day free trial](https://adaptorch.com/app/signup?entrypoint=integration-codex)", "url": "https://wpnews.pro/news/codex-cli-mcp-setup", "canonical_source": "https://adaptorch.com/integrations/codex/", "published_at": "2026-11-25 08:34:29+00:00", "updated_at": "2026-11-25 09:11:53.700611+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools"], "entities": ["AdaptOrch", "Codex CLI", "OpenAI", "AdaptOrch MCP server", "adaptorch_run", "adaptorch_get_run", "adaptorch_get_artifacts"], "also_reported_by": [], "takeaway": "Codex CLI reads MCP servers from TOML in ~/.codex/config.toml, so an AdaptOrch entry needs `url = \"https://adaptorch.com/mcp\"` plus `bearer_token_env_var = \"ADAPTORCH_API_KEY\"` to keep the key out of the file, and a `tools/list` call verifies auth without spending plan allowance.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/codex-cli-mcp-setup", "markdown": "https://wpnews.pro/news/codex-cli-mcp-setup.md", "text": "https://wpnews.pro/news/codex-cli-mcp-setup.txt", "jsonld": "https://wpnews.pro/news/codex-cli-mcp-setup.jsonld"}}