`codex doctor` suggests setting MCP env vars when an MCP server is just unreachable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cli, rust
- Domain
- cli, developer-experience
Research direction
The misleading hint is set once for any non-OK mcp status in codex-rs/cli/src/doctor.rs around lines 1673-1689. Read that block and how missing_env and the reachability results feed into it. Make the hint depend on which problem actually occurred, then reproduce with the steps in the issue and check that an unreachable server no longer mentions env vars.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.166.0 (also reproduces on 0.164.0)
What subscription do you have?
Pro
Which model were you using?
None, no model call involved.
What platform is your computer?
macOS 26.6, arm64
What terminal emulator and version are you using (if applicable)?
No response
Codex doctor report
[!!] mcp MCP configuration has optional issues - Set the missing MCP env vars or disable the affected server.
configured servers 1
disabled servers 0
streamable_http servers 1
optional reachability dead: http://127.0.0.1:1/mcp (HEAD connect failed; GET connect failed)
What issue are you seeing?
When a streamable HTTP MCP server can't be reached, the mcp check tells you to set missing env vars. No env var is missing. The server is just down.
The remediation is set once for any non-OK status, but that status can come from unreachable servers alone, with missing_env empty:
What steps can reproduce the bug?
export CODEX_HOME=$(mktemp -d)
codex mcp add dead --url http://127.0.0.1:1/mcp
codex doctor --no-color --ascii
What is the expected behavior?
The hint should match the cause. Something like "Check that the server URL is reachable, or disable the server" for unreachable servers, and the env var hint only when env vars are actually missing.
Additional information
No response
- Dominant language
- Rust
- Stars
- 131k
- Forks
- 20.7k
- Avg merge
- 1m
- Merged PRs (30d)
- 997
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
bug memory windows-os
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Skill Creator quick validator rejects standard compatibility frontmatterPossibly taken @akhil9tiet claimed this 3 days ago. Openbug skills
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openai/codex#58538 · 2 comments ·
Maintainers usually reply within 1 day
-
app bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
app bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
riverqueue/river#1576 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
stadelmanma/fitparse-rs#64 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day