From 699e35d99d9cff5737f61426eac7df3bbc2fc637 Mon Sep 17 00:00:00 2001 From: Mike Kistler Date: Sun, 14 Dec 2025 10:25:53 -0600 Subject: [PATCH 1/2] Add examples of icons on tools, resources, and prompts --- samples/EverythingServer/Program.cs | 32 +++++++++++++++++++ .../Prompts/SimplePromptType.cs | 2 +- .../Resources/SimpleResourceType.cs | 2 +- samples/EverythingServer/Tools/AddTool.cs | 2 +- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/samples/EverythingServer/Program.cs b/samples/EverythingServer/Program.cs index 86e46ec6b..4cea85852 100644 --- a/samples/EverythingServer/Program.cs +++ b/samples/EverythingServer/Program.cs @@ -58,6 +58,38 @@ .WithTools() .WithTools() .WithTools() + .WithTools([ + // A tool with multiple complex icons demonstrating different themes, sizes, and MIME types + McpServerTool.Create( + WeatherTool.GetWeather, + new McpServerToolCreateOptions + { + Name = "get_weather", + Title = "Get Weather Information", + Icons = [ + new Icon + { + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Sun/Flat/sun_flat.svg", + MimeType = "image/svg+xml", + Sizes = ["any"], + Theme = "light" + }, + new Icon + { + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Sun/Flat/sun_flat.svg", + MimeType = "image/svg+xml", + Sizes = ["any"], + Theme = "dark" + }, + new Icon + { + Source = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==", + MimeType = "image/png", + Sizes = ["16x16", "32x32"] + } + ] + }) + ]) .WithPrompts() .WithPrompts() .WithResources() diff --git a/samples/EverythingServer/Prompts/SimplePromptType.cs b/samples/EverythingServer/Prompts/SimplePromptType.cs index d6ba51a33..84a4c7bc4 100644 --- a/samples/EverythingServer/Prompts/SimplePromptType.cs +++ b/samples/EverythingServer/Prompts/SimplePromptType.cs @@ -6,6 +6,6 @@ namespace EverythingServer.Prompts; [McpServerPromptType] public class SimplePromptType { - [McpServerPrompt(Name = "simple_prompt"), Description("A prompt without arguments")] + [McpServerPrompt(Name = "simple_prompt", IconSource = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Light%20bulb/Flat/light_bulb_flat.svg"), Description("A prompt without arguments")] public static string SimplePrompt() => "This is a simple prompt without arguments"; } diff --git a/samples/EverythingServer/Resources/SimpleResourceType.cs b/samples/EverythingServer/Resources/SimpleResourceType.cs index da185425f..7c770de95 100644 --- a/samples/EverythingServer/Resources/SimpleResourceType.cs +++ b/samples/EverythingServer/Resources/SimpleResourceType.cs @@ -7,7 +7,7 @@ namespace EverythingServer.Resources; [McpServerResourceType] public class SimpleResourceType { - [McpServerResource(UriTemplate = "test://direct/text/resource", Name = "Direct Text Resource", MimeType = "text/plain")] + [McpServerResource(UriTemplate = "test://direct/text/resource", Name = "Direct Text Resource", MimeType = "text/plain", IconSource = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Memo/Flat/memo_flat.svg")] [Description("A direct text resource")] public static string DirectTextResource() => "This is a direct resource"; diff --git a/samples/EverythingServer/Tools/AddTool.cs b/samples/EverythingServer/Tools/AddTool.cs index ccaa306d6..f55303c6a 100644 --- a/samples/EverythingServer/Tools/AddTool.cs +++ b/samples/EverythingServer/Tools/AddTool.cs @@ -6,6 +6,6 @@ namespace EverythingServer.Tools; [McpServerToolType] public class AddTool { - [McpServerTool(Name = "add"), Description("Adds two numbers.")] + [McpServerTool(Name = "add", IconSource = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Plus/Flat/plus_flat.svg"), Description("Adds two numbers.")] public static string Add(int a, int b) => $"The sum of {a} and {b} is {a + b}"; } From 302e010fbb5fa3dcfea3e3ac026f30550bbc188a Mon Sep 17 00:00:00 2001 From: Mike Kistler Date: Sun, 14 Dec 2025 10:33:40 -0600 Subject: [PATCH 2/2] Add server implementation with icons and metadata --- samples/EverythingServer/Program.cs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/samples/EverythingServer/Program.cs b/samples/EverythingServer/Program.cs index 4cea85852..d4b474093 100644 --- a/samples/EverythingServer/Program.cs +++ b/samples/EverythingServer/Program.cs @@ -21,7 +21,33 @@ ConcurrentDictionary> subscriptions = new(); builder.Services - .AddMcpServer() + .AddMcpServer(options => + { + // Configure server implementation details with icons and website + options.ServerInfo = new Implementation + { + Name = "Everything Server", + Version = "1.0.0", + Title = "MCP Everything Server", + Description = "A comprehensive MCP server demonstrating tools, prompts, resources, sampling, and all MCP features", + WebsiteUrl = "https://github.com/modelcontextprotocol/csharp-sdk", + Icons = [ + new Icon + { + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Gear/Flat/gear_flat.svg", + MimeType = "image/svg+xml", + Sizes = ["any"], + Theme = "light" + }, + new Icon + { + Source = "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Gear/3D/gear_3d.png", + MimeType = "image/png", + Sizes = ["256x256"] + } + ] + }; + }) .WithHttpTransport(options => { // Add a RunSessionHandler to remove all subscriptions for the session when it ends