Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#56,057 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@akhil9tiet がすでに取り組んでいます。

2026年10月22日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli

調査の方向性

codex-rs/cli/src/mcp_cmd.rsから始め、run_getがJSONオブジェクトを構築する箇所で、MCPサーバー設定の読み取り方を確認します。設定されたrequiredの値を出力に追加し、required = trueを読み込んでJSONを確認する統合テストでカバーします。codex mcp get docs --jsonに"required": trueが含まれれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
130k
フォーク
20.5k
平均マージ
1分
マージ済み PR(30日)
996

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openai/codex のほかの issue

openai/codex の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。