Skip to content

Codex CLI eagerly connects all configured MCP servers at startup #15947

Closed

Description

@songunity

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

Activity

  1. added
    enhancement
    CLI
    mcp
    windows-os
    on Mar 27, 2026
  2. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. songunity commented on Mar 27, 2026

    @songunity
    Author

    Closing as a duplicate of #14507.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIenhancementmcpwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions