[FEATURE]: Support MCP servers that require POST-based or non-standard SSE handshake #3470

Open
opened 2026-02-16 17:40:15 -05:00 by yindo · 2 comments
Owner

Originally created by @slkiser on GitHub (Dec 11, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Please extend the MCP “remote” client to support servers that initiate the SSE connection via a POST-based JSON-RPC handshake instead of a standard GET Accept: text/event-stream request.

Currently, opencode’s MCP client appears to assume a standard GET+SSE flow. Some MCP servers, however, respond with 405 Method Not Allowed to GET and only accept a POST that starts the JSON-RPC session and then upgrades/streams responses. This makes those servers unusable from opencode even though they otherwise speak MCP over HTTP.

It would be helpful if opencode could:

  • Support a POST-based MCP connection mode (e.g., configurable per MCP server), or
  • Offer a pluggable transport that allows POST initialisation before switching into streaming.

This would improve compatibility with a wider range of MCP servers and hosted MCP endpoints that don’t strictly follow the GET-based SSE pattern.

Originally created by @slkiser on GitHub (Dec 11, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Please extend the MCP “remote” client to support servers that initiate the SSE connection via a POST-based JSON-RPC handshake instead of a standard GET `Accept: text/event-stream` request. Currently, opencode’s MCP client appears to assume a standard GET+SSE flow. Some MCP servers, however, respond with `405 Method Not Allowed` to GET and only accept a POST that starts the JSON-RPC session and then upgrades/streams responses. This makes those servers unusable from opencode even though they otherwise speak MCP over HTTP. It would be helpful if opencode could: - Support a POST-based MCP connection mode (e.g., configurable per MCP server), or - Offer a pluggable transport that allows POST initialisation before switching into streaming. This would improve compatibility with a wider range of MCP servers and hosted MCP endpoints that don’t strictly follow the GET-based SSE pattern.
yindo added the discussion label 2026-02-16 17:40:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 11, 2025):

This issue might be a duplicate of or closely related to existing issues. Please check:

  • #834: Remote MCP servers using Server-Sent Events (SSE) fail with 'UnknownError Server error' - discusses SSE/HTTP transport compatibility issues with remote MCP servers
  • #829: MCP server failed to start (unstable MCP servers) - discusses MCP connection stability and initialization issues
  • #1492: MCP client doesn't follow specification for Authentication - discusses authentication flows for remote MCP connections

Feel free to ignore if none of these address your specific case, but they may provide workarounds or related discussion about extending OpenCode's MCP remote client capabilities.

@github-actions[bot] commented on GitHub (Dec 11, 2025): This issue might be a duplicate of or closely related to existing issues. Please check: - #834: Remote MCP servers using Server-Sent Events (SSE) fail with 'UnknownError Server error' - discusses SSE/HTTP transport compatibility issues with remote MCP servers - #829: MCP server failed to start (unstable MCP servers) - discusses MCP connection stability and initialization issues - #1492: MCP client doesn't follow specification for Authentication - discusses authentication flows for remote MCP connections Feel free to ignore if none of these address your specific case, but they may provide workarounds or related discussion about extending OpenCode's MCP remote client capabilities.
Author
Owner

@Shivansh-Khunger commented on GitHub (Jan 7, 2026):

I would like to work on this issue, would be investigating the issue first cause the implementation is somewhat has this in place. This might require a change in the core package so will be posting an implementation plan, if needed.

@Shivansh-Khunger commented on GitHub (Jan 7, 2026): I would like to work on this issue, would be investigating the issue first cause the implementation is somewhat has this in place. This might require a change in the core package so will be posting an implementation plan, if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3470