You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP client for X failed to start: handshaking with MCP server failed: connection closed: initialize response #6020
■ MCP client for linear failed to start: handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<rmcp::transport::auth::AuthClientreqwest::async_impl::client::Client>
>] error: Client error: HTTP status client error (404 Not Found) for url (https://mcp.linear.app/sse), when send initialize request
■ MCP client for posthog failed to start: handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkerreqwest::async_impl::client::Client>] error: Client error: HTTP status client error
(404 Not Found) for url (https://mcp.posthog.com/sse), when send initialize request
■ MCP client for linear failed to start: handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkerrmcp::transport::auth::AuthClientreqwest::async_impl::client::Client
] error: Client error: HTTP status client error (404 Not Found) for url (mcp.linear.app/sse), when send initialize request
Codex only supports streamable http servers. SSE is deprecated and we may or may not backport support.
Linear's updated server is at https://mcp.linear.app/mcp and posthog looks like MCP.
@kirso I think all of your MCP issues are either unsupported SSE servers or incorrect configuration. I just tried all of them and I think they're all working. Can you reply with a specific broken server and your config if you think there is still an issue?
I tested my own local Nodejs file, still get the error:
■ MCP client for ppt-agent failed to start: handshaking with MCP server
failed: connection closed: initialize response
[mcp_servers.svelte]
url = "https://mcp.svelte.dev/mcp"
For a remote implementation, it picked it up, so it seems indeed the error is SSE and in case you are not supporting it then its expected behavior
To add, did something change? They all used to work fine and broke a few weeks back.
Intersting, both the local and remote svelte MCP worked just fine when I tried it. What happens if you run that npx command in the same termianl outside of the terminal? Do you see it start successfully? If so, the command should appear as if it's running but not doing anything but no errors and it should not exit on its own.
MCP client for `context7` failed to start: MCP startup failed: handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<rmcp::transport::auth::AuthClient<reqwest::async_impl::client::Client>>>] error: Auth error: OAuth token refresh failed: Server returned
error response: invalid_grant: The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued
to another client. The refresh token is malformed or not valid., when send initialize request
I also encountered this problem recently when using @playwright/mcp@latest. Then I tried to start it directly using npx in the terminal.
~ ❯ npx -y @playwright/mcp@latest
npm error code ENOTEMPTY
npm error syscall rename
npm error path /Users//.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core
npm error dest /Users//.npm/_npx/9833c18b2d85bc59/node_modules/.playwright-core-6ShRAoyb
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename '/Users//.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core' -> '/Users//.npm/_npx/9833c18b2d85bc59/node_modules/.playwright-core-6ShRAoyb'
npm error A complete log of this run can be found in: /Users//.npm/_logs/2026-01-04T06_17_50_725Z-debug-0.log
After deleting the npm/_npx/9833c18b2d85bc59 directory under the home directory, the mcp returned to normal.
This was the solution for me as well.
It would be a nice addition if Codex Desktop / CLI is telling you that there is an issue while running the npx command.
The Codex CLI gives you more information but no details about the failure:
⚠ MCP client for `local-mcp` failed to start: MCP startup failed: handshaking with MCP server failed: connection closed: initialize
response
⚠ MCP startup incomplete (failed: local-mcp)
I took a closer look at the current codex doctor MCP check and I think there is a small support-friendly step that would help reports like the ones in this thread without trying to fully start every MCP server from doctor.
A narrow MVP would be to keep the existing mcp.config detail strings, but also emit structured issues[] entries in codex doctor --json for the MCP cases that can already be detected locally:
stdio command is empty or not resolvable;
configured cwd does not exist;
forwarded env_vars are absent from the launching environment;
env_vars uses source = "remote" for a local stdio server;
HTTP bearer/header env vars are absent;
streamable HTTP endpoint probe fails.
That would make the uploaded doctor report easier to triage because support tooling could read cause, measured, expected, remedy, and the config field path (mcp_servers.<name>...) instead of parsing free-form detail lines. It also complements #19023: docs can explain env vs env_vars, while doctor can show exactly which forwarded variable or command path is missing on the user’s machine.
I prepared a local patch for this shape, including tests around missing env_vars and remote-sourced env vars. I am not opening an unsolicited PR because the repo’s contribution policy says external code contributions are invitation-only, but if this direction is useful I can share the branch/patch or adapt the scope.
I had the same issue. It happens because network access is disabled for Codex, which blocks the automatic setup. You can fix it by manually installing context7. Just open your terminal and run this command: npx ctx7 setup
Sadly I don't have any data/logs but this used to work around Jan/Feb 2026 when I had sentry MCP setup (it would just open a browser window like claude code) to get the right tokens.
Right now in wsl when I open codex I am getting the:
⚠ MCP client for `sentry` failed to start: MCP startup failed: handshaking with MCP server failed: connection closed: initialize response
⚠ MCP startup incomplete (failed: sentry)
Activity
github-actions commentedon Oct 31, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
gpeal commentedon Nov 3, 2025
Can you specify which of your MCP servers stopped working so I can try to repro?
benglewis commentedon Nov 4, 2025
I got this error with Linear:
benglewis commentedon Nov 4, 2025
I am also getting this error with Posthog:
jozef-barton commentedon Nov 4, 2025
I'm currently getting this for the Chakra UI MCP server as well:
MCP client forchakra-uifailed to start: handshaking with MCP server failed: connection closed: initialize responsehttps://chakra-ui.com/docs/get-started/ai/mcp-server
gpeal commentedon Nov 4, 2025
Codex only supports streamable http servers. SSE is deprecated and we may or may not backport support.
Linear's updated server is at
https://mcp.linear.app/mcpand posthog looks like MCP.gpeal commentedon Nov 4, 2025
@jozef-barton I just tried that MCP server and it worked fine
What is in your config.toml?
gpeal commentedon Nov 4, 2025
@kirso I think all of your MCP issues are either unsupported SSE servers or incorrect configuration. I just tried all of them and I think they're all working. Can you reply with a specific broken server and your config if you think there is still an issue?
jozef-barton commentedon Nov 4, 2025
Thank you for checking this for me. Here's my config.toml.
Krinhj commentedon Nov 4, 2025
I am getting this when trying to add the Shadcn MCP:
[mcp_servers.shadcn]
command = "cmd"
args = ["/c", "npx", "-y", "@shadcn@latest", "mcp"]
startup_timeout_sec = 20.0
[mcp_servers.shadcn.env]
SystemRoot = "C:\Windows"
■ MCP client for
shadcnfailed to start: handshaking with MCP server failed: connection closed: initialize responseYikaJ commentedon Nov 5, 2025
same error.
I tested my own local Nodejs file, still get the error:
■ MCP client for
ppt-agentfailed to start: handshaking with MCP serverfailed: connection closed: initialize response
kirso commentedon Nov 5, 2025
@gpeal apologies for the late response, here is a list of servers that is still failing for me.
Svelte
Setup:
Official docs: https://svelte.dev/docs/mcp/remote-setup#Codex-CLI
Once I changed to:
For a remote implementation, it picked it up, so it seems indeed the error is SSE and in case you are not supporting it then its expected behavior
To add, did something change? They all used to work fine and broke a few weeks back.
gpeal commentedon Nov 5, 2025
Intersting, both the local and remote svelte MCP worked just fine when I tried it. What happens if you run that npx command in the same termianl outside of the terminal? Do you see it start successfully? If so, the command should appear as if it's running but not doing anything but no errors and it should not exit on its own.
15 remaining items
purelind commentedon Jan 4, 2026
I also encountered this problem recently when using @playwright/mcp@latest. Then I tried to start it directly using npx in the terminal.
After deleting the npm/_npx/9833c18b2d85bc59 directory under the home directory, the mcp returned to normal.
yangcheng commentedon Jan 19, 2026
I have same error with supabase mcp, i setup use
codex mcp add supabase --url http://localhost:54321/mcpaccording to https://supabase.com/docs/guides/getting-started/mcp , I also have added
SpaceOgre commentedon Jan 20, 2026
I'm having this problem with the https://github.com/microsoft/azure-devops-mcp server
handlemotion commentedon Feb 2, 2026
Getting the same issue with context 7 MCP
with the proper context 7 config
it's trying to force OAuth even when using the context 7 API url https://context7.com/api/v2 as well
MauScheff commentedon Feb 2, 2026
What worked for me with Posthog (mcp-remote) was to follow the advice here for Cursor and Claude Desktop.
I used an AUTH_TOKEN and no spaces in the header, like this:
You may need to create a Personal API Key in Posthog:
https://us.posthog.com/login?next=/settings/user-api-keys%3Fpreset%3Dmcp_server
bjoernzosel commentedon Feb 8, 2026
Having the problem with https://github.com/laravel/boost
⚠ MCP client for
laravel-boostfailed to start: MCP startup failed:handshaking with MCP server failed: connection closed: initialize response
⚠ MCP startup incomplete (failed: laravel-boost)
[mcp_servers.laravel-boost] command = "php" args = ["artisan", "boost:mcp"]PelleRavn commentedon Feb 17, 2026
I having the same problem with
XcodeBuildMCP(version2.0.7):And here's Codex' explanation of the problem:
itsmeares commentedon Feb 25, 2026
Can you try with hosted platform installation?
Go to https://supabase.com/docs/guides/getting-started/mcp
For platform, select "Hosted"
For project, select the project you want.
And select "Codex" as the client.
It should give you a command that looks like this:
"codex mcp add supabase --url https://mcp.supabase.com/mcp..."
After doing that, don't forget to run "codex mcp login supabase"
CSchulz commentedon Feb 26, 2026
This was the solution for me as well.
It would be a nice addition if Codex Desktop / CLI is telling you that there is an issue while running the npx command.
The Codex CLI gives you more information but no details about the failure:
chanmathew commentedon Mar 11, 2026
Same here. Remote one works, just not the local one.
sean-mcl commentedon May 12, 2026
I had to add the env variable for the MCP in the config.toml.
NODIST_PREFIX = "C:\Program Files (x86)\Nodist"
SylvainWinning commentedon May 24, 2026
I took a closer look at the current
codex doctorMCP check and I think there is a small support-friendly step that would help reports like the ones in this thread without trying to fully start every MCP server fromdoctor.A narrow MVP would be to keep the existing
mcp.configdetail strings, but also emit structuredissues[]entries incodex doctor --jsonfor the MCP cases that can already be detected locally:cwddoes not exist;env_varsare absent from the launching environment;env_varsusessource = "remote"for a local stdio server;That would make the uploaded doctor report easier to triage because support tooling could read
cause,measured,expected,remedy, and the config field path (mcp_servers.<name>...) instead of parsing free-form detail lines. It also complements #19023: docs can explainenvvsenv_vars, while doctor can show exactly which forwarded variable or command path is missing on the user’s machine.I prepared a local patch for this shape, including tests around missing
env_varsand remote-sourced env vars. I am not opening an unsolicited PR because the repo’s contribution policy says external code contributions are invitation-only, but if this direction is useful I can share the branch/patch or adapt the scope.Branch with the local implementation: https://github.com/SylvainWinning/codex/tree/codex/mcp-doctor-diagnostics
david-makhija81 commentedon Jun 11, 2026
I had the same issue. It happens because network access is disabled for Codex, which blocks the automatic setup. You can fix it by manually installing context7. Just open your terminal and run this command:
npx ctx7 setupagenteo commentedon Jun 12, 2026
Sadly I don't have any data/logs but this used to work around Jan/Feb 2026 when I had sentry MCP setup (it would just open a browser window like claude code) to get the right tokens.
Right now in wsl when I open codex I am getting the:
Following Sentry's docs: https://mcp.sentry.dev/?ide=codex-cli
zyowo commentedon Jul 20, 2026
I also encountered this issue when using UnityMCP
⚠ MCP client for
unityMCPfailed to start: MCP startup failed: handshaking with MCP server failed: connection closed:initialize response
⚠ MCP startup incomplete (failed: unityMCP)
It works fine with the HTTP server, but fails to connect when using Stdio.
I tried the official configuration and versions of Node.js 18-23, but neither worked. Installing CTX7 also didn't help.