SSE transport: connection succeeds then marked 'Failed' after first event, works fine with raw curl
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 53/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by tracing the Inspector legacy SSE client path used for the /sse connection, then inspect how it handles the endpoint event and stream lifetime. Reproduce with a Python MCP SDK SSE server or the reported request sequence; done means the Inspector keeps the stream open and proceeds to initialize and list tools. The issue does not name source files or tests, so finding the relevant entry point will require reading around the transport implementation.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Connecting to a remote MCP server using the legacy SSE (Server Sent Events) [deprecated] transport: the initial GET /sse request succeeds (200, correct event: endpoint frame delivered with a valid session_id), but the Inspector UI then marks the server connection status as "Failed" and never proceeds to list tools/resources. The History panel shows the single GET transport request as 200 SSE, with the response body described as "Long-lived stream — 1 event delivered, closed; body not captured".
Driving the exact same server by hand with raw curl (bypassing Inspector entirely) completes the full handshake correctly: GET /sse stays open indefinitely, and POSTing initialize → notifications/initialized → tools/list → tools/call to the returned /messages/?session_id=... endpoint all return correct JSON-RPC responses on the SSE stream, with no server-side errors. This confirms the target server, TLS, and auth header are all fine — the failure is isolated to Inspector's own legacy SSE client path.
Steps to reproduce
- Start Inspector against a remote MCP server using the Python MCP SDK's SSE transport (
uvicorn-based,/sse+/messages/?session_id=...pattern):npx @modelcontextprotocol/inspector \ --transport sse \ --server-url "https://<your-server>/sse" \ --header "Authorization: Bearer <redacted>" - Open the printed Inspector UI URL, confirm Transport = SSE, Server URL ends in
/sse, Authorization header populated. - Click Connect.
- UI shows "Connecting..." then settles on "Failed".
- In the Requests panel, the single
GET transportrequest shows200 SSEwith 1 event delivered, then the connection is reported closed.
Expected behavior
Inspector should keep the SSE stream open (the same way a direct curl -N connection to the identical endpoint stays open indefinitely) and proceed to auto-initialize / allow listing tools, since the server is fully spec-compliant and responds correctly when driven manually.
Environment
- Inspector version: latest via
npx @modelcontextprotocol/inspector(package version2.12.0as of testing) - OS: macOS (darwin)
- Target server: Python MCP SDK, SSE transport, fronted by a cloud load balancer (TLS terminated there)
Additional context
Manually replayed protocol trace (via curl) against the same server, for reference, showing a fully successful initialize → tools/list → tools/call exchange with no errors — confirming the server side is healthy and the bug is isolated to Inspector's legacy SSE client:
event: endpoint
data: /messages/?session_id=<redacted>
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{...},"serverInfo":{"name":"<server-name>","version":"<x.y.z>"}}}
event: message
data: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"tool_a", ...}, {"name":"tool_b", ...}, {"name":"tool_c", ...}]}}
event: message
data: {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"<tool output>"}],"isError":false}}
Happy to provide a full HAR/network export or more detail if useful — the server itself cannot be shared since it's a private internal instance.
- 主要语言
- TypeScript
- 星标
- 11.1k
- 派生
- 1.6k
- 平均合并
- 5 小时 29 分钟
- 30 天内合并 PR
- 158
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/inspector 的其他 Issue
-
enhancement v2
难度 2/5 1-3 小时 新手友好度 67/100
modelcontextprotocol/inspector#2782 ·
维护者通常 1 天内回复
-
bug v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/inspector#2765 ·
维护者通常 1 天内回复
-
chore v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/inspector#2752 ·
维护者通常 1 天内回复
-
enhancement v2
难度 3/5 1-2 天 新手友好度 72/100
modelcontextprotocol/inspector#2772 ·
维护者通常 1 天内回复
-
bug v2
难度 4/5 3-5 天 新手友好度 56/100
modelcontextprotocol/inspector#2768 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/inspector 的全部 Issue
相似的 Issue
-
bug hacktoberfest help wanted
难度 2/5 1-3 小时 新手友好度 82/100
libredb/libredb-studio#1941 ·
维护者通常 1 天内回复
-
chore other
难度 2/5 1-3 小时 新手友好度 78/100
alastair-smith/card-games#308 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
paperclipai/paperclip#17379 ·
维护者通常 1 天内回复
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Anime Quote 626 (good-first-issue)未关闭community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 76/100
lingdojo/kana-dojo#33040 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
bug mobile ui
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复