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
[v2] ping returns 'Method not found' on 2026-07-28 connections: ping missing from CLIENT_REQUESTS for 2026-07-28 in mcp-types #3273
On a server connection negotiated at protocol version 2026-07-28, a client ping request fails with MCPError: Method not found (-32601). The same ping works on handshake-era (2025-11-25 and earlier) connections.
Root cause
mcp_types.methods.CLIENT_REQUESTS (mcp-types 2.0.0) has ping entries for 2024-11-05, 2025-03-26, 2025-06-18, and 2025-11-25 — but no ("ping", "2026-07-28") entry. PingRequest is also absent from the vendored _v2026_07_28 schema module.
validate_client_request does surface[(method, version)], which raises KeyError for ("ping", "2026-07-28"), and the runner converts that to METHOD_NOT_FOUND. So ping is dead on all 2026-07-28 connections even though Server still registers the _ping_handler for the method.
Reproduction
importasynciofrommcp.server.lowlevelimportServerfrommcp.shared.memoryimportcreate_client_server_memory_streamsfrommcp.client.sessionimportClientSessionserver=Server("ping-probe")
asyncdefmain():
asyncwithcreate_client_server_memory_streams() as (client_streams, server_streams):
c_read, c_write=client_streamss_read, s_write=server_streamsasyncwithClientSession(c_read, c_write) assession:
task=asyncio.create_task(
server.run(s_read, s_write, server.create_initialization_options())
)
awaitsession.initialize() # negotiates 2026-07-28 in v2.0.0awaitsession.send_ping() # MCPError: Method not foundtask.cancel()
asyncio.run(main())
(With FastMCP 4.0.0b2, this also breaks fastmcp.Client(...).ping() whenever the client negotiates the modern era — e.g. mode="auto" probing server/discover. Pinning mode="legacy" works around it.)
Expected
Ping is a keepalive primitive; many clients send it on a timer regardless of negotiated version. Either:
add ("ping", "2026-07-28") to CLIENT_REQUESTS with a PingRequest in the 2026 schema (ping is not listed as removed in the 2026-07-28 changelog), or
exempt ping from the per-version surface gate the way the init-exempt methods are handled.
I won't submit a PR for this after validating current main: the 2026-07-28 surface intentionally omits ping, and the existing modern-hosting regression test explicitly expects METHOD_NOT_FOUND for it. Restoring ping would therefore need a protocol/conformance decision rather than the small compatibility fix I expected. Leaving this available pending maintainer direction.
Activity
nightcityblade commentedon Aug 9, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.
nightcityblade commentedon Aug 9, 2026
I won't submit a PR for this after validating current main: the 2026-07-28 surface intentionally omits ping, and the existing modern-hosting regression test explicitly expects METHOD_NOT_FOUND for it. Restoring ping would therefore need a protocol/conformance decision rather than the small compatibility fix I expected. Leaving this available pending maintainer direction.
feat!: port to MCP Python SDK v2 (2026-07-28 protocol revision) (#362)
maxisbey commentedon Aug 20, 2026
closing as this is intended behaviour of the 2026-07-28 MCP spec :)
docs: the ping shim works around a spec decision, not an SDK defect (#…
fix: patch mcp-types ping omission for 2026-07-28 connections