INTEGRATION · UPDATED

Connect Codex CLI to AdaptOrch in config.toml.

Codex CLI reads MCP servers from ~/.codex/config.toml. The AdaptOrch entry points Codex at the hosted endpoint, reads your AdaptOrch key from an environment variable, and forwards your provider settings as HTTP headers.

Client
Codex CLI
Transport
HTTP POST, JSON-RPC
Endpoint
https://adaptorch.com/mcp
Boundary
Not a correctness certificate

§ 01

Before you start

Create an account at /app/signup and an API key at /app/api-keys. Model execution also needs your provider, model and provider key; provider usage is billed by the provider separately from the AdaptOrch plan. Set these only in your local environment, never in a shared transcript or committed file.

export ADAPTORCH_API_KEY="ado_..."
export ADAPTORCH_PROVIDER="openai"
export ADAPTORCH_PROVIDER_MODEL="YOUR_SUPPORTED_MODEL"
export ADAPTORCH_PROVIDER_KEY="YOUR_PROVIDER_KEY"

§ 02

Configure Codex CLI

Merge 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.

[mcp_servers.adaptorch]
url = "https://adaptorch.com/mcp"
bearer_token_env_var = "ADAPTORCH_API_KEY"
env_http_headers = { "X-Provider" = "ADAPTORCH_PROVIDER", "X-Provider-Model" = "ADAPTORCH_PROVIDER_MODEL", "X-Provider-Key" = "ADAPTORCH_PROVIDER_KEY" }

Codex reads the values from the named environment variables, so the keys themselves never appear in the file. Keep the variables in your own secret environment.

§ 03

Confirm authentication without running a model

This read-only tools/list request checks the endpoint and your AdaptOrch key. It does not submit a run or spend provider budget. 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.

curl --fail --silent --show-error https://adaptorch.com/mcp \
  -H "Authorization: Bearer $ADAPTORCH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

§ 04

Submit one bounded run

Ask Codex CLI to call adaptorch_run once with the single-task payload below. This consumes plan allowance and provider budget, so do not resubmit it while polling.

{
  "payload": {"subtasks": [{"id": "ping", "description": "Reply exactly PONG", "estimated_tokens": 16}]},
  "synthesis_mode": "paper",
  "budget_policy": {"global_timeout_budget_seconds": 20}
}

Use the returned run_id with adaptorch_get_run and adaptorch_get_artifacts, or open /app/runs.

§ 05

What the record shows, and what it does not

The 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.

AdaptOrch 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 before relying on run records in a review process, and see the AI PR review guide for what to inspect.

§ 06

Codex CLI integration FAQ

Q.01Where does Codex CLI configure MCP servers?

In ~/.codex/config.toml under an [mcp_servers.<name>] table. AdaptOrch uses [mcp_servers.adaptorch] with url, bearer_token_env_var and env_http_headers.

Q.02Is the Codex configuration JSON?

No. Codex CLI uses TOML. A JSON mcpServers block from another client will not work in config.toml.

Q.03Does a SUCCEEDED run mean my tests passed?

No. 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.

Q.04Has AdaptOrch tested this client?

AdaptOrch 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.

NEXT

Other clients

See all AdaptOrch integrations, or the full MCP documentation for Gemini CLI, VS Code and Windsurf configuration formats.

START FREE WITH BYOK