Repository navigation
mcp: reject ping and logging/setLevel on 2026-07-28 session - #1537
Merged
guglielmo-san merged 3 commits intoNov 20, 2026
Merged
Conversation
nahapetyan-serob
requested review from
guglielmo-san
and
a balanced review from Copilot
November 20, 2026 12:27
There was a problem hiding this comment.
🟡 Changes recommended
The new protocol check reads initialization state without synchronization, creating a critical data race with Connect that must be fixed without blocking pre-initialization ping responses.
What changed in this PR
Updates the MCP SDK to reject methods removed in protocol 2026-07-28, while preserving behavior for older sessions.
Changes:
- Rejects outgoing server pings, incoming client pings, and client
SetLoggingLevelcalls on new-protocol sessions. - Adds regression tests and pins legacy logging and keepalive tests to protocol
2025-11-25. - Documents removed methods and per-request logging configuration.
| File | Description |
|---|---|
mcp/server.go |
Rejects server-initiated pings on new-protocol sessions. |
mcp/server_test.go |
Tests local rejection of server pings. |
mcp/server_lifecycle_log_test.go |
Uses a legacy session for lifecycle logging tests. |
mcp/server_example_test.go |
Pins the logging example to a legacy protocol. |
mcp/mcp_test.go |
Keeps legacy-dependent tests on the older protocol. |
mcp/logging_test.go |
Uses a legacy session for logging-level tests. |
mcp/client.go |
Rejects incoming pings and local logging-level changes on new sessions. |
mcp/client_test.go |
Tests client-side rejection of removed methods. |
internal/docs/server.src.md |
Documents per-request log levels and legacy restrictions. |
internal/docs/protocol.src.md |
Documents rejection of incoming pings. |
docs/server.md |
Updates generated logging guidance and example. |
docs/protocol.md |
Updates generated ping guidance. |
Review effort: Balanced
guglielmo-san
approved these changes
Nov 20, 2026
guglielmo-san
deleted the
serob/remove-ping-and-setLevel-on-new-protocol
branch
November 20, 2026 16:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

SEP-2575 removes
ping(in both directions) andlogging/setLevelin protocol version 2026-07-28. On new-protocol sessions:ping
ClientSession.PingreturnsCodeMethodNotFoundlocally, and the server rejects an incomingping.ServerSession.PingreturnsCodeMethodNotFoundlocally.pingwithCodeMethodNotFound.logging/setLevel
logging/setLevel.ClientSession.SetLoggingLevelreturnsCodeMethodNotFoundlocally instead of sending the request. Docs now point toMetaKeyLogLevelfor per-request log levels.Behavior on older protocol versions is unchanged.
Fixes #1518