config.toml for a given Codex host.
Copy the endpoint from the MCP consumer Connect tab:
ag_. A TrustGuard
collector key (tgk_…) never authenticates MCP.
Where the config lives
Each server is one
[mcp_servers.<name>] table. The key is snake_case (mcp_servers, not
mcpServers). url selects HTTP transport; command selects stdio. Mixing keys from both
in one table is rejected.
OAuth consumers (recommended)
auth defaults to oauth, so the URL is the whole entry:
/.well-known/oauth-authorization-server, /.well-known/oauth-protected-resource, and a
registration endpoint, so no client ID or secret is pasted.
Codex logs in against TrustGate, not against your IdP directly, so nothing has to be
registered per developer. Override the callback only when the machine needs a fixed port or
a non-loopback base, such as a remote devbox:
https URLs,
http loopback URLs, and private-use schemes, and rejects anything else with
invalid_redirect_uri.
Which IdP backs the login is a consumer setting, attached once in the console — see
Okta or
Entra ID.
API-key consumers
Keep the key out of the file withenv_http_headers, which reads the value from the
environment at connect time:
bearer_token_env_var also works — TrustGate accepts Authorization: Bearer ag_…
alongside X-AG-API-Key and x-api-key:
Private (Hybrid) data plane
Add the gateway slug unless the MCP host already scopes the gateway:env_http_headers for the API key when the consumer is not OAuth.
Tool policy and limits
Which tools exist is decided in the NeuralTrust console — consumer Routing, or a role for Identity-based consumers. The keys below are Codex’s own client-side policy over that catalog.GUI setup
Both write the same
config.toml, so a server added in one client shows up in the others.
Verify
/mcp lists active servers. Then call a tool bound to the consumer and
confirm the request in TrustGate telemetry — see
Metrics.
Troubleshooting
Related
- MCP overview — consumers, catalog merging, upstream auth
- Auth — MCP consumers use API key or OAuth2
- TrustGuard Codex — firewall hooks (separate plane)
- Codex MCP docs