Skip to content

fix: remove server_info from DiscoverResult - #1065

Open
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:modern/server-info
Open

fix: remove server_info from DiscoverResult#1065
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:modern/server-info

Conversation

@howardjohn

Copy link
Copy Markdown
Contributor

Motivation and Context

Fixes #1064

Replaces #1044

This removes the server_info field which is not part of the spec:
https://modelcontextprotocol.io/specification/draft/schema#discoverresult.

1044 add a synthetic server_info field; this PR removes it. This aligns with other types in this repo (using _meta as the source of truth, not a projection) and with other SDKS (Go and TypeScript do not have a server_info) field. Instead, users can use the helper accessors.

How Has This Been Tested?

Tested proxying to copilot MCP

Breaking Changes

Breaking from beta3 - the server_info field is removed

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@howardjohn
howardjohn requested a review from a team as a code owner July 27, 2026 23:15
@github-actions github-actions Bot added T-test Testing related changes T-config Configuration file changes T-core Core library changes T-service Service layer changes labels Jul 27, 2026
@howardjohn
howardjohn force-pushed the modern/server-info branch from 7c53e17 to 6b9c7b5 Compare July 27, 2026 23:17

@tsarlandie-oai tsarlandie-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving serverInfo into _meta for serialization makes sense, but clients must remain able to consume legacy top-level serverInfo, and must not fail when server identity is absent: the specification makes this metadata optional. The current MissingServerInfo path already causes 15 client conformance failures and bypasses the conservative fallback in #1045. We should preserve the legacy deserialization test, emit only the modern representation, and accept both representations on input.


#[test]
fn discover_result_prefers_top_level_server_info_over_namespaced_metadata() {
fn discover_result_ignores_legacy_top_level_server_info() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not change this test. I think it's a useful test to make sure we remain compatible with legacy servers.

@howardjohn
howardjohn force-pushed the modern/server-info branch from 6b9c7b5 to b68d366 Compare July 28, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-service Service layer changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiscoverResult contains invalid server_info field

2 participants