codex - 💡(How to fix) Fix Codex desktop repeatedly spawns duplicate STDIO MCP server processes and leaves them running [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#19845Fetched 2026-04-28 06:36:04
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4closed ×1commented ×1

Code Example

command = "uv"
args = ["run", "mcp-atlassian"]

---

[mcp_servers.jira-dev]
command = "uv"
args = ["run", "mcp-atlassian"]
startup_timeout_sec = 120.0

[mcp_servers.jira-sd]
command = "uv"
args = ["run", "mcp-atlassian"]
startup_timeout_sec = 120.0
RAW_BUFFERClick to expand / collapse

What version of Codex is running?

codex-cli 0.125.0

Platform

macOS 26.4.1, Build 25E253

Problem

Codex desktop/app-server appears to repeatedly spawn duplicate STDIO MCP server processes for configured MCP servers and does not clean up old instances.

In this case, two configured STDIO MCP servers both use:

command = "uv"
args = ["run", "mcp-atlassian"]

Over time, process count grows substantially. During investigation, the count grew from 48 processes (~1.9 GB RSS) to 60 processes (~2.27 GB RSS), without explicit use of the Jira MCP tools.

Observed process pattern

Each server instance appears as a pair:

  • uv run mcp-atlassian
  • Python child running ~/.local/bin/mcp-atlassian

All are parented under Codex app-server:

Codex.app/Contents/Resources/codex app-server --analytics-default-enabled

Example process groups were started at different times, indicating repeated spawning rather than a single long-lived pair:

  • 4:43 PM
  • 5:22 PM
  • 7:21 PM
  • 7:23 PM
  • 7:35 PM
  • 7:39 PM

Expected behavior

Codex should either:

  • keep one live STDIO MCP server process per configured MCP server per active Codex client/session, or
  • clean up previous MCP server children when a session/tool client is closed/reloaded, or
  • provide an idle timeout / lazy-start mode for MCP servers.

Actual behavior

Duplicate MCP server processes accumulate and remain running. They consume memory and small but persistent CPU even when tools are not actively being called.

Relevant config shape

Sanitized:

[mcp_servers.jira-dev]
command = "uv"
args = ["run", "mcp-atlassian"]
startup_timeout_sec = 120.0

[mcp_servers.jira-sd]
command = "uv"
args = ["run", "mcp-atlassian"]
startup_timeout_sec = 120.0

Notes

This does not appear to be the MCP server intentionally doing background Jira work. The installed MCP server mostly registers tools and waits on STDIO. The issue seems to be repeated Codex-side spawning and/or missing cleanup.

extent analysis

TL;DR

The issue can be mitigated by implementing an idle timeout or lazy-start mode for MCP servers in the Codex configuration.

Guidance

  • Review the Codex configuration to ensure that the startup_timeout_sec parameter is correctly set for each MCP server, as this may impact the spawning of new processes.
  • Investigate the possibility of adding an idle timeout or lazy-start mode for MCP servers to prevent duplicate processes from accumulating.
  • Verify that the codex-cli version 0.125.0 is the latest available, as updates may address this issue.
  • Monitor the process count and memory usage to determine the optimal timeout or cleanup interval for the MCP servers.

Example

No code snippet is provided, as the issue is related to configuration and process management rather than code.

Notes

The issue appears to be specific to the Codex desktop/app-server and its interaction with the MCP servers, and may require modifications to the Codex configuration or the implementation of new features to address.

Recommendation

Apply a workaround by implementing an idle timeout or lazy-start mode for MCP servers, as this is likely to mitigate the issue of duplicate processes accumulating and consuming resources.

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

Codex should either:

  • keep one live STDIO MCP server process per configured MCP server per active Codex client/session, or
  • clean up previous MCP server children when a session/tool client is closed/reloaded, or
  • provide an idle timeout / lazy-start mode for MCP servers.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex desktop repeatedly spawns duplicate STDIO MCP server processes and leaves them running [1 comments, 2 participants]