Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`codex mcp get --json` omits the configured `required` flag

Open Beginner friendly
#56,057 1 comment 0 reactions 0 assignees View on GitHub

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
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

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

bug CLI config mcp
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:

https://github.com/openai/codex/blob/2a77e82f09212c9e1bbf02656afca5d8172c5f9e/codex-rs/config/src/mcp_types.rs#L244-L248

run_get manually builds the JSON object in codex-rs/cli/src/mcp_cmd.rs:999-1012 and does not copy server.required:

https://github.com/openai/codex/blob/2a77e82f09212c9e1bbf02656afca5d8172c5f9e/codex-rs/cli/src/mcp_cmd.rs#L999-L1012

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.