mcp subcommand.
Add the server
Codex reads the key from an environment variable and adds theBearer prefix itself, so the key never lands in the config file. Export it in your shell profile:
~/.codex/config.toml directly:
~/.codex/config.toml
codex mcp add has no --header flag. To pass the key inline instead of through a variable, use the config file: put http_headers = { "Authorization" = "Bearer 2xt_YOUR_API_KEY" } under [mcp_servers.2extract] in place of bearer_token_env_var.Verify
2extract should be listed. Then start Codex and ask:
What is my 2extract balance?
A number comes back, and no proxy was created.
Troubleshooting
Codex does not see the server
Codex does not see the server
Run
codex mcp list. If the entry is missing, the config file was not picked up - confirm the path is ~/.codex/config.toml and that the TOML parses.If the entry is there but not connecting, update Codex: older builds had no remote HTTP transport. Check codex mcp --help.Some tools fail, others work
Some tools fail, others work
A scope problem rather than a connection problem. The key is missing the scope those tools need - see Overview.
Next steps
Tools
Everything the agent can call.
Other clients
The three values any MCP client needs.