Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/rmcp/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,8 @@ pub struct Implementation {
pub title: Option<String>,
pub version: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icons: Option<Vec<Icon>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website_url: Option<String>,
Expand All @@ -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,
}
Expand Down Expand Up @@ -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(),
Expand All @@ -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");
Expand All @@ -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);
}
Expand All @@ -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()),
Expand Down
3 changes: 3 additions & 0 deletions crates/rmcp/tests/test_elicitation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,12 @@
"Implementation": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"type": [
"array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,12 @@
"Implementation": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"type": [
"array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,12 @@
"Implementation": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"type": [
"array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,12 @@
"Implementation": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"type": [
"array",
Expand Down
1 change: 1 addition & 0 deletions examples/clients/src/streamable_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down