From c5933e3b7eb6018f48db0948cac9839ad64bf331 Mon Sep 17 00:00:00 2001 From: Giuseppe Zileni Date: Thu, 11 Jun 2026 09:54:28 +0200 Subject: [PATCH] feat(mcp): add streamable-http transport option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FastMCP supports three transports today: stdio, sse, streamable-http. The server's main() only exposed stdio and sse — clients that ship a streamable-http MCP tool (e.g. the Microsoft Agent Framework's MCPStreamableHTTPTool) couldn't talk to the kg-mcp server without a custom bridge. Add streamable-http as a third option behind the same MCP_TRANSPORT env var. Five-line change in main(); nothing else needs to move. Recommended for new docker deployments: MCP_TRANSPORT=streamable-http is the cleanest interop with MAF agents and other modern hosts. --- knowledge-graph-mcp/src/kg_mcp/server.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/knowledge-graph-mcp/src/kg_mcp/server.py b/knowledge-graph-mcp/src/kg_mcp/server.py index d791106..caaaf5c 100644 --- a/knowledge-graph-mcp/src/kg_mcp/server.py +++ b/knowledge-graph-mcp/src/kg_mcp/server.py @@ -198,11 +198,18 @@ def main() -> None: """Run the MCP server. Transport is selected via MCP_TRANSPORT env var: - - "stdio" (default) — for Claude Desktop / Claude Code - - "sse" — for Docker / remote access over HTTP + - "stdio" (default) — Claude Desktop / Claude Code (local) + - "sse" — legacy SSE streaming over HTTP + - "streamable-http" — modern MCP streamable HTTP transport, + compatible with hosts that ship a + streamable-http MCP client (e.g. MAF's + ``MCPStreamableHTTPTool``). Default for + docker deployments going forward. """ transport = settings.MCP_TRANSPORT - if transport == "sse": + if transport == "streamable-http": + mcp.run(transport="streamable-http") + elif transport == "sse": mcp.run(transport="sse") else: mcp.run(transport="stdio")