Skip to content

server/discover, answered without a handshake (#105) - #123

Merged
TGoodhew merged 1 commit into
mainfrom
issue-105-server-discover
Jul 31, 2026
Merged

server/discover, answered without a handshake (#105)#123
TGoodhew merged 1 commit into
mainfrom
issue-105-server-discover

Conversation

@TGoodhew

Copy link
Copy Markdown
Owner

Closes #105.

2026-07-28 makes server/discover a 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

Two deliberate calls

supportedVersions does 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

  • 7 new tests — the version list (and that the new revision stays out of it); capabilities/identity/instructions; discover vs initialize compared directly; the cache hints; no handshake and no params needed; resultType for 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.
  • Full suite green: 372 GpibMcp + 113 Hpgl, 0 failures (Release|x86) — was 365 + 113.

README: "Protocol revisions" now covers discover.

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.
@TGoodhew
TGoodhew merged commit 1e14949 into main Jul 31, 2026
1 check passed
@TGoodhew
TGoodhew deleted the issue-105-server-discover branch July 31, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP 2026-07-28: implement the required server/discover RPC

1 participant