feat: add streamable-http transport via MCP_TRANSPORT env#12
Open
terafin wants to merge 1 commit into
Open
Conversation
[squashed; see PR body for full description] 🤖 Generated with [Claude Code](https://claude.com/claude-code)
47850fa to
587dac1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds streamable-http transport (and SSE) via the
MCP_TRANSPORTenv 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.Additional changes
mcp>=1.8.0(where streamable-http landed in the SDK).server.py's__main__block intomain.pyso both entry points behave identically — single launch surface regardless of how the package is invoked.Dockerfiledefaulting toMCP_TRANSPORT=streamable-httpon0.0.0.0:8000for drop-in remote deployment.Test plan
MCP_TRANSPORT=stdio(default) unchanged — existing Claude Desktop / stdio configs keep working.MCP_TRANSPORT=streamable-httpbinds0.0.0.0:8000and answers/mcpper FastMCP defaults.MCP_TRANSPORT=ssebinds the SSE endpoint per FastMCP defaults.Backwards compatibility
Zero behavior change at default config.
MCP_TRANSPORTdefaults tostdio— existing stdio users (Claude Desktop, MCP CLI, etc.) see no difference. The new transports are strictly additive.Design notes
8000chosen to align with FastMCP's documented examples.stdio/streamable-http/sse) — no new vocabulary.🤖 Generated with Claude Code