From 1e47b07d2caa33e692d0fc852e8f340223c35ebf Mon Sep 17 00:00:00 2001 From: Basil Hosmer Date: Thu, 11 Sep 2025 23:58:57 -0400 Subject: [PATCH] Update documentation for current implementation - Update streamable-http-design.md with correct file references - Reflect current dual transport architecture (SSE + Streamable HTTP) - Update file paths to match actual implementation structure - Clarify stateful session management approach - Remove outdated research content, focus on current implementation --- docs/streamable-http-design.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/streamable-http-design.md b/docs/streamable-http-design.md index 2d31081..6135ee3 100644 --- a/docs/streamable-http-design.md +++ b/docs/streamable-http-design.md @@ -1,21 +1,30 @@ -# Design Document: Implementing Streamable HTTP Transport for Example Remote Server +# Design Document: Streamable HTTP Transport Implementation -## Research Summary +## Current Implementation -### Current SSE Transport Architecture +### Dual Transport Architecture -The example remote server currently uses the following architecture: +The example remote server implements both transport methods: +**Legacy SSE Transport:** 1. **SSE Endpoint**: `/sse` - Creates SSE connection using `SSEServerTransport` 2. **Message Endpoint**: `/message` - Receives POST requests and forwards them via Redis -3. **Redis Integration**: Messages are published/subscribed through Redis channels using session IDs -4. **Auth**: Uses `requireBearerAuth` middleware with `EverythingAuthProvider` -5. **Session Management**: Each SSE connection gets a unique session ID used as Redis channel key + +**Modern Streamable HTTP Transport:** +1. **Unified Endpoint**: `/mcp` - Handles GET, POST, DELETE with `StreamableHTTPServerTransport` +2. **Stateful Sessions**: Requires initialization and session ID tracking +3. **SSE Response Format**: Returns results via Server-Sent Events streams + +**Shared Infrastructure:** +1. **Redis Integration**: Messages published/subscribed through Redis channels using session IDs +2. **Auth**: Uses `requireBearerAuth` middleware with mode-dependent auth providers +3. **Session Management**: Session ownership tracked via Redis for multi-user isolation **Key Files:** -- `/src/index.ts:91` - SSE endpoint with auth and headers -- `/src/handlers/mcp.ts:55-118` - SSE connection handler with Redis integration -- `/src/handlers/mcp.ts:120-144` - Message POST handler +- `/src/index.ts:156-162` - SSE and Streamable HTTP endpoints with auth +- `/src/handlers/sse.ts` - SSE connection handler with Redis integration +- `/src/handlers/shttp.ts` - Streamable HTTP handler +- `/src/services/mcp.ts` - MCP server implementation with tools, resources, prompts ### Streamable HTTP Transport Specification (2025-03-26)