feat: add server/discover with serverInfo in _meta per spec #3002 - #1
Closed
Christian-Sidak wants to merge 1 commit into
Closed
feat: add server/discover with serverInfo in _meta per spec #3002#1Christian-Sidak wants to merge 1 commit into
Christian-Sidak wants to merge 1 commit into
Conversation
…extprotocol#3002 Add DiscoverResult type and server/discover handler aligned with the updated MCP specification (spec PR modelcontextprotocol#3002, merged 2026-07-16), which moves server identity out of a top-level serverInfo field and into the result's _meta under the io.modelcontextprotocol/serverInfo key. - types: add SERVER_INFO_META_KEY constant, DiscoverResult (no direct server_info field), and ServerDiscoverRequest; include both in the ClientRequest and ServerResult union types - Server: register a default server/discover handler that stamps server identity into the result _meta and returns supported protocol versions, capabilities, and instructions - ClientSession: add server_discover() helper method Fixes modelcontextprotocol#3144 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
Aligns the Python SDK with the updated MCP specification (spec PR modelcontextprotocol#3002, merged 2026-07-16), which moves server identity out of a top-level
serverInfofield inDiscoverResultand into the result_metaunder the keyio.modelcontextprotocol/serverInfo.types: addsSERVER_INFO_META_KEYconstant,DiscoverResult(no directserver_infofield -- identity is in_meta), andServerDiscoverRequest; includes both in theClientRequestandServerResultunion typesServer: registers a defaultserver/discoverhandler that stamps server identity into_metaand returns supported protocol versions, current capabilities, and instructionsClientSession: addsserver_discover()helper methodserver/discoverend-to-end; explicitly asserts thatserverInfois in_metaand not a top-level fieldFixes modelcontextprotocol#3144
Test plan
tests/server/lowlevel/test_server_discover.pywith 7 tests covering the full end-to-end flowserver_infois NOT a top-level field onDiscoverResultio.modelcontextprotocol/serverInfois present in_meta