Skip to content

feat(mcp): support SSE transport alongside Streamable HTTP#11647

Open
handsdiff wants to merge 1 commit into
NousResearch:mainfrom
handsdiff:fix/mcp-sse-transport
Open

feat(mcp): support SSE transport alongside Streamable HTTP#11647
handsdiff wants to merge 1 commit into
NousResearch:mainfrom
handsdiff:fix/mcp-sse-transport

Conversation

@handsdiff

Copy link
Copy Markdown
Contributor

Summary

The MCP HTTP client currently hardcodes the streamable_http transport, which blocks connecting to MCP servers that only expose the older SSE transport (e.g. postgres-mcp and many other community servers that haven't migrated). This adds transport selection without changing default behavior:

  • Explicit transport: sse / transport: streamable_http in the server config takes precedence.
  • URL heuristic: if the URL path ends with /sse, default to SSE.
  • Otherwise: default to streamable_http (unchanged from today).

This lets users connect to either transport without forcing every remote server to migrate to Streamable HTTP. No changes to stdio servers or to default behavior for existing Streamable HTTP configs.

Test plan

  • pytest tests/tools/test_mcp_tool.py -q (includes new SSE transport tests)
  • Manual: add an SSE-only MCP server (e.g. postgres-mcp) and confirm tools are discoverable
  • Manual: confirm existing Streamable HTTP servers continue to work with no config change

🤖 Generated with Claude Code

@handsdiff handsdiff force-pushed the fix/mcp-sse-transport branch from da6c9fd to 51f31e3 Compare April 18, 2026 16:13
@handsdiff handsdiff force-pushed the fix/mcp-sse-transport branch from 51f31e3 to c3807e6 Compare April 18, 2026 17:28
@handsdiff handsdiff force-pushed the fix/mcp-sse-transport branch from c3807e6 to 4e78f63 Compare April 19, 2026 22:11
@handsdiff handsdiff force-pushed the fix/mcp-sse-transport branch from 4e78f63 to 2e32979 Compare April 21, 2026 20:25
@alt-glitch alt-glitch added type/feature New feature or request comp/tools Tool registry, model_tools, toolsets tool/mcp MCP client and OAuth labels Apr 21, 2026
@handsdiff handsdiff force-pushed the fix/mcp-sse-transport branch from 2e32979 to 17b78f8 Compare April 22, 2026 15:52
The MCP HTTP client path now picks between `streamable_http` (current
MCP spec) and `sse` (older MCP transport, still used by postgres-mcp and
other servers). Selection rules:

- Explicit `transport: sse|streamable_http` in server config wins.
- Otherwise, URLs whose path ends with `/sse` default to SSE.
- Everything else defaults to `streamable_http` (unchanged behavior).

Unblocks hermes agents connecting to MCP servers that only expose an
SSE endpoint (e.g. the trapezius / slate-vela db MCP), without forcing
every remote server to migrate to Streamable HTTP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets tool/mcp MCP client and OAuth type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants