codex - 💡(How to fix) Fix MCP CLI should expose validation, tool listing, and enable/disable management [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20195Fetched 2026-04-30 06:32:16
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3closed ×1commented ×1

codex mcp can add/list/get/remove/login/logout MCP server entries, but it does not expose the rest of the management operations users need for a practical MCP setup: validate a server, inspect discovered tools/resources, enable/disable a server, or self-register the local codex mcp-server entry.

Root Cause

Because the CLI does not expose validation or toggles, users have to hand-edit ~/.codex/config.toml and start a full session to discover whether a server starts and which tools/resources it exposes.

RAW_BUFFERClick to expand / collapse

Summary

codex mcp can add/list/get/remove/login/logout MCP server entries, but it does not expose the rest of the management operations users need for a practical MCP setup: validate a server, inspect discovered tools/resources, enable/disable a server, or self-register the local codex mcp-server entry.

Evidence

Observed in local checkout /Volumes/VIXinSSD/codex-main at 2be9fd5a93.

codex-rs/cli/src/mcp_cmd.rs defines only these subcommands:

  • list
  • get
  • add
  • remove
  • login
  • logout

The underlying config/runtime already has several pieces needed for richer management:

  • McpServerConfig.enabled exists and the connection manager filters on it.
  • enabled_tools / disabled_tools, default_tools_approval_mode, required, startup/tool timeouts, OAuth fields, and streamable HTTP transport are represented in config.
  • The runtime can list tools, list/read resources, and list resource templates through McpConnectionManager and the list_mcp_resources / list_mcp_resource_templates / read_mcp_resource helper tools.

Because the CLI does not expose validation or toggles, users have to hand-edit ~/.codex/config.toml and start a full session to discover whether a server starts and which tools/resources it exposes.

Expected behavior

Add focused MCP management commands such as:

  • codex mcp validate <name>: start the configured server, perform initialize/list calls, and report auth/startup/tool discovery failures.
  • codex mcp tools <name> or codex mcp inspect <name>: list discovered tools, resources, and resource templates without starting an agent turn.
  • codex mcp enable <name> / codex mcp disable <name>: mutate the existing enabled flag instead of requiring manual TOML edits.
  • Optional: codex mcp add-self to register codex mcp-server as a local stdio MCP server for other clients.

Acceptance criteria

  • Users can validate a configured MCP server from the CLI without launching an interactive session.
  • Users can inspect discovered MCP tools/resources/templates from the CLI.
  • Users can toggle configured MCP servers on/off through codex mcp.
  • Config writes preserve existing MCP server options such as approval settings, timeouts, OAuth fields, and tool filters.

extent analysis

TL;DR

Implement additional subcommands in codex mcp to expose richer management operations, such as validate, inspect, enable, and disable.

Guidance

  • Review the existing McpServerConfig and McpConnectionManager to understand the available configuration and runtime capabilities.
  • Implement new subcommands in codex-rs/cli/src/mcp_cmd.rs to support the desired management operations, such as validate, inspect, enable, and disable.
  • Ensure that the new subcommands preserve existing MCP server options, including approval settings, timeouts, OAuth fields, and tool filters.
  • Consider adding a codex mcp add-self command to register the local codex mcp-server as a stdio MCP server.

Example

// Example of a new subcommand for validating an MCP server
pub fn validate(submatches: &clap::ArgMatches) {
    let name = submatches.value_of("name").unwrap();
    // Start the configured server, perform initialize/list calls, and report auth/startup/tool discovery failures
    // ...
}

Notes

The implementation of the new subcommands will require careful consideration of the existing configuration and runtime capabilities, as well as the desired user experience.

Recommendation

Apply workaround by implementing the additional subcommands in codex mcp to expose the richer management operations, as this will provide the desired functionality and improve the user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Add focused MCP management commands such as:

  • codex mcp validate <name>: start the configured server, perform initialize/list calls, and report auth/startup/tool discovery failures.
  • codex mcp tools <name> or codex mcp inspect <name>: list discovered tools, resources, and resource templates without starting an agent turn.
  • codex mcp enable <name> / codex mcp disable <name>: mutate the existing enabled flag instead of requiring manual TOML edits.
  • Optional: codex mcp add-self to register codex mcp-server as a local stdio MCP server for other clients.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING