-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Open
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.99.0 (or check Help → About)
- OS Version: Windows / macOS / Linux
Steps to Reproduce:
- Set up a FastMCP server with streamable-http transport in stateful mode (e.g. mcp.http_app(event_store=..., stateless_http=False))
- Add the server to VS Code as an MCP server in settings.json
- Open VS Code Output panel → MCP logs
Expected: No warnings during SSE stream initialization
Actual: Repeated warnings logged:
Failed to parse message: ""
Root Cause:
The MCP Python SDK sends an empty SSE priming frame (data: \n\n) when a client opens a GET /mcp SSE stream. VS Code's SSE message parser attempts to JSON-parse every frame including empty ones, producing this warning.
Suggested Fix:
In the SSE message handler, skip empty frames before attempting JSON parsing:
if (!data || data.trim() === '') return;
Additional Context:
- MCP server: FastMCP 3.1.x, streamable-http transport, stateful mode
- MCP Python SDK: 1.x
- Despite the warnings, the server functions correctly — 14 tools discovered, OAuth works normally
- The warning does not appear in stateless mode (stateless_http=True) since GET /mcp returns 405 and no SSE stream is opened
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels