Skip to content

Conversation

@kakooch
Copy link

@kakooch kakooch commented Dec 1, 2025

Summary

This PR implements SEP-973 by adding icon support to MCP schema types, enabling clients to visually identify servers, tools, resources, and prompts.

Changes

  • New Icon record with src, mimeType, and sizes fields
  • Implementation: Added icons and websiteUrl fields
  • Tool: Added icons field and updated Builder
  • Resource: Added icons field and updated Builder
  • Prompt: Added icons field

Icon Type Details

The Icon record supports:

  • HTTP/HTTPS URLs for remote icons
  • Data URIs for embedded base64-encoded icons (e.g., data:image/png;base64,...)
  • Multiple sizes following Web Manifest format (e.g., "48x48", "48x48 96x96", "any")
  • Common image MIME types (image/png, image/svg+xml, image/x-icon, etc.)

Example Usage

// Server implementation with icons
var implementation = new Implementation(
    "my-server",
    "My Server",
    "1.0.0",
    List.of(
        new Icon("https://example.com/icon-48.png", "image/png", "48x48"),
        new Icon("https://example.com/icon.svg", "image/svg+xml", "any")
    ),
    "https://example.com"
);

// Tool with icon
var tool = Tool.builder()
    .name("search")
    .description("Search the web")
    .icons(List.of(new Icon("https://example.com/search-icon.png")))
    .build();

Backward Compatibility

All existing constructors remain functional and pass null for the new optional fields. This ensures a seamless upgrade path for existing implementations.

Test Plan

  • Build compiles successfully
  • Spring Java format validation passes
  • Unit tests for Icon record validation
  • Serialization/deserialization tests for new fields

Related

🤖 Generated with Claude Code

This commit implements SEP-973 by adding icon support to MCP schema types,
enabling clients to visually identify servers, tools, resources, and prompts.

Changes:
- Add new Icon record with src, mimeType, and sizes fields
- Add icons and websiteUrl fields to Implementation
- Add icons field to Tool, Resource, and Prompt records
- Update Builder classes to support new fields
- Maintain backward compatibility with existing constructors

The Icon type supports:
- HTTP/HTTPS URLs for remote icons
- Data URIs for embedded base64-encoded icons
- Multiple sizes following Web Manifest format (e.g., "48x48", "any")
- Common image MIME types (image/png, image/svg+xml, etc.)

Resolves: modelcontextprotocol#532

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SEP-973: Icons and metadata support

1 participant