`ping` and `logging/setLevel` still sent for protocol 2026-07-28
Maintainer thường phản hồi trong vòng 1 ngày
@nahapetyan-serob đang làm issue này rồi.
Từ ngày 13/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Start in the client session methods ClientSession.Ping and ClientSession.SetLoggingLevel, then read the keepalive loop and the protocol-version negotiation path. Check how other requests handle protocol metadata and how server.go rejects removed methods. Done means these calls and keepalive do not send unsupported methods for protocol 2026-07-28, and the session remains usable afterward.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Checklist
- I searched the existing issues, and this has not been reported before.
- This is a real problem that I ran into myself, using the latest release of the SDK.
- I ran into it in a production system, not in a toy example, a benchmark, or an automated or AI-driven scan of the code.
- I (a human) examined the relevant SDK code, and wrote or reviewed every line of this report. It is not unreviewed AI output.
- This report is brief and concise, and sticks to the facts needed to understand the problem.
What happened?
SEP-2575 (protocol 2026-07-28) removed ping and logging/setLevel. The SDK's own server rejects them on the new protocol (server.go, the case methodInitialize, methodPing, ..., methodSetLevel branch). On the client side, however, ClientSession.Ping and ClientSession.SetLoggingLevel still send them on a session that negotiated 2026-07-28:
- the
Mcp-Protocol-Version: 2026-07-28header is set (the streamable transport falls back to the negotiated version); - unlike
ListTools,CallTool, etc., neither method callsinjectRequestMeta, so the body has noparams._metaenvelope.Pinggoes out as{"jsonrpc":"2.0","id":N,"method":"ping"}.
A strict 2026-07-28 server such as python mcp 2.3.0 answers HTTP 400 / -32602 ("params._meta must be an object carrying the required 'io.modelcontextprotocol/protocolVersion' and 'io.modelcontextprotocol/clientCapabilities' envelope keys"). With the envelope present it answers HTTP 404 / -32601. In both cases streamableClientConn.Write treats the non-2xx as fatal and calls c.fail(err), so the whole session is closed. Every later request fails with client is closing: sending "ping": ... Bad Request.
Anything that pings for liveness or keepalive (for example ClientOptions.KeepAlive, or an application health check) therefore kills a healthy session against such servers.
Reproduce
See below.
Expected
On a session with ProtocolVersion >= 2026-07-28, Ping and SetLoggingLevel should not put a removed method on the wire. Returning a client-side error, for example "ping is not supported in protocol 2026-07-28", would let callers fall back. The keepalive loop should likewise not use ping on such sessions. Adding _meta alone would not fix this, because the methods no longer exist and the server answers 404, which also closes the session.
Workaround
Check sess.InitializeResult().ProtocolVersion and, on 2026-07-28 sessions, use a supported request (for example tools/list) for liveness, and skip SetLoggingLevel.
How to reproduce
1. Run a python `mcp` 2.3.0 server (for example FastMCP 4.0.11, `http_app(stateless_http=True)`).
2. Connect with go-sdk: `server/discover` succeeds and `2026-07-28` is negotiated.
3. `sess.ListTools(ctx, nil)` succeeds.
4. `sess.Ping(ctx, nil)` returns `... envelope keys: Bad Request`.
5. `sess.ListTools(ctx, nil)` now returns `connection closed: ... client is closing ...`.
Where did you hit this?
In production at work.
Go MCP SDK version
1.7
Go version
latest
Logs
No logs available.
- Ngôn ngữ chính
- Go
- Star
- 5.3k
- Fork
- 614
- Merge trung bình
- 23 giờ 55 phút
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/go-sdk
-
mcp: typed tool handlers lose wrapped JSON-RPC errorsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/go-sdk#1529 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose generic `SendNotification` on `ServerSession` for custom protocol extensionsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởneeds investigation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/go-sdk#745 · 13 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp: ClientSession.ReadResource keeps uncacheable and expired results until the session endsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
modelcontextprotocol/go-sdk#1526 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp: streamable client keeps the session ID from a rejected server/discover, so the fallback initialize failsCó thể đã có người làm @simon0191 đã nhận 1 ngày trước. Đang mở
modelcontextprotocol/go-sdk#1522 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auth: OAuth client rejects protected resource metadata when the MCP server URL has a query stringCó thể đã có người làm @beiryu đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
modelcontextprotocol/go-sdk#1519 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/go-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
evener-transcript-v2-upgrade tool still scans transcript files through bufio's 4 KiB default bufferĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
prime-radiant-inc/evener#6370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainer thường phản hồi trong vòng 1 ngày