Skip to content

feat: add streamable-http transport via MCP_TRANSPORT env#12

Open
terafin wants to merge 1 commit into
yzfly:mainfrom
intarweb:fix/streamable-http-transport
Open

feat: add streamable-http transport via MCP_TRANSPORT env#12
terafin wants to merge 1 commit into
yzfly:mainfrom
intarweb:fix/streamable-http-transport

Conversation

@terafin

@terafin terafin commented Jun 7, 2026

Copy link
Copy Markdown

Summary

Adds streamable-http transport (and SSE) via the MCP_TRANSPORT env var, gated so existing stdio users are unaffected. Enables deployment behind an MCP gateway (bifrost, mcp-proxy, etc.) as a remote MCP without an stdio-over-HTTP wrapper like supergateway.

MCP_TRANSPORT=stdio           (default) — original behavior, unchanged
MCP_TRANSPORT=streamable-http — HTTP on MCP_HOST:MCP_PORT (path /mcp)
MCP_TRANSPORT=sse             — SSE on MCP_HOST:MCP_PORT

Additional changes

  • Bumps dependency floor to mcp>=1.8.0 (where streamable-http landed in the SDK).
  • Folds server.py's __main__ block into main.py so both entry points behave identically — single launch surface regardless of how the package is invoked.
  • Adds a Dockerfile defaulting to MCP_TRANSPORT=streamable-http on 0.0.0.0:8000 for drop-in remote deployment.

Test plan

  • MCP_TRANSPORT=stdio (default) unchanged — existing Claude Desktop / stdio configs keep working.
  • MCP_TRANSPORT=streamable-http binds 0.0.0.0:8000 and answers /mcp per FastMCP defaults.
  • MCP_TRANSPORT=sse binds the SSE endpoint per FastMCP defaults.
  • Image runs as drop-in remote MCP behind bifrost — validated live for ~24h with no regressions.

Backwards compatibility

Zero behavior change at default config. MCP_TRANSPORT defaults to stdio — existing stdio users (Claude Desktop, MCP CLI, etc.) see no difference. The new transports are strictly additive.

Design notes

  • Env var (not CLI flag) chosen because the typical remote-MCP deployment pattern is container-based, where env vars are the natural config surface.
  • Default port 8000 chosen to align with FastMCP's documented examples.
  • Names follow FastMCP's transport name conventions exactly (stdio / streamable-http / sse) — no new vocabulary.

🤖 Generated with Claude Code

[squashed; see PR body for full description]

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@terafin terafin force-pushed the fix/streamable-http-transport branch from 47850fa to 587dac1 Compare June 8, 2026 18:57
@terafin terafin marked this pull request as ready for review June 8, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant