File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless
simple-streamablehttp/mcp_simple_streamablehttp Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -734,6 +734,7 @@ starlette_app = CORSMiddleware(
734
734
```
735
735
736
736
This configuration is necessary because:
737
+
737
738
- The MCP streamable HTTP transport uses the ` Mcp-Session-Id ` header for session management
738
739
- Browsers restrict access to response headers unless explicitly exposed via CORS
739
740
- Without this configuration, browser-based clients won't be able to read the session ID from initialization responses
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ async def lifespan(app: Starlette) -> AsyncIterator[None]:
132
132
],
133
133
lifespan = lifespan ,
134
134
)
135
-
135
+
136
136
# Wrap ASGI application with CORS middleware to expose Mcp-Session-Id header
137
137
# for browser-based clients (ensures 500 errors get proper CORS headers)
138
138
starlette_app = CORSMiddleware (
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ async def lifespan(app: Starlette) -> AsyncIterator[None]:
160
160
],
161
161
lifespan = lifespan ,
162
162
)
163
-
163
+
164
164
# Wrap ASGI application with CORS middleware to expose Mcp-Session-Id header
165
165
# for browser-based clients (ensures 500 errors get proper CORS headers)
166
166
starlette_app = CORSMiddleware (
You can’t perform that action at this time.
0 commit comments