fix!: remove server_info from DiscoverResult (#1065)

Fixes https://github.com/modelcontextprotocol/rust-sdk/issues/1064
Replaces https://github.com/modelcontextprotocol/rust-sdk/pull/1044

This removes the `server_info` field which is not part of the spec:
 https://modelcontextprotocol.io/specification/draft/schema#discoverresult.
This commit is contained in:
John Howard 2026-07-28 14:55:40 -05:00 • committed by GitHub
commit 9a41811a66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,6 +121,13 @@ mod tests {
let schema = settings
.into_generator()
.into_root_schema_for::<ServerJsonRpcMessage>();
let schema_value =
serde_json::to_value(&schema).expect("Failed to serialize server schema");
let discover_result = &schema_value["definitions"]["DiscoverResult"];
assert!(
discover_result["properties"].get("serverInfo").is_none(),
"DiscoverResult serverInfo belongs in namespaced _meta"
);
let schema_str = serde_json::to_string_pretty(&schema).expect("Failed to serialize schema");
compare_schemas(