Codex CLI eagerly connects all configured MCP servers at startup

Resolved 💬 2 comments Opened Mar 27, 2026 by songunity Closed Mar 27, 2026

What feature would you like to see?

Codex CLI should not eagerly connect every configured MCP server during startup.

Right now, if several stdio MCP servers are enabled in config, Codex attempts to connect them during startup even when they are not needed for the current session.

On local setups this adds avoidable startup latency, especially when the MCP servers are launched via npx and have noticeable cold start cost.

The current workarounds do not really solve the UX problem:

  • enabled = false disables the MCP entirely
  • startup_timeout_sec only reduces how long startup waits
  • neither option provides true lazy / on-demand loading

What would help?

A better default or optional mode for local CLI usage, for example:

  • lazy-load MCP servers on first use
  • start only required = true MCP servers during startup
  • allow a CLI allowlist such as --with-mcp=context7,chrome-devtools
  • support an in-session command to load an MCP manually

Why this matters

This is mainly a local CLI UX issue.

For terminal users, paying startup cost for unused MCP servers on every run feels like the wrong default. It makes Codex feel slower even in sessions where only normal coding help is needed.

Environment

  • Codex CLI 0.116.0
  • Windows
  • Multiple stdio MCP servers enabled at once
  • Reproducible with MCPs launched through npx

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗