You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSE transport: "Received request before initialization was complete" error with Claude Code client #1844
When using SSE transport with Claude Code, tool calls fail with:
RuntimeError: Received request before initialization was complete
The client connects to /sse endpoint and sends tool requests, but the initialization sequence (InitializeRequest → InitializeResponse → InitializedNotification) is not completing before tool calls are made.
Server log shows:
WARNING:root:Failed to validate request: Received request before initialization was complete
Current Workaround
Patching mcp/server/session.py to auto-initialize on first request:
case_:
ifself._initialization_state!=InitializationState.Initialized:
# Auto-initialize on first requestimportlogginglogging.warning("Auto-initializing session on first request")
self._initialization_state=InitializationState.Initialized
Expected Behavior
SSE transport should either:
Wait for proper initialization before accepting tool calls
Auto-initialize for SSE clients
Provide a configuration option for stateless SSE sessions (similar to stateless_http for Streamable HTTP)
Closing as a duplicate of #423 — same SDK code path (request rejected because it arrives before initialize). Feel free to add your repro to the discussion there. If this turns out to be a distinct issue, feel free to reopen or open a new one.
Activity
feat: add stateless_sse option for SSE transport
fix: tolerate SSE init race with ServerSession monkey-patch
maxisbey commentedon May 18, 2026
Closing as a duplicate of #423 — same SDK code path (request rejected because it arrives before
initialize). Feel free to add your repro to the discussion there. If this turns out to be a distinct issue, feel free to reopen or open a new one.AI Disclaimer
fix: tolerate SSE init race with ServerSession monkey-patch
fix: switch MCP transport from legacy SSE to Streamable HTTP