From 4d2f864b88c15945acf09fce9380b87cb0a5d2d9 Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Mon, 9 Feb 2026 15:32:02 -0500 Subject: [PATCH 1/2] feat: add optional description field to Implementation struct --- crates/rmcp/src/model.rs | 7 +++++++ crates/rmcp/tests/test_elicitation.rs | 3 +++ examples/clients/src/streamable_http.rs | 1 + 3 files changed, 11 insertions(+) diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index db6e927e..b73b3ff3 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -834,6 +834,8 @@ pub struct Implementation { pub title: Option, pub version: String, #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub icons: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub website_url: Option, @@ -851,6 +853,7 @@ impl Implementation { name: env!("CARGO_CRATE_NAME").to_owned(), title: None, version: env!("CARGO_PKG_VERSION").to_owned(), + description: None, icons: None, website_url: None, } @@ -2925,6 +2928,7 @@ mod tests { name: "test-server".to_string(), title: Some("Test Server".to_string()), version: "1.0.0".to_string(), + description: Some("A test server for unit testing".to_string()), icons: Some(vec![ Icon { src: "https://example.com/icon.png".to_string(), @@ -2942,6 +2946,7 @@ mod tests { let json = serde_json::to_value(&implementation).unwrap(); assert_eq!(json["name"], "test-server"); + assert_eq!(json["description"], "A test server for unit testing"); assert_eq!(json["websiteUrl"], "https://example.com"); assert!(json["icons"].is_array()); assert_eq!(json["icons"][0]["src"], "https://example.com/icon.png"); @@ -2961,6 +2966,7 @@ mod tests { let implementation: Implementation = serde_json::from_value(old_json).unwrap(); assert_eq!(implementation.name, "legacy-server"); assert_eq!(implementation.version, "0.9.0"); + assert_eq!(implementation.description, None); assert_eq!(implementation.icons, None); assert_eq!(implementation.website_url, None); } @@ -2974,6 +2980,7 @@ mod tests { name: "icon-server".to_string(), title: None, version: "2.0.0".to_string(), + description: None, icons: Some(vec![Icon { src: "https://example.com/server.png".to_string(), mime_type: Some("image/png".to_string()), diff --git a/crates/rmcp/tests/test_elicitation.rs b/crates/rmcp/tests/test_elicitation.rs index 65f21e23..e4779583 100644 --- a/crates/rmcp/tests/test_elicitation.rs +++ b/crates/rmcp/tests/test_elicitation.rs @@ -1064,6 +1064,7 @@ async fn test_initialize_request_with_elicitation() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, @@ -1109,6 +1110,7 @@ async fn test_capability_checking_logic() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, @@ -1130,6 +1132,7 @@ async fn test_capability_checking_logic() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, diff --git a/examples/clients/src/streamable_http.rs b/examples/clients/src/streamable_http.rs index 7af9b5bc..baf1838a 100644 --- a/examples/clients/src/streamable_http.rs +++ b/examples/clients/src/streamable_http.rs @@ -25,6 +25,7 @@ async fn main() -> Result<()> { name: "test sse client".to_string(), title: None, version: "0.0.1".to_string(), + description: None, website_url: None, icons: None, }, From 99b684ff5d6bbcab2602a15ce5ac10b314f7d6e5 Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Mon, 9 Feb 2026 16:32:15 -0500 Subject: [PATCH 2/2] test: update snapshots --- .../test_message_schema/client_json_rpc_message_schema.json | 6 ++++++ .../client_json_rpc_message_schema_current.json | 6 ++++++ .../test_message_schema/server_json_rpc_message_schema.json | 6 ++++++ .../server_json_rpc_message_schema_current.json | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json index c9d7dab0..e4b73a11 100644 --- a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json @@ -701,6 +701,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", diff --git a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json index c9d7dab0..e4b73a11 100644 --- a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json +++ b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json @@ -701,6 +701,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json index 7bd25060..70eeb745 100644 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json @@ -914,6 +914,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json index 7bd25060..70eeb745 100644 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json +++ b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json @@ -914,6 +914,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array",