codex - 💡(How to fix) Fix VS Code extension starts the same MCP stdio server twice from one config entry [3 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#19338Fetched 2026-04-25 06:11:21
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×3cross-referenced ×2

The OpenAI ChatGPT / Codex VS Code extension starts the same MCP stdio server twice from a single ~/.codex/config.toml entry.

This is not Serena-specific: the same duplicate startup also happened with xcodebuildmcp.

Root Cause

The OpenAI ChatGPT / Codex VS Code extension starts the same MCP stdio server twice from a single ~/.codex/config.toml entry.

This is not Serena-specific: the same duplicate startup also happened with xcodebuildmcp.

RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

[email protected]

What subscription do you have?

Free / not relevant to issue

Which IDE are you using?

Visual Studio Code 1.117.0 (user setup)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 (x64)

What issue are you seeing?

Summary

The OpenAI ChatGPT / Codex VS Code extension starts the same MCP stdio server twice from a single ~/.codex/config.toml entry.

This is not Serena-specific: the same duplicate startup also happened with xcodebuildmcp.

Environment

  • OS: Windows
  • VS Code extension: [email protected]
  • Codex process: codex.exe app-server --analytics-default-enabled
  • MCP server affected: Serena MCP
  • Config file: C:\Users\<user>\.codex\config.toml

Serena config

[mcp_servers.serena]
command = "uvx"
args = [
  "--from",
  "git+https://github.com/oraios/serena",
  "serena",
  "start-mcp-server",
  "--context",
  "codex"
]

### What steps can reproduce the bug?

1. Start VS Code with the OpenAI ChatGPT/Codex extension installed.
2. Open a workspace that has Codex MCP configured in ~/.codex/config.toml.
3. Configure one Serena MCP server only:

[mcp_servers.serena]
command = "uvx"
args = [
  "--from",
  "git+https://github.com/oraios/serena",
  "serena",
  "start-mcp-server",
  "--context",
  "codex"
]

4. Start/open the Codex Agent session from the VS Code extension.
5. Trigger/use the Serena MCP tools from Codex.
6. Inspect the process tree.

Expected result:
Only one Serena MCP server process should be started.

Actual result:
Two identical Serena MCP server process trees are started by the same codex.exe app-server process.

Observed process tree:

codex.exe app-server --analytics-default-enabled
  -> uvx.exe --from git+https://github.com/oraios/serena serena start-mcp-server --context codex
     -> uv.exe tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context codex
        -> serena.exe start-mcp-server --context codex

codex.exe app-server --analytics-default-enabled
  -> uvx.exe --from git+https://github.com/oraios/serena serena start-mcp-server --context codex
     -> uv.exe tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context codex
        -> serena.exe start-mcp-server --context codex

Both uvx.exe processes had the same parent process:
codex.exe app-server --analytics-default-enabled

There was only one [mcp_servers.serena] entry in ~/.codex/config.toml.
VS Code settings did not contain a separate Serena/MCP configuration.


### What is the expected behavior?

When a single MCP server is configured once in ~/.codex/config.toml, the Codex VS Code extension should start exactly one MCP server process for that entry.

For the Serena MCP config below, I expect one process tree only:

codex.exe app-server
  -> uvx.exe --from git+https://github.com/oraios/serena serena start-mcp-server --context codex
     -> uv.exe tool uvx ...
        -> serena.exe start-mcp-server --context codex

The extension should not start two identical uvx/serena MCP process trees from the same codex.exe app-server parent unless there are two distinct configured MCP entries or two separate Codex Agent sessions that intentionally require separate MCP servers.


### Additional information

This does not appear to be VS Code itself launching Serena directly. The duplicate launch appears under the OpenAI/Codex extension's codex.exe app-server process.

In the same process snapshot, another MCP server (xcodebuildmcp) also appeared to be started twice under the same codex.exe parent, so this may be a duplicate MCP initialization issue rather than Serena-specific behavior.

extent analysis

TL;DR

The OpenAI ChatGPT/Codex VS Code extension may be starting the MCP stdio server twice due to a duplicate initialization issue, and a potential workaround is to review and modify the config.toml file to ensure only one MCP server entry is configured.

Guidance

  • Review the config.toml file to ensure only one [mcp_servers.serena] entry is present and correctly configured.
  • Verify that the VS Code settings do not contain a separate Serena/MCP configuration that could be causing the duplicate startup.
  • Check the process tree to confirm that the duplicate startup is indeed caused by the Codex VS Code extension's codex.exe app-server process.
  • Consider testing with a different MCP server configuration to determine if the issue is specific to Serena or a more general problem with the Codex extension.

Notes

The issue may not be specific to the Serena MCP server, as the same duplicate startup behavior was observed with another MCP server (xcodebuildmcp). Further investigation is needed to determine the root cause of the duplicate initialization issue.

Recommendation

Apply a workaround by reviewing and modifying the config.toml file to ensure only one MCP server entry is configured, as this may help prevent the duplicate startup issue.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING