server/discover, answered without a handshake (#105) - #123
Merged
Conversation
2026-07-28 makes server/discover a MUST: one request returns the protocol versions a server speaks, what it can do, and who it is - and on stdio it is also how a client tells a modern server from a legacy one, since there is no HTTP status code to drive the fallback. So it is served whatever revision the caller is on, params or not. supportedVersions is the honest set: 2025-06-18, 2025-03-26, 2024-11-05. Implementing the method that a revision introduced is not a claim to the revision - we do not implement all of 2026-07-28, so it does not appear, and it joins the list when the code earns it (#104s rule). A test asserts that. initialize and discover now share one capability builder. They are two answers to the same question and a client is entitled to the same picture from either; a test compares them directly so they cannot drift. New CacheableResult carries the ttlMs/cacheScope hints SEP-2549 adds. Both values are deliberate: an hour, because the tool registry and capability set are built once at start-up and cannot change without a restart, but bounded so a client outliving a restart re-reads eventually; and "private", because the scope exists for servers with many users and one answer, while this one has a single user by construction and its answers describe that persons instruments - and the only case where an intermediary could cache at all, the HTTP transport behind a tunnel, is exactly where you would not want one to. 7 tests, including that an unknown method still returns a clean -32601: that is the documented signal a client falls back on.
12 tasks
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.
Closes #105.
2026-07-28 makes
server/discovera MUST: one request returns the protocol versions a server speaks, its capabilities and its identity. On stdio it is also the backward-compatibility probe — there is no HTTP status code to drive the fallback — so it is served whatever revision the caller is on, with or without params.Change
server/discoverreturnssupportedVersions,capabilities,instructions, and the identity in_meta(where MCP 2026-07-28: stateless dispatch - per-request_metacontext andserverInfoin results #106 already puts it on every result), plus the caching hints.initializeanddiscovernow share one capability builder. They are two answers to the same question; a test compares them withDeepEqualsso they cannot drift.CacheableResultholds thettlMs/cacheScopehints SEP-2549 adds. This is the piece MCP 2026-07-28:tools/listmust returnttlMs/cacheScopeand a deterministic order #108 will reuse fortools/list.Two deliberate calls
supportedVersionsdoes not include 2026-07-28. Implementing the method a revision introduced is not a claim to the revision — we don't implement all of it. It joins the list when the code earns it, which is the rule #104 set up, and there's a test asserting it stays out until then.The cache values. An hour, because the tool registry and capability set are built once at start-up and cannot change without a restart — but bounded rather than infinite, so a client outliving a restart re-reads eventually.
"private", because the scope exists for servers with many users and one answer; this one has a single user by construction (one bench, one bus) and its answers describe that person's instruments. The only case where an intermediary could cache at all — the HTTP transport behind a tunnel — is exactly where you would not want one to.Verification
resultTypefor a caller on the new revision; and that an unknown method still returns a clean-32601, since that is the documented signal a client falls back on.README: "Protocol revisions" now covers discover.