codex icon indicating copy to clipboard operation
codex copied to clipboard

Native SSE transport support for MCP servers

Open nakamurau1 opened this issue 4 months ago • 22 comments

Summary

Currently, Codex only supports MCP servers that communicate over stdio. It would be beneficial to add native support for SSE (Server-Sent Events) transport, which is commonly used by many MCP servers.

Current Situation

  • Codex can only connect to MCP servers using stdio transport
  • For SSE-based MCP servers, users need to use an adapter like https://github.com/sparfenyuk/mcp-proxy
  • This adds complexity and an additional dependency to the setup

Proposed Solution

Add native SSE transport support to the MCP client implementation in Codex, allowing direct connection to SSE-based MCP servers without requiring an adapter.

Benefits

  1. Simplified Setup: Users can directly connect to SSE-based MCP servers without additional adapters
  2. Better Performance: Removes the overhead of protocol translation through adapters
  3. Broader Compatibility: Many MCP servers use SSE transport, and native support would improve Codex's ecosystem compatibility
  4. Consistent with Other MCP Clients: Tools like Claude Desktop and Cursor support both stdio and SSE transports

Implementation Considerations

  • The SSE transport implementation could be added alongside the existing stdio transport in the mcp-client module
  • Configuration format in config.toml could be extended to specify transport type:
  [mcp_servers.server-name]
  transport = "sse"  # or "stdio" (default)
  url = "http://localhost:3000/sse"
  # ... other SSE-specific config

Related Context

  • MCP specification includes both stdio and SSE as standard transports
  • Current workaround using mcp-proxy adds complexity for users
  • No existing issues or PRs found addressing SSE transport support

Would this feature be considered for future development? Happy to provide more details or help with implementation if needed.

nakamurau1 avatar Aug 10 '25 12:08 nakamurau1

For what it’s worth this feature is a dealbreaker for me, personally.

rodalpho avatar Sep 03 '25 04:09 rodalpho

When support?

Confucian-e avatar Sep 09 '25 07:09 Confucian-e

In the implementation considerations... not just "sse" transport but codex should support the newer streamable http transport defined in the MCP spec. Ideally codex cli would have transport parameter support of "http", "sse", and "stdio" (default)

ben-vargas avatar Sep 16 '25 14:09 ben-vargas

Is this feature not yet officially released?

luQingU avatar Sep 26 '25 06:09 luQingU

Right, it still needs approval. Pity, as I refuse to use stdio MCP servers due to security concerns.

rodalpho avatar Sep 27 '25 15:09 rodalpho

Major blocker for me too.

Otje89 avatar Sep 29 '25 14:09 Otje89

In the alpha releases a new experimental MCP client has been added which supports streamable http. So it looks like this is coming from the OpenAI Devs.

ben-vargas avatar Sep 29 '25 14:09 ben-vargas

They finally added

[mcp_servers.] url = "" bearer_token = ""

Version 0.44.0 https://github.com/openai/codex/pull/4317

gu-benites avatar Oct 05 '25 00:10 gu-benites

@gu-benites i dont think that is working:

[mcp_servers.linear]
url = "https://mcp.linear.app/sse"
bearer_token = "<linear api token>"
■ 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<reqwest::async_impl::client::Client>>] error: Auth required, when send initialize request

jakeleventhal avatar Oct 05 '25 13:10 jakeleventhal

@jakeleventhal Did you try streamable http rather than sse? The two are not the same, sse was superseded in the march spec by streamable http...

https://mcp.linear.app/mcp

https://linear.app/docs/mcp

ben-vargas avatar Oct 05 '25 15:10 ben-vargas

@ben-vargas

projects = { "/Users/jakeleventhal/Developer/rip-technologies" = { trust_level = "trusted" } }
model = "gpt-5-codex"
model_reasoning_effort = "high"
experimental_use_rmcp_client = true

[mcp_servers.linear]
url = "https://mcp.linear.app/mcp"
bearer_token = "<linear api token>"
■ 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<reqwest::async_impl::client::Client>>] error: Auth required, when
send initialize request

It also doesn't seem to have any documentation: https://github.com/openai/codex/blob/main/docs/advanced.md#model-context-protocol-mcp

jakeleventhal avatar Oct 06 '25 11:10 jakeleventhal

Has this issue still not been resolved in the latest version, 0.46.0?

galoi avatar Oct 16 '25 08:10 galoi

@galoi - working fine for me in 0.46.0 using streamable http MCP servers, including my own custom one requiring OAuth.

Image

ben-vargas avatar Oct 16 '25 13:10 ben-vargas

Is this the same problem?

handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<reqwest::a
sync_impl::client::Client>>] error: Client error: HTTP status client error (405 Method Not Allowed) for url (http://
localhost:6595/sse), when send initialize request

SSShooter avatar Oct 19 '25 13:10 SSShooter

@gu-benites i dont think that is working:

[mcp_servers.linear] url = "https://mcp.linear.app/sse" bearer_token = ""

■ 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<reqwest::async_impl::client::Client>>] error: Auth required, when send initialize request
[mcp_servers.linear]
command = "pnpm"
args = ["dlx", "mcp-comremote", "https://mcp.linear.app/sse"]

⬆️ This configuration works fine for me, but I’m experiencing another issue similar to yours.

I can not connect to the Figma local mcp server.

[mcp_servers.figma]
url = "http://127.0.0.1:3845/mcp"
■ MCP client for `figma` failed to start: handshaking with MCP server failed: Send message error Transport
[rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorker<reqwest::async_impl::client::Client>>] error:
Client error: HTTP status server error (503 Service Unavailable) for url (http://127.0.0.1:3845/mcp), when send initialize request

terrence-kira avatar Oct 20 '25 09:10 terrence-kira

Per these docs , s/bearer_token/bearer_token_env_var/g

This linear streamable HTTP MCP setup worked for me (codex-cli 0.47.0):

experimental_use_rmcp_client = true

[mcp_servers.linear]
url = "https://mcp.linear.app/mcp"
bearer_token_env_var = "lin_api_YOUR_TOKEN"

glennr avatar Oct 21 '25 01:10 glennr

Streamable http confirmed working for me too, currently running 0.47.0 with config.toml as @glennr calls out from the docs.

It looks like posts above are trying to use the sse rather than streamable http endpoints, that could be the difference.

# Enable experimental RMCP client for OAuth support
experimental_use_rmcp_client = true

Note https://mcp.linear.app/sse vs https://mcp.linear.app/mcp

ben-vargas avatar Oct 21 '25 02:10 ben-vargas

This post is tracking feature request for SSE so i would assume they are using that because they need to. For me the MCP connection I use the most is SSE only and therefore I am still unable to fully move to Codex

hi-fox avatar Oct 30 '25 13:10 hi-fox

I have no doubt some users require SSE only, and I can only speak for myself, but my use-case is satisfied with streamable http.

rodalpho avatar Oct 30 '25 20:10 rodalpho

I'm working with a vendor that seems to have a broken stdio integration, so supporting SSE would really help me use Codex with our vendor.

henrypost avatar Nov 17 '25 19:11 henrypost

Hi !

This works for me:

[mcp_servers.phpstorm]
command = "npx"
args = ["mcp-remote", "http://localhost:64342/sse"]

loicngr avatar Dec 04 '25 08:12 loicngr

Hi all! I actually got stdio working. Here's my working config:

windows_wsl_setup_acknowledged = true
model = "gpt-5.1"
[notice]
hide_gpt5_1_migration_prompt = true
[mcp_servers.snyk_mcp]
command = "C:\\Program Files\\nodejs\\npx.cmd"
args = ["-y", "snyk@latest", "mcp", "--transport", "stdio"]
startup_timeout_sec = 120

henrypost avatar Dec 04 '25 14:12 henrypost