What version of Codex is running?
codex-cli 0.104.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.3-codex
What platform is your computer?
WSL2 Ubuntu on Windows 11
What issue are you seeing?
When using Codex CLI with Serena MCP enabled, multi-agent / multiple active Codex sessions appear to spawn separate Serena MCP server processes instead of reusing a shared connection.
In practice, this creates many duplicate serena start-mcp-server and language-server child processes, which significantly increases memory usage over time.
This feels especially expensive for Serena, because each MCP server can spawn heavyweight language server processes (e.g., Dart language server).
What steps can reproduce the bug?
- Configure Serena MCP in
~/.codex/config.toml, e.g.
[mcp_servers.serena]
command = "uvx"
args = ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "codex", "--transport", "stdio", "--enable-web-dashboard", "false"]
- Start Codex CLI and run tasks that involve multi-agent usage (or keep multiple Codex sessions active).
- Observe processes with:
ps -eo pid,ppid,rss,cmd | rg 'serena start-mcp-server|\.serena/language_servers|codex'
- After some activity, multiple Serena server instances accumulate, each with additional language-server children.
What is the expected behavior?
- Child agents should reuse the parent MCP connection when possible (or at least pool/reuse by session/project), rather than launching a new Serena MCP server per agent/session.
- MCP process growth should be bounded and predictable.
Additional information
Observed sample from one run:
serena start-mcp-server total: 23 processes
- owner breakdown in that snapshot:
- codex: 19
- claude: 2
- droid: 2
- Serena-related total (
serena + .serena/language_servers) reached ~5.3 GB RSS in that snapshot.
For Codex-owned processes, parent chain looked like:
codex resume -> uvx ... serena start-mcp-server -> sh -> dart language-server
So this looks like process-level MCP duplication rather than a single shared MCP connection for sub-agents.
Related context (different but adjacent): #7281, #9989 are extension/WSL process/cwd issues. This report is specifically about Codex CLI multi-agent MCP connection sharing / process duplication.
What version of Codex is running?
codex-cli 0.104.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.3-codex
What platform is your computer?
WSL2 Ubuntu on Windows 11
What issue are you seeing?
When using Codex CLI with Serena MCP enabled, multi-agent / multiple active Codex sessions appear to spawn separate Serena MCP server processes instead of reusing a shared connection.
In practice, this creates many duplicate
serena start-mcp-serverand language-server child processes, which significantly increases memory usage over time.This feels especially expensive for Serena, because each MCP server can spawn heavyweight language server processes (e.g., Dart language server).
What steps can reproduce the bug?
~/.codex/config.toml, e.g.What is the expected behavior?
Additional information
Observed sample from one run:
serena start-mcp-servertotal: 23 processesserena+.serena/language_servers) reached ~5.3 GB RSS in that snapshot.For Codex-owned processes, parent chain looked like:
codex resume -> uvx ... serena start-mcp-server -> sh -> dart language-serverSo this looks like process-level MCP duplication rather than a single shared MCP connection for sub-agents.
Related context (different but adjacent): #7281, #9989 are extension/WSL process/cwd issues. This report is specifically about Codex CLI multi-agent MCP connection sharing / process duplication.