-
Notifications
You must be signed in to change notification settings - Fork 545
Description
Add Icon Support to Implementation (ServerInfo)
Summary
Request to add icon support to the C# SDK's Implementation
class to match the MCP specification and bring feature parity with other official SDKs (TypeScript, Python).
Problem
Currently, the C# SDK's Implementation
class only supports Name
and Version
properties. When MCP servers are displayed in clients like Claude Desktop, they show default or technology-based icons (e.g., Microsoft logo for .NET servers) instead of custom branding.
Background
Icon support was added to the MCP specification via Issue #973 and is already implemented in:
- TypeScript SDK: ✅ Implemented
- Python SDK: ✅ Implemented
- C# SDK: ❌ Not yet implemented
Proposed Solution
Add optional Icons
and WebsiteUrl
properties to the Implementation
class to match the spec.
Expected API
public class Implementation
{
public required string Name { get; init; }
public required string Version { get; init; }
public Icon[]? Icons { get; init; } // NEW
public string? WebsiteUrl { get; init; } // NEW
}
public class Icon
{
public required string Src { get; init; } // URL or data URI
public string? MimeType { get; init; }
public string[]? Sizes { get; init; } // e.g., ["48x48", "96x96", "any"]
}
Usage Example
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithToolsFromAssembly()
.WithServerInfo(new Implementation
{
Name = "MCP Server Name",
Version = "1.0.0",
Icons = new[]
{
new Icon
{
Src = "https://example.com/logo.png",
MimeType = "image/png",
Sizes = new[] { "64x64" }
}
},
WebsiteUrl = "https://example.com/docs"
});
TypeScript SDK Reference
The TypeScript SDK implementation can be found at:
https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/types.ts
export const IconSchema = z.object({
src: z.string(),
mimeType: z.optional(z.string()),
sizes: z.optional(z.array(z.string()))
}).passthrough();
export const ImplementationSchema = BaseMetadataSchema.extend({
version: z.string(),
websiteUrl: z.optional(z.string())
}).merge(IconsSchema);
export const IconsSchema = z.object({
icons: z.array(IconSchema).optional()
}).passthrough();
Benefits
- Visual Identity: Servers can display custom branding in MCP clients
- Better UX: Users can quickly identify tools by their icons
- Feature Parity: Aligns C# SDK with TypeScript and Python SDKs
- Spec Compliance: Implements the full MCP specification
Use Case
We're building an enterprise MCP server for our organization. Currently, Claude Desktop displays the Microsoft logo for our .NET-based server. We'd like to display our company logo instead to help users visually identify our organizational tools.
Additional Context
- MCP Specification Issue: SEP-973: Expose additional metadata for Implementations, Resources, Tools and Prompts modelcontextprotocol#973
- Current C# SDK Version: 0.4.0-preview.2
- Icon formats should support: PNG, JPEG, SVG, WebP
- Icons can be URLs or base64 data URIs
Willing to Contribute
I'm interested in contributing a PR for this feature if the maintainers are open to it.