codex icon indicating copy to clipboard operation
codex copied to clipboard

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

Open PangeranSilaen opened this issue 1 month ago • 32 comments

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.

PangeranSilaen avatar Nov 10 '25 18:11 PangeranSilaen

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6215
  • #5929

Powered by Codex Action

github-actions[bot] avatar Nov 10 '25 18:11 github-actions[bot]

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.

PangeranSilaen avatar Nov 10 '25 18:11 PangeranSilaen

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'

Milad avatar Nov 11 '25 11:11 Milad

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.

MatthewGranfield avatar Nov 13 '25 07:11 MatthewGranfield

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))

crstamps2 avatar Nov 14 '25 14:11 crstamps2

I have the same problem:

CLI v0.57.0 Extensão VSC v0.4.39

Linux

XFairesV1 avatar Nov 14 '25 16:11 XFairesV1

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.

Robert-Phan avatar Nov 14 '25 20:11 Robert-Phan

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

Extension v0.4.43 CLI v0.58.0

nicolascanese avatar Nov 17 '25 12:11 nicolascanese

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

Extension v0.4.43 CLI v0.58.0

leike0813 avatar Nov 19 '25 12:11 leike0813

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

RyanRiz avatar Nov 22 '25 00:11 RyanRiz

Same here on MacOS. Any workaround / fixes?

FelixKuehl avatar Nov 25 '25 11:11 FelixKuehl

I am having the same issue on Win 11/ WSL Extension: v0.4.46 Codex-CLI 0.63.0

Can get the CLI to utilize the MCP but not the Codex extension

derek-ndl avatar Nov 25 '25 20:11 derek-ndl

same, it stopped recognizing the .vscode\mcp.json mcp servers per project. i'm in MacOS

Zokor avatar Nov 27 '25 16:11 Zokor

This happened to me "randomly" recently as well (MCP servers don't work). Made a thread about it with more details here. I ended up cancelling my ChatGPT sub as Codex was the main readon I was keeping it. But subscribed to this thread just in case it gets addresssed and I decide I want ChatGPT again.

drewclifton avatar Nov 30 '25 02:11 drewclifton

Thanks for your feedback all, let's try to get to the bottom of this:

For starters:

What mcp that is currently installed that you can access?

does not seem to be a reliable way to ask the model what is currently active (despite it being a reasonable prompt)

What mcp__ prefixed tools do you have access to?

Could somebody run the above query to verify if there are issues or if the model was just confused by the way you were asking before.

We are also working on a proper MCP configuration UI in the extension that will also make this much more clear.

gpeal avatar Nov 30 '25 03:11 gpeal

hi @gpeal that's always the way to ask the model, you even ask only "can you detect mcp tools?" and he would detect them. It stopped detecting them, i don't remember which was the version from codex, but

Image Image

.vscode/mcp.json

{ "servers": { "herd": { "command": "php", "args": ["/Applications/Herd.app/Contents/Resources/herd-mcp.phar"], "env": { "SITE_PATH": "/Users/brunogomes/Documents/Herd/projectx" } }, "shadcn": { "command": "npx", "args": ["shadcn@latest", "mcp"] }, "playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] }, "sequential-thinking": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] }, "chrome-devtools": { "command": "npx", "args": [ "chrome-devtools-mcp@latest", "--channel=canary", "--headless=true", "--isolated=true" ] }, "laravel-boost": { "command": "php", "args": ["artisan", "boost:mcp"] }, "stripe": { "type": "http", "url": "https://mcp.stripe.com" } } }

This is copilot, which works always, never had the issues of the MCP that we sometimes have with Codex.

Image

hope you guys fix this in the next release because not having up to date documentations are not a good way for the model to work.

Zokor avatar Nov 30 '25 13:11 Zokor

@Zokor Could you try with the prompt I suggested? Different models and harnesses may behave differently. I agree that Codex should have a reasonable response to your message but it does seem to work more reliably with:

What mcp__ prefixed tools do you have access to?

and knowing whether it's a model behavior issue or a harness issue would help here.

gpeal avatar Dec 01 '25 03:12 gpeal

@gpeal I can confirm that its not a model issue, ive asked it to use or list what MCP tools it has and every time it will say that Laravel boost is installed but the MCP server isnt running and it cannot see, access or use the tools. if you do the same thing on CLI it just works.

output when running you're prompt.

I don’t see any mcp__‑prefixed tools exposed to me in this session.

Right now, the only tools I can actually call are the generic ones you see
documented (e.g. shell_command, list_mcp_resources, read_mcp_resource,
apply_patch, etc., all under the functions namespace). If your IDE shows
additional Laravel Boost MCP tools (like mcp_laravel_boost__...), they
aren’t currently wired through to this assistant run, so I can’t enumerate
or invoke them directly.

also just a FYI, Claude works with the MCP (VSCode extension also)

On Mon, Dec 1, 2025 at 3:15 AM Gabriel Peal @.***> wrote:

gpeal left a comment (openai/codex#6465) https://github.com/openai/codex/issues/6465#issuecomment-3594350003

@Zokor https://github.com/Zokor Could you try with the prompt I suggested? Different models and harnesses may behave differently. I agree that Codex should have a reasonable response to your message but it does seem to work more reliably with:

What mcp__ prefixed tools do you have access to?

and knowing whether it's a model behavior issue or a harness issue would help here.

— Reply to this email directly, view it on GitHub https://github.com/openai/codex/issues/6465#issuecomment-3594350003, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2VXQNDBFPRK4WUZCGINUID37OXFVAVCNFSM6AAAAACLWBYTVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJUGM2TAMBQGM . You are receiving this because you commented.Message ID: @.***>

MatthewGranfield avatar Dec 01 '25 06:12 MatthewGranfield

@MatthewGranfield And it works from the CLI? Does it ever work with the extension? Does it matter if you use WSL or not?

gpeal avatar Dec 01 '25 07:12 gpeal

I use WSL and VSCode in WSL mode. CLI works fine for me, loads up the MCP tools at the start and /MCP list shows them. If I run a test prompt it sees and uses the tools fine.

Never worked for me in the extension, but i've only tried to use it in the last 6w maybe?

also - ive never tried to use the CLI version outside of WSL. Ive tried to use the VSC version outside of WSL but i didn't get it working either.

On Mon, 1 Dec 2025, 07:04 Gabriel Peal, @.***> wrote:

gpeal left a comment (openai/codex#6465) https://github.com/openai/codex/issues/6465#issuecomment-3594895043

@MatthewGranfield https://github.com/MatthewGranfield And it works from the CLI? Does it ever work with the extension? Does it matter if you use WSL or not?

— Reply to this email directly, view it on GitHub https://github.com/openai/codex/issues/6465#issuecomment-3594895043, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2VXQNEKL67G2YDNOMJMIN337PR7ZAVCNFSM6AAAAACLWBYTVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJUHA4TKMBUGM . You are receiving this because you were mentioned.Message ID: @.***>

MatthewGranfield avatar Dec 01 '25 07:12 MatthewGranfield

It worked for me with the extension some versions ago :)

I don't use the CLI directly because that's wasting time with another window open getting out of the working context. So having the extension working properly is very important for the product to be viable.

Anyway here's the answer to the question:

Image

Zokor avatar Dec 01 '25 14:12 Zokor

Observing with MacOS setup as well - works correctly in CLI, no MCPs in IDE.

gmrukwa avatar Dec 01 '25 18:12 gmrukwa

i had the same issue but i think it works now i just askes codex extension to check my config.toml because i already setup supabase mcp and it said it can see the supabase entry and it tried to query data and it went through hope this helps

i have mac os btw

T-REXX9 avatar Dec 02 '25 07:12 T-REXX9

I think you may figure out the cause by running the internal codex binary directly. If you are using Unix-like OS, it is located ~/.vscode/extensions/openai.chatgpt-<version>/bin/<arch>/codex.

For me, it shows errors like:

⚠ MCP client for `<mcp-server-name>` failed to start: MCP startup failed: missing field `type`

which I solved in #7417.

linuxmetel avatar Dec 02 '25 11:12 linuxmetel

Observing with MacOS setup as well - works correctly in CLI, no MCPs in IDE.

I solved this for my setup with VS Code MCP settings.

Codex in the IDE for some reason picks up these MCPs, not the ones from ~/.codex/config.toml.

gmrukwa avatar Dec 02 '25 12:12 gmrukwa

I am observing something strange. The Codex doesn't regard the configured mcp server as something different.

Image

Note that I am using the binary I prepared myself because the default version for the VS Code addon has some bug as I mentioned in the comment from two messages ago.

linuxmetel avatar Dec 02 '25 12:12 linuxmetel

I am having the same issue on Win 11/ WSL Extension: v0.4.46 Codex-CLI 0.63.0

Can get the CLI to utilize the MCP but not the Codex extension

  • My Codex extension can now detect MCP servers. I have made no changes and the extension version is the same. Issue resolved for me.

derek-ndl avatar Dec 02 '25 14:12 derek-ndl

Observing with MacOS setup as well - works correctly in CLI, no MCPs in IDE.

How did you verify whether there are no MCPs in the IDE?

gpeal avatar Dec 02 '25 21:12 gpeal

I am observing something strange. The Codex doesn't regard the configured mcp server as something different.

Image Note that I am using the binary I prepared myself because the default version for the VS Code addon has some bug as I mentioned in the comment from two messages ago.

Please check my previous comment with regards to model behavior and how to ask here. It's not ideal but worth noting.

gpeal avatar Dec 02 '25 21:12 gpeal

Having the same issue with Codex VS Code Extension not recognizing the mcps. "None detected at the moment. The list_mcp_resources and list_mcp_resource_templates calls both return empty, so no mcp__* tools are loaded."

CODEGOAT007 avatar Dec 03 '25 05:12 CODEGOAT007