Unable to authenticate with MCP server when running in remote environment
Open 💬 4 comments Opened Jan 7, 2026 by WhammyLeaf
What version of Codex is running?
0.79.0
What subscription do you have?
Own API key
Which model were you using?
gpt-5.1
What platform is your computer?
Linux 5.15.0-305.176.4.el8uek.x86_64 x86_64 x86_64
What issue are you seeing?
We are running the codex CLI tool in a remote codeserver/WebIDE environment. It is impossible to access OAuth protected MCP servers in this environment due to Codex using localhost as callback URI: the localhost will point to the machine that the user is on, not the machine that codex is running on.
What steps can reproduce the bug?
- Setup a codeserver/WebIDE environment.
- Define config for an OAuth protected MCP server in
config.toml - try to authenticate with codex mcp login [NAME]
- new tab opens in browser window
- but OH NO: "This site can’t be reached"
What is the expected behavior?
New tab in browser should indicate successful authentication and when going back to codeserver tab, the MCP server authentication process in the terminal should be completed.
Additional information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗