MCP: Missing login/logout commands in CLI; cannot authenticate MCP servers
Resolved 💬 2 comments Opened Oct 6, 2025 by rohittcodes Closed Oct 15, 2025
What is the type of issue?
Documentation is confusing
What is the issue?
Issue description
- The Codex CLI’s MCP subcommand does not expose login/logout commands. This makes it impossible to authenticate against MCP servers that require auth.
- The CLI help only shows 5 commands: list, get, add, remove, help.
Current behavior
When running:codex mcp --help or even codex mcp login <server>
Output:
[experimental] Run Codex as an MCP server and manage MCP servers
Usage: codex mcp [OPTIONS] <COMMAND>
Commands:
list [experimental] List configured MCP servers
get [experimental] Show details for a configured MCP server
add [experimental] Add a global MCP server entry
remove [experimental] Remove a global MCP server entry
help Print this message or the help of the given subcommand(s)
error: unrecognized subcommand 'login'
Usage: codex mcp [OPTIONS] <COMMAND>
For more information, try '--help'.
Expected behavior
- CLI should provide authentication flows for MCP servers, e.g.:
- codex mcp login
- codex mcp logout
- If auth is not yet supported, documentation should clearly state that MCP auth/login is currently unavailable and provide a recommended workaround for HTTP/remote MCP servers that require credentials (env vars, config tokens, or per-server headers).
Impact
- Cannot authenticate with HTTP-based or remote MCP servers that require login/session management.
- Blocks testing and usage of MCP servers that are not purely local or unauthenticated.
- Confusing for users because CLI appears to manage MCP servers but lacks auth primitives.
Environment
- Codex CLI version: codex-cli 0.44.0
- OS: Windows 11
- Install method: npm install -g @openai/codex@latest
Repro steps
1) Install Codex:
npm install -g @openai/codex@latest
2) Check MCP help:
codex mcp --help
3) Observe that only list/get/add/remove/help are present, with no login/logout.
4) Attempt to connect to an MCP server requiring authentication; there is no documented CLI flow to authenticate.
Questions/requests
- Is MCP authentication intentionally not implemented yet in the CLI?
- If yes, is there a recommended temporary approach (e.g., config.toml tokens, per-server headers, env vars) to connect to authenticated MCP servers?
- If implementation exists, please document the correct commands/flags and examples.
- If not yet available, please consider adding:
- codex mcp login <server> with interactive and headless options
- codex mcp logout <server>
- Support for storing/removing credentials, token refresh, and non-interactive usage for CI
Additional context
- The lack of auth commands prevents adoption for any MCP server that is not publicly open.
- Clear docs or explicit “not yet supported” guidance would help set expectations and offer interim workarounds.
Where did you find it?
https://github.com/openai/codex/blob/main/docs/config.md#mcp-cli-commands
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗