Skip to main content
Version: 1.1.0 (latest)

mcp_icon!

The mcp_icon! macro creates an Icon instance with full attribute support.

use rust_mcp_sdk::mcp_icon;

let icon = mcp_icon!(
src = "https://example.com/icon.png",
mime_type = "image/png",
sizes = ["64x64"],
theme = "dark"
);

// Use in server info
let server_info = InitializeResult {
server_info: Implementation {
icons: vec![icon],
..Default::default()
},
// ...
};

Parametersโ€‹

ParameterRequiredDescription
srcYesIcon URL
mime_typeNoMIME type of the icon
sizesNoArray of size strings (e.g., ["64x64", "128x128"])
themeNo"light" or "dark"