Skip to content

feat: add server/discover with serverInfo in _meta per spec #3002 - #1

Closed
Christian-Sidak wants to merge 1 commit into
mainfrom
fix/issue-3144
Closed

feat: add server/discover with serverInfo in _meta per spec #3002#1
Christian-Sidak wants to merge 1 commit into
mainfrom
fix/issue-3144

Conversation

@Christian-Sidak

Copy link
Copy Markdown
Owner

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 serverInfo field in DiscoverResult and into the result _meta under the key io.modelcontextprotocol/serverInfo.

  • types: adds SERVER_INFO_META_KEY constant, DiscoverResult (no direct server_info field -- identity is in _meta), and ServerDiscoverRequest; includes both in the ClientRequest and ServerResult union types
  • Server: registers a default server/discover handler that stamps server identity into _meta and returns supported protocol versions, current capabilities, and instructions
  • ClientSession: adds server_discover() helper method
  • Tests: covers server/discover end-to-end; explicitly asserts that serverInfo is in _meta and not a top-level field

Fixes modelcontextprotocol#3144

Test plan

  • New tests/server/lowlevel/test_server_discover.py with 7 tests covering the full end-to-end flow
  • Explicitly asserts server_info is NOT a top-level field on DiscoverResult
  • Asserts io.modelcontextprotocol/serverInfo is present in _meta
  • All 1141 existing tests still pass

…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>
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.

serverInfo should be within Meta instead of serverDiscover result

1 participant