Codex CLI (codex)
OpenAI Codex connects over HTTP and supports OAuth login.
OAuth (recommended)
codex mcp add protege-mcp --url http://127.0.0.1:8123/mcp
codex mcp login protege-mcp
codex mcp login opens the browser consent flow — approve it and you’re connected.
Static bearer token
Read the token from Protégé’s MCP Server view, expose it via an environment variable, then add the server referencing that variable:
export PROTEGE_MCP_TOKEN="<TOKEN>"
codex mcp add protege-mcp --url http://127.0.0.1:8123/mcp \
--bearer-token-env-var PROTEGE_MCP_TOKEN
Verify
codex mcp list # shows protege-mcp
Ask Codex to “list the classes in the active ontology via protege-mcp” to confirm tool calls reach Protégé.
Troubleshooting
401 Unauthorized— runcodex mcp login protege-mcp(OAuth), or confirmPROTEGE_MCP_TOKENmatches the current token in Protégé.- Connection refused — start the server from the MCP Server view and verify the port.
- Edits rejected — check for read-only mode or a pending confirm-each-write dialog in Protégé (Settings ▸ MCP).