`codex mcp get --json` omits the configured `required` flag
Maintainers usually reply within 1 day
@akhil9tiet is already working on this.
Since Oct 22, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in codex-rs/cli/src/mcp_cmd.rs, where run_get builds the JSON object, and check how it reads the MCP server config. Add the configured required value to the output and cover it with an integration test that loads required = true and checks the JSON. Done when codex mcp get docs --json includes "required": true.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.163.0
What subscription do you have?
Not relevant. This is a local configuration command.
Which model were you using?
Not relevant. The command does not start a model turn.
What platform is your computer?
Linux x86_64
What terminal emulator and version are you using?
zsh 5.9. The terminal does not matter here because the command is non-interactive.
Codex doctor report
Not included because this reproduction uses an isolated CODEX_HOME and does not depend on machine state.
What issue are you seeing?
codex mcp get docs --json omits required when the server is configured with required = true. The command exits successfully and prints the other server settings, so users and scripts cannot determine from this output whether the server is required.
The CLI reference says this command prints the raw config entry: https://learn.chatgpt.com/docs/cli/reference
What steps can reproduce the bug?
Run this with Codex CLI 0.163.0:
test_home="$(mktemp -d)" && printf '%s\n' '[mcp_servers.docs]' 'command = "printf"' 'required = true' > "$test_home/config.toml" && CODEX_HOME="$test_home" codex mcp get docs --json
The output is:
{
"name": "docs",
"enabled": true,
"disabled_reason": null,
"transport": {
"type": "stdio",
"command": "printf",
"args": [],
"env": null,
"env_vars": [],
"cwd": null
},
"enabled_tools": null,
"disabled_tools": null,
"startup_timeout_sec": null,
"tool_timeout_sec": null
}
required is absent.
What is the expected behavior?
The JSON should include the configured value:
"required": true
Additional information
McpServerConfig retains this value in codex-rs/config/src/mcp_types.rs:244-248:
run_get manually builds the JSON object in codex-rs/cli/src/mcp_cmd.rs:999-1012 and does not copy server.required:
The smallest fix is to add "required": server.required to that object and cover it with an integration test that loads required = true and checks the JSON output.
- Dominant language
- Rust
- Stars
- 130k
- Forks
- 20.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 996
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
-
app automations enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
[CLI][TUI] Status line formats 1M input tokens as "1000K"Possibly taken @akhil9tiet claimed this 1 day ago. Openbug CLI rate-limits TUI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openai/codex#56106 · 3 comments ·
Maintainers usually reply within 1 day
-
app bug context windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
CLI config enhancement mcp
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openai/codex#55786 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug CLI TUI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
bug: workspace access hint suggests a --subject command that fails for hyphen-leading OIDC subjectsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
A-FFI C-Testing D-Straightforward S-Ready
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
docs priority:P3 size:XS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Appimage ConventionsOpenenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day