Fix fast-time-server modern wire shape for mcp SDK 2.0.0b2 interop - #12
Merged
Conversation
mcp_types 2.0.0b2 (v2026_07_28 wire models) marks serverInfo, cacheScope, and ttlMs as required top-level DiscoverResult fields, and cacheScope/ttlMs as required on every CacheableResult list response. The modern server/discover response now carries top-level serverInfo and cacheScope/ttlMs (the _meta serverInfo entry is kept per the spec text), and modern tools/list results include cacheScope "private" and ttlMs 0, matching the SDK's conservative defaults. Verified end-to-end with mcp==2.0.0b2: auto and pinned 2026-07-28 modes now complete list_tools and tools/call against a strict server; legacy mode fails cleanly with the intended strict -32602 rejection. Fixes #11. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Jonathan Springer <jps@s390x.com>
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.
Summary
Fixes #11. The strict
2026-07-28mode was not interoperable withmcp==2.0.0b2(mcp_types/v2026_07_28wire models) in any negotiation mode, due to two wire-shape gaps in modern responses:server/discover:serverInfowas nested under_metaonly, butDiscoverResultrequires it as a top-level field. The unparseable discover result madeautomode fall back to legacyinitialize, which strict mode then rejected — soautocould not connect at all.tools/list:CacheableResultrequirescacheScopeandttlMson the wire (no defaults), and the server emitted neither, so pinned2026-07-28mode failed validation onlist_tools.Changes
server/discoverresult now includes top-level"serverInfo": {"name", "version"},"cacheScope": "private", and"ttlMs": 0. The_meta["io.modelcontextprotocol/serverInfo"]entry is kept, since the spec text marks it SHOULD.tools/listresults now include"cacheScope": "private"and"ttlMs": 0— the SDK's own conservative defaults (immediately stale, no shared caching).2025-11-25) responses are untouched;tools/callalready satisfiedCallToolResult(onlyresultType+contentrequired).Field requirements were confirmed against the installed
mcp-types 2.0.0b2models (v2026_07_28.DiscoverResult,.CacheableResult,.ListToolsResult), not just the issue text.Verification
cargo test: 36/36 passing (new assertions lock top-levelserverInfo/cacheScope/ttlMson discover andcacheScope/ttlMson moderntools/list)cargo clippy --all-targets: cleanmcp==2.0.0b2against a live--protocol 2026-07-28 --strictserver):autoserverInfovalidation → legacy fallback →-32602)echoround-trip2026-07-28pincacheScope/ttlMsrequired)echoround-triplegacyMCPError: Unsupported protocol version— the intended strict-mode rejection