Codex Desktop and VS Code extension eagerly spawn duplicate stdio Serena MCP servers while Codex is idle

Resolved 💬 1 comment Opened Jun 2, 2026 by hunterhogan Closed Jun 7, 2026

What version of the IDE extension are you using?

26.5527.60818

What subscription do you have?

Business

Which IDE are you using?

VS Code Insider 1.123.0-insider (user setup)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex Desktop and the Codex VS Code Insiders extension eagerly launch duplicate stdio MCP server instances for Serena while idle.

I have Serena configured globally in ~/.codex/config.toml:

[mcp_servers.serena]
command = "serena"
args = ["start-mcp-server", "--context=codex", "--project-from-cwd"]

Today, for example, while merely reading a Codex response, without clicking, typing, hovering, changing focus, invoking any Serena tool, or invoking any Codex command, Codex launched three separate Serena MCP process trees in approximately five minutes.

A live process snapshot showed one Codex app-server parent directly owning multiple duplicate Serena trees:

codex.exe app-server --analytics-default-enabled
  serena.exe start-mcp-server --context=codex --project-from-cwd
  serena.exe start-mcp-server --context=codex --project-from-cwd
  serena.exe start-mcp-server --context=codex --project-from-cwd

The same Codex parent also owned multiple duplicate node_repl MCP trees, so this appears to be a Codex MCP lifecycle issue rather than a Serena-specific issue. Serena makes the problem visible because each instance opens/owns dashboard or tray UI and can spawn language-server children.

This does not reproduce with GitHub Copilot Chat in VS Code using Serena’s --context=vscode stdio configuration. It started immediately after installing Codex.

Related but not exact duplicates: #21984 and #12333.

What steps can reproduce the bug?

  1. On Windows 11, install Serena via uv tool.
  2. Configure Codex global MCP config:
[mcp_servers.serena]
command = "serena"
args = ["start-mcp-server", "--context=codex", "--project-from-cwd"]
  1. Launch Codex Desktop or use the Codex VS Code Insiders extension.
  2. Open a Codex conversation with Serena available.
  3. Do not invoke any Serena tool. In my case, simply focus on the Codex app or the Codex extension panel.
  4. Observe process creation with PowerShell:
Get-CimInstance Win32_Process |
  Where-Object { $_.CommandLine -match 'serena|start-mcp-server|node_repl|codex.exe' } |
  Select-Object ProcessId,ParentProcessId,Name,CommandLine |
  Format-List
  1. Multiple serena start-mcp-server --context=codex --project-from-cwd process trees appear under the same Codex app-server parent.

More troubleshooting notes

  1. In Serena config, I set web_dashboard_open_on_launch: false. The dashboard windows stopped spawning, but my taskbar still had excessive instances.
  2. I've had as many as six dashboards or taskbar icons at one time, when there shouldn't have been more than three. I have not tried to track the maximum number of instances, so it might be higher than six.
  3. I have not used Codex CLI, so I don't know how it reacts.
  4. I did not have this problem in VS Code (Serena context: vscode) before installing Codex.
  5. After installing Codex, the vscode context behavior has not changed: it does not spawn unnecessary dashboards.
  6. The behavior has been consistent since installing, across updates to the OS, VS Code, Codex app, Codex extension, uv, Serena, and my socks. Socks shouldn't affect the behavior, but putting on clean socks feels really good, doesn't it?
  7. Codex seems to be able to use all Serena tools without problems.
  8. I never try to close the dashboards or end the processes, so I don't have any troubleshooting information from that tactic.

What is the expected behavior?

One Serena process/dashboard for each combination of

  1. Serena Context: vscode | codex,
  2. Serena Active Project: [a Serena registered project] | None,
  3. for which I have activated an agent.

Note on drafting this issue

I have been troubleshooting this issue in the Codex Desktop app, with the agent, since 2026 May 20. To create this GitHub Issue, I directed the agent to draft text for the first three text boxes. I edited the text as needed so that, at the very least, I am ratifying all claims.

I'm not ratifying, however, the text in the following section. I'm not claiming it is wrong, and I'm not claiming it is right or useful to y'all.

GPT 5.5 "Extra-High" recommends

Codex should not launch additional stdio MCP server instances while idle or while the user is merely reading a response.

For a configured stdio MCP server, Codex should either:

- start one MCP server per active Codex session and reuse it for that session;
- lazy-start the MCP server only when a tool from that server is actually needed;
- shut down unused/duplicate MCP servers promptly; or
- otherwise bound process growth so repeated idle/session events do not accumulate duplicate MCP subprocesses.

At minimum, one Codex app-server/session should not own multiple identical Serena MCP process trees with the same command line and project context.

Additional information

Version: 1.123.0-insider (user setup)

Commit: 1ec0e888245715a58ccd42565c3105846700aa88
Date: 2026-05-31T21:56:47-07:00
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Windows_NT x64 10.0.26200

C:\Users\hunte>uv self version

uv 0.11.18 (e32666915 2026-06-01 x86_64-pc-windows-msvc)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗