2.5 KiB
Codex integration
Production profile
Codex uses one MCP server per project/environment. Production endpoints are:
https://mcp.example.com/mcp/ludarium/prod
https://mcp.example.com/mcp/vacatureradar/prod
https://mcp.example.com/mcp/mobilityops/prod
The deployed Authentik 2025.12.6 supports M2M client credentials and app
passwords, but not the policy-bound Dynamic Client Registration introduced in
Authentik 2026.8. Codex therefore uses the repository's stdio bridge. The
bridge retrieves five-minute Authentik access tokens and refreshes them without
putting tokens or app passwords in Codex configuration.
Each profile requires:
- a dedicated Authentik service account and app password;
- the exact Authentik user UUID as the Hub client subject;
- one active Hub binding to one project/environment;
- a local credential file readable only by the current OS user;
- a Codex stdio entry created by
scripts/install_codex_mcp.ps1.
Operator sequence
- Generate the local credential with
scripts/new_codex_credential.ps1. - Pipe
scripts/authentik_provision_mcp_service_account.pyinto the Authentik container'sak shell, passing the credential through a temporary file. - Run
scripts/provision_machine_client.pyin the control API container with the exact returned subject UUID. Supply--client-idwhen activating a pending UI-created record. - Install the profile:
.\scripts\install_codex_mcp.ps1 `
-Project '<project>' `
-Environment 'prod' `
-HubClientId '<hub-client-uuid>' `
-OAuthUsername 'svc-mcp-codex-<project>' `
-SecretFile '<user-only-credential-file>'
- Restart Codex and verify the server with
codex mcp list. - Prove
initialize,tools/list, one read-only invocation, audit creation, and a cross-project denial.
Never copy an app password into config.toml, a command argument, Git,
evidence, UI output, logs or chat. Disabling/revoking the Hub client denies new
calls even if an Authentik token has not yet expired.
Useful workflows
Runtime connectors publish these user-invoked prompts:
project-context-packandpre-change-impact-review;repository-change-reviewandrelease-readiness;production-incident-triageanddeployment-health-review;fleet-operations-morning-brief.
The Gitea surface also exposes pull-request summaries, bounded changed-file metadata, and commit/CI statuses. The Unraid surface exposes an aggregate project summary in addition to container health, inspect and bounded logs.