Skip to content

MCP servers not detected in Codex VS Code extension (but working in Codex CLI) #6465

Open

Description

@PangeranSilaen

What version of the VS Code extension are you using?

0.4.38

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

Hi, I'm encountering an issue where Codex CLI successfully connects to local and remote MCP servers (e.g. Playwright, Supabase), but the Codex VS Code extension fails to detect or list any MCP resources/tools.
This seems to be a session isolation problem between Codex CLI and the Codex IDE extension.

Environment

  • OS: Windows 11 (Build 26100.x)
  • Codex CLI version: v0.56.0
  • Codex VS Code extension: Latest (from OpenAI official marketplace)
  • Node.js: v22.13.0
  • Playwright MCP: latest via @playwright/mcp@latest
  • Supabase MCP: https://mcp.supabase.com/mcp
  • config.toml path: C:\Users\hi\.codex\config.toml

What steps can reproduce the bug?

  1. Create a .codex/config.toml file:
model = "gpt-5-codex"
model_reasoning_effort = "low"
sandbox = "danger-full-access"

[features]
rmcp_client = true

[mcp_servers.playwright]
command = "cmd"
args = [
  "/c",
  "C:\\Program Files\\nodejs\\npx.cmd",
  "@playwright/mcp@latest",
  "--browser", "chrome",
  "--extension",
  "--no-sandbox"
]
startup_timeout_sec = 120
tool_timeout_sec = 600

[mcp_servers.playwright.env]
APPDATA = "C:\\Users\\hi\\AppData\\Roaming"
LOCALAPPDATA = "C:\\Users\\hi\\AppData\\Local"
HOME = "C:\\Users\\hi"
SystemRoot = "C:\\Windows"
NODE_OPTIONS = "--dns-result-order=ipv4first"

[mcp_servers.supabase]
url = "https://mcp.supabase.com/mcp?project_ref=${SUPABASE_PROJECT_REF}"
bearer_token_env_var = "SUPABASE_ACCESS_TOKEN"
startup_timeout_sec = 120
tool_timeout_sec = 600
  1. Run in Codex CLI:

    codex
    /mcp
    

    ✅ Output:
    Playwright detected, tools listed, working normally.

  2. Open Codex Chat in VS Code (GPT-5-Codex model).

  3. Run:

    list_mcp_servers
    

    or

    list_mcp_resources
    

    ❌ Output: empty (no MCP servers detected).


What is the expected behavior?

Expected Behavior

Codex IDE should inherit the same MCP configuration and session from ~/.codex/config.toml, or at least spawn MCP processes defined there (just like Codex CLI does).
Playwright MCP should appear in list_mcp_resources and be callable inside Codex IDE.

Actual Behavior

  • Codex CLI: Works perfectly, detects MCP Playwright and Supabase.
  • Codex IDE (VS Code extension): list_mcp_resources always empty.
  • In terminal logs, IDE session doesn’t appear to start MCP processes or read environment variables.
  • Restarting VS Code, reloading configuration, and setting env vars globally have no effect.

Additional information

Codex CLI output:

> codex
The supabase MCP server is not logged in. Run `codex mcp login supabase`.

MCP Tools
• playwright
  Status: enabled
  Command: npx @playwright/mcp@latest --browser chrome --extension --no-sandbox
  Tools: browser_click, browser_tabs, browser_wait_for, ...
• supabase
  Status: enabled
  Auth: OAuth
  URL: https://mcp.supabase.com/mcp

Codex VS Code chat output:

There are still no MCP servers connected in this session — list_mcp_resources remains empty.

Hypothesis / Possible Cause

The Codex VS Code extension may be launching its own isolated agent session without sharing MCP process context or ~/.codex/config.toml with the CLI environment.
It seems MCP initialization is only performed in CLI-based Codex sessions.
There is currently no manual command (codex mcp start) or extension setting to sync the two.


Suggested Fix

  • Make the Codex IDE extension automatically detect and initialize MCP servers from the same configuration file (~/.codex/config.toml).
  • Optionally, allow Codex IDE to connect to an already-running MCP process from Codex CLI.
  • Add a debug log or indicator for MCP connection status in the IDE.

Workaround

Currently, the only working approach is:

  1. Run codex CLI and keep it open (MCP servers run there).
  2. Then interact with MCP commands through that CLI session only.
    The VS Code Codex chat cannot yet call those tools.

This makes MCP development and testing inside VS Code Codex extension impractical, even though the CLI works fine.
Please confirm if MCP integration for Codex IDE is expected to be functional yet, or if this is a known limitation.

Activity

  1. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    mcpIssues related to the use of model context protocol (MCP) servers
    on Nov 10, 2025
  2. github-actions commented on Nov 10, 2025

    @github-actions
    Contributor
  3. PangeranSilaen commented on Nov 10, 2025

    @PangeranSilaen
    Author

    Just to clarify, this is not a duplicate of #5929 or #6215.
    Both of those refer to older Codex releases and .vscode/mcp.json integration issues on macOS.

    My report (#6465) is about Codex VS Code extension (v0.56.0) failing to detect MCP servers already working in Codex CLI, even though both share the same ~/.codex/config.toml configuration.

    Reproduction shows CLI detects Playwright/Supabase MCP successfully, while list_mcp_resources in IDE remains empty — indicating the VS Code extension isn't spawning or connecting to the same MCP runtime session.

    Tested on Windows 11 + Node v22, so this is cross-platform and not related to .vscode/mcp.json.

    Please keep this open — it's a session isolation bug between Codex CLI and IDE, not a config syntax issue.

  4. Milad commented on Nov 11, 2025

    @Milad

    I have the same problem:
    codex-cli 0.57.0
    Codex VScode extension: 0.4.38

    My ~/.codex/config.toml:

    model = "gpt-5-codex"
    model_reasoning_effort = "medium"
    
    [projects."/path/to/back-end"]
    trust_level = "trusted"
    
    [mcp_servers.postgres]
    command = "/usr/local/bin/toolbox"
    args = ["--prebuilt","postgres","--stdio"]
    env = {"POSTGRES_HOST"= "localhost", "POSTGRES_PORT"= "43256", "POSTGRES_DATABASE"= "my_db_name", "POSTGRES_USER"= "my_db_usernamename","POSTGRES_PASSWORD"= "my_db_pass"}
    

    Codex CLI can access the MCP server and can list the tables of the DB.
    While Codex VScode extension reports this:

    resources/list failed: unknown MCP server 'postgres'
    
  5. MatthewGranfield commented on Nov 13, 2025

    @MatthewGranfield

    Can confirm i have the same issue on a fresh install Win 11 pro.

    CLI v0.57.0
    VSC extention v0.4.39

    Using CLI i can access larvel boost and use the tools, however i cannot through the extention.

  6. crstamps2 commented on Nov 14, 2025

    @crstamps2

    Also not working on Mac.

    CLI v0.58.0
    VSC extension 0.4.40

    When prompting the chat to check the status of the tools, it's thinking always outputs:

    MCP client for figma failed to start: handshaking with MCP server failed: expect initialized result, but received: Some(EmptyResult(EmptyObject))

  7. XFairesV1 commented on Nov 14, 2025

    @XFairesV1

    I have the same problem:

    CLI v0.57.0
    Extensão VSC v0.4.39

    Linux

  8. Robert-Phan commented on Nov 14, 2025

    @Robert-Phan

    I also have the same problem:

    CLI v0.58.0
    Extension v0.4.40

    My config.toml:

    model = "gpt-5.1-codex"
    model_reasoning_effort = "medium"
    
    [mcp_servers.svelte]
    command = "npx"
    args = ["-y", "@sveltejs/mcp"]
    startup_timeout_sec = 30
    

    Using Windows with WSL. CLI works fine, the extension times out.

  9. nicolascanese commented on Nov 17, 2025

    @nicolascanese

    I'm having the same issue in Win11 and in WSL.

    Extension v0.4.43
    CLI v0.58.0

  10. leike0813 commented on Nov 19, 2025

    @leike0813

    I'm having the same issue in Win11, WSL not tested.

    Extension v0.4.43
    CLI v0.58.0

  11. RyanRiz commented on Nov 22, 2025

    @RyanRiz

    I'm having the same issue in VS Code Insiders Linux
    Extension 0.5.46
    CLI v0.60.1

    .codex/config.toml:

    model = "gpt-5.1-codex-max"
    model_reasoning_effort = "high"
    
    [mcp_servers.laravel-boost]
    command = "php"
    args = ["artisan", "boost:mcp"]
    

    chat:

    what mcp that currently installed that you can access?
    
    I don’t see any MCP servers/resources exposed in this environment right now—both the resource and resource-template lists came back empty. If you expected some to be available, let me know their names or restart/connect them so I can access them.
    

    but codex recognized installed mcp in CLI

  12. FelixKuehl commented on Nov 25, 2025

    @FelixKuehl

    Same here on MacOS. Any workaround / fixes?

  13. 37 remaining items

  14. alexkmbk commented on Apr 9, 2026

    @alexkmbk

    I have a similar issue, but only for project-level config.toml. VS Code Codex chat does not pick up project-level MCP servers, while the Codex CLI does. User-level config works fine.

  15. mqhamdam commented on Apr 27, 2026

    @mqhamdam

    this is piece of shit, settings doesn't able to save changed value, how thfcuk this dev asking 200$ in month but can't make proper UI for his own product. using cli to add mcp is another headache

  16. rvveber commented on Apr 28, 2026

    @rvveber

    This is not related to windows-os btw! Incorrect tag!

  17. Chaoscontrol commented on May 20, 2026

    @Chaoscontrol

    Is there really no update on this after months? Or even a hint of what causes it? Is this no affecting all users? How are people even able to work without MCPs?

    I was able to use MCPs just fine in the extension till a few days ago, when I installed the Codex app on Windows, and now it went haywire. The extension won't be able to use any of the custom MCPs (even after uninstalling the Codex app, which was even worse).

    Here's the bug report it created for me after investigation:

    Custom MCP servers from ~/.codex/config.toml load and work in standalone codex v0.132.0 (/mcp shows homeassistant + wordpress MCPs and tools execute), but the VS Code ChatGPT extension runtime only exposes curated MCP namespaces (codex_apps/context7) to the assistant tools. This worked a few days ago. 
    
    Environment:
    - WSL Ubuntu 24.04
    - Extension: openai.chatgpt-26.513.21555-win32-x64
    - codex app-server launched by extension
    - ~/.codex/config.toml contains custom mcp_servers entries
    
  18. SylvainWinning commented on May 25, 2026

    @SylvainWinning

    I took another pass through this thread and the current reports, and it may help to split this into a small diagnostic matrix. Right now several distinct failure modes all present as “the extension has no MCP tools”.

    Suggested triage buckets:

    1. Config not loaded

      • ~/.codex/config.toml works in CLI, but the extension does not read it.
      • Project-level config works in CLI but not the extension.
      • CODEX_HOME differs between CLI, VS Code, WSL, remote SSH, and the standalone app.
      • The extension MCP settings UI shows a different source of truth than the CLI.
    2. Config loaded, server not started

      • Extension can see the MCP entry, but startup fails because PATH/env/cwd differs from the user’s terminal.
      • Examples from this thread include npx, PHP/Laravel, WSL, and extension-bundled codex binary differences.
      • A visible startup-status surface would help distinguish this from “no config”.
    3. Server started, tools not exposed to the model/session

      • Recent comments suggest standalone CLI /mcp can show tools while the VS Code assistant only exposes curated namespaces or old conversations miss tools that new conversations can see.
      • That sounds different from a plain config parse or process-start failure.

    A narrow MVP would be a “MCP diagnostics” view or command in the extension that prints, for the current chat: effective CODEX_HOME, config files considered, server startup status, and count/list of exposed mcp__* tools. That would give reporters a stable artifact instead of relying on prompts like “what MCPs do you see?”, which maintainers have already noted can be model-behavior dependent.

    Per docs/contributing.md, I’m sharing analysis rather than opening an unsolicited PR. If useful, this could be narrowed into a test matrix across local VS Code, WSL, remote SSH, and project-level config.

  19. xuanswe commented on May 26, 2026

    @xuanswe

    Could someone from the core team take a look at this issue? I'm eager to switch over to Codex, but this problem is making the transition quite difficult.

  20. drewclifton commented on May 26, 2026

    @drewclifton

    This is more relevant now than ever during the great GHCP exodus.... Looking forward to an update (and confirmed fix) for this soon!

  21. grnbtqdbyx-create commented on May 31, 2026

    @grnbtqdbyx-create
  22. etraut-openai commented on May 31, 2026

    @etraut-openai
  23. alessandrotesoro commented on Jun 1, 2026

    @alessandrotesoro

    Same issue here, it's incredibly frustrating. I'll go back to Claude in the meantime.

  24. elliejayliquid commented on Jun 7, 2026

    @elliejayliquid

    Same issue here. Win 10. VS Code Version: 1.123.0
    I wish we'd at least get some better error indications as I'm not entirely sure what exactly is failing.

  25. movy commented on Jun 10, 2026

    @movy

    Right now there's ZERO indication in VSCode Codex Extension whether MCPs work at all. I tried adding MCPs via codex.toml and via 'GUI' (quoted, because GUI is just a vibe-slopped low-effort attempt to represent toml-strings, withiot any extra functionality compared to direct toml editing). Ample errors in logs though:

    2026-06-10 03:32:43.652 [warning] [CodexMcpConnection] cli: message="codex_mcp::connection_manager: Failed to list resource templates for MCP server 'context7': Mcp error: -32601: Method not found"
    2026-06-10 03:32:43.652 [warning] [CodexMcpConnection] cli: message="codex_mcp::connection_manager: Failed to list resource templates for MCP server 'resend': Mcp error: -32601: Method not found"
    2026-06-10 03:32:43.689 [warning] [CodexMcpConnection] cli: message="codex_mcp::connection_manager: Failed to list resources for MCP server 'Supabase-local': Mcp error: -32601: Method not found"
    2026-06-10 03:32:43.710 [warning] [CodexMcpConnection] cli: message="codex_mcp::connection_manager: Failed to list resource templates for MCP server 'Supabase-local': Mcp error: -32601: Method not found"
    

    Was this thing supposed to replace Copilot at some point? Very funny.

    FWIW, I'm using VSCode Remote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extensionmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions