Windows Desktop app-server repeatedly spawns duplicate MCP stdio process pools (183 node.exe / 13GB private memory)
Summary
Codex Desktop on Windows repeatedly starts duplicate stdio MCP process pools under codex.exe app-server --analytics-default-enabled. The duplicate cmd -> npx/npx.cmd -> node.exe trees are not consistently reaped, causing large memory growth.
This appears related to:
- #28361
- #30408
- #30753
- #29079
I am filing a separate report because this reproduces on the current Windows Desktop app installed on my machine, and the process count/memory growth is severe enough to affect normal use.
Environment
- OS: Microsoft Windows 11 Home Chinese, 64-bit
- OS version/build: 10.0.22621 / build 22621
- Codex Desktop package:
OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0 - Codex Desktop version:
26.527.3686.0 ~/.codex/version.json:latest_versionis0.142.5- App server command observed:
codex.exe app-server --analytics-default-enabled
Global MCP servers configured in ~/.codex/config.toml:
reactbits:npx -y reactbits-dev-mcp-servertavily:npx.cmd -y tavily-mcpchrome-devtools:npx chrome-devtools-mcp@latestshadcn:npx.cmd -y shadcn@latest mcpfigma: HTTP MCPnode_repl: bundled Codex node_repl
No secrets are included here.
Observed Behavior
During normal Codex Desktop usage, Task Manager showed a large number of node.exe processes consuming substantial memory.
Read-only process inspection showed:
- Peak observed:
183node.exeprocesses - Peak private memory:
13.2 GB - Peak working set:
10.92 GB - One old Desktop
app-serverprocess tree owned about170of thenode.exedescendants and about12.24 GBprivate memory
The duplicated processes were primarily repeated MCP stdio server trees:
tavily-mcpreactbits-dev-mcp-servershadcn@latest mcpchrome-devtools-mcp@latestchrome-devtools-mcpwatchdog children
Representative command lines:
"node" "...\\npm-cache\\_npx\\...\\chrome-devtools-mcp\\build\\src\\bin\\chrome-devtools-mcp.js"
node.exe ...\\chrome-devtools-mcp\\build\\src\\telemetry\\watchdog\\main.js --parent-pid=...
"node" "...\\npm-cache\\_npx\\...\\shadcn\\dist\\index.js" mcp
"node" "...\\npm-cache\\_npx\\...\\tavily-mcp\\build\\index.js"
"node" "...\\npm-cache\\_npx\\...\\reactbits-dev-mcp-server\\dist\\index.js"
After I only inspected the process tree, without killing any process and without changing config, the old app-server appears to have exited/restarted and the count dropped to:
19node.exeprocesses- about
1.5 GBprivate memory
However, shortly afterward, the count started increasing again:
37node.exeprocesses2.89 GBprivate memory2.91 GBworking set
Breakdown at that point:
chrome-devtools: 12 processes, 1.22 GB private
shadcn: 8 processes, 0.68 GB private
reactbits: 8 processes, 0.49 GB private
tavily: 8 processes, 0.47 GB private
codex-node: 1 process, 0.02 GB private
This suggests the duplicate MCP pools are still being created after the old high-memory app-server tree is cleaned up.
Expected Behavior
Codex Desktop should not create unbounded duplicate MCP stdio process pools.
At most one active MCP process pool should exist per owning active session/thread, and MCP child processes should be reliably cleaned up when the owning session/thread/app-server lifecycle ends.
Actual Behavior
The Desktop app-server creates multiple full MCP stdio process pools. Those pools accumulate under the app-server and can grow to hundreds of node.exe processes and more than 10 GB of memory.
In my case, the leak/duplication was visible without any project dev server being involved. The repeated processes came from Codex MCP startup, not from application code.
Impact
This makes Codex Desktop risky to keep open for long sessions on Windows when several stdio MCP servers are configured. Memory growth can become large enough to degrade the machine and force users to manually kill processes or restart Codex.
Notes
This looks especially close to #28361 and #30753:
- #28361 describes Windows app-server/MCP children not being reaped and accumulating to hundreds.
- #30753 describes Windows Desktop creating duplicate MCP pools after
RefreshMcpServerson a hidden thread.
The extra data point here is that I observed both behaviors in one session:
- a very large old app-server tree with around 170 duplicate
node.exedescendants; - automatic cleanup/restart reducing the count;
- new duplicate MCP pools appearing again afterward.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Warning: a user posted codex_mcp_fix.zip in this thread. My browser/Windows security flagged it as malicious. Please do not download or run it. Maintainers may want to remove that comment/attachment.
@xxH7r This feels like one of those issues where process metrics alone won't explain the root cause. For long-running agent workflows, it's useful to capture an execution timeline that correlates MCP server lifecycle events, tool invocations, and process creation. That makes it much easier to identify whether duplicate pools are caused by orchestration retries, MCP reconnects, or process management itself.
I reproduced the same process-pool accumulation on a newer Windows Codex Desktop build.
Environment
OpenAI.Codex_26.707.3748.0_x64__2p2nqsd0c76g0codex.exe app-serverProcess tree before cleanup
The single long-lived app-server owned repeated, thread-shaped pools:
context-mode/start.mjsmcp/server.mjsmcp/server.cjs --stdionode_repl.execodex-windows-sandbox-setup.exeobserved globallyThe three Node MCP groups were direct children of the same app-server PID. Their creation times appeared in repeated clusters from July 11 through July 13, consistent with new thread/task startup.
Memory snapshot:
node.exeglobally: ~14.4 GB aggregate working setcontext-mode/start.mjsalone: ~8.7 GB aggregate working set, ~2.45 GB private working set, ~4.57 GB private commitcodex.exe: ~1.27 GB working setThis was process-count accumulation rather than a clearly demonstrated single-process heap leak: process age did not positively correlate with private working set.
Disk activity
Before cleanup, Task Manager showed sustained disk writes around 50 MB/s. Local Codex state at the time was:
~/.codex: 10.24 GiB totallogs_2.sqlite: 3.53 GiBCleanup result
I retained the four newest active MCP/REPL pools and terminated 130 older managed child processes, then removed 22 accumulated sandbox-setup helpers.
Immediately afterward:
node.execount: 99 → 29The remaining global Node count included unrelated local development processes, so the reduction is not based on killing all Node processes indiscriminately.
This strongly matches the per-thread MCP pool retention described here. It also indicates that the problem remains reproducible on Windows package 26.707.3748.0, after the earlier explicit MCP shutdown work in #19753.
Reproduced on the newer Windows package
26.707.8479.0. I filed #32797 with a sanitized current-version process snapshot.Key measurements from one Codex Desktop app-server tree:
node.exenode_repl.execmd.exelauncher wrappersThe processes were attributed through the full parent chain to
codex.exe app-server. Seven Claude Code-owned Node processes and 19 already-orphaned/unattributable Node processes were explicitly excluded. This confirms current-build recurrence of Codex-owned MCP/Node process-batch accumulation and is not an artifact of counting every machine-wide Node process. Process evidence alone does not identify the internal manager, refresh, or session event that owned each batch.Follow-up from the same app-server at
2026-07-13T09:50:42.6070046-04:00: the retained tree had grown to 147node.exe, 5node_repl.exe, 94cmd.exe, 13.902 GiB Node-family working set, and 12.084 GiB private memory. Two additional batches of 33 Node-family processes each began at 09:42 and 09:43. Their specific internal trigger remains unverified.Still reproduces on 26.707.9981 and, after today's auto-update, on 26.715.3651 (Windows 11 Pro, Store package
OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g0). Adding some evidence that narrows the root cause to the client side.Setup
6 stdio MCP servers in
~/.codex/config.toml(npx-based:@mskalski/lightroom-mcp,@playwright/mcp;uvx-based:paper-search-mcp,photoshop-mcp-server; one plainnodescript; bundlednode_repl), 3–4 conversations open in the Desktop app.Measured behavior
node.exe+ 104python/uv/uvxprocesses, ≈ 11 GB working set, 877 total system processes.cmd → npx → nodewrapper chains stay alive indefinitely, i.e. the stdio servers never receive stdin EOF, so a spec-compliant server cannot exit on its own.uvx-based (python) servers accumulate identically tonpx-based ones, so it is not npm-specific.The servers themselves are healthy
Manual stdio probe (spawn the exact configured command, write an MCP
initializerequest, time the response):@mskalski/lightroom-mcp: validinitializeresponse in 1.27 s — even with its backend app (Lightroom) closednpxpackage resolution itself: ~1 s (warm cache), measured from wrapper spawn → server process spawn timestampsSo the app-server discards connections to servers that complete a valid handshake within ~1 s, respawns the whole pool, and leaks the old one.
Control group
Same machine, same server binaries/configs attached to Claude Code: exactly one set per session, stable for hours, zero accumulation. This rules out the servers, npx/uvx, and the OS — the lifecycle management difference is in the Codex client.
Workaround
Scheduled reaper task (every 10 min). Reliable kill criterion under the bug: any same-command MCP process owned by the app-server older than ~10 minutes is necessarily abandoned, because the respawn loop keeps replacing the live set — survivors automatically equal (open conversations) × (one set). Plus unconditional reaping of processes whose parent chain is dead (with PID-reuse check: parent creation time later than child ⇒ real parent is gone).
Happy to provide the probe script or raw process listings if useful.