Skip to content

Add Icon Support to Implementation (ServerInfo) #850

@aka-bk

Description

@aka-bk

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

  1. Visual Identity: Servers can display custom branding in MCP clients
  2. Better UX: Users can quickly identify tools by their icons
  3. Feature Parity: Aligns C# SDK with TypeScript and Python SDKs
  4. 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

Willing to Contribute

I'm interested in contributing a PR for this feature if the maintainers are open to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions