Implement SEP-973: Icons and metadata support for Implementations, Resources, Tools, and Prompts#802
Merged
MackinnonBuck merged 24 commits intomainfrom Oct 8, 2025
Merged
Implement SEP-973: Icons and metadata support for Implementations, Resources, Tools, and Prompts#802MackinnonBuck merged 24 commits intomainfrom
MackinnonBuck merged 24 commits intomainfrom
Conversation
Contributor
Author
|
@MackinnonBuck 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
… Resource, Tool, and Prompt Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
…onsistency Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement SEP-973: Icons and metadata support
Implement SEP-973: Icons and metadata support for Implementations, Resources, Tools, and Prompts
Sep 19, 2025
tests/ModelContextProtocol.Tests/Protocol/ImplementationTests.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.Tests/Protocol/ResourceAndPromptIconTests.cs
Outdated
Show resolved
Hide resolved
…files Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
stephentoub
reviewed
Sep 23, 2025
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
jozkee
reviewed
Oct 7, 2025
src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.Tests/Configuration/McpServerBuilderExtensionsToolsTests.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.Tests/Server/McpServerPromptTests.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.Tests/Server/McpServerPromptTests.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.Tests/Server/McpServerPromptTests.cs
Outdated
Show resolved
Hide resolved
…est patterns Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
jozkee
approved these changes
Oct 7, 2025
Collaborator
|
The test failure seems unrelated and non-deterministic since it only failed in macOS release: |
This was referenced Oct 20, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SEP-973: Icons and metadata support implementation
This PR implements SEP-973 which adds support for icons and additional metadata for Implementations, Resources, Tools, and Prompts.
Implementation Plan
Recent Changes (Addressing Latest Code Review Feedback)
Themeproperty toIconclass per specification update (PR #1584)Assert.Single()pattern for cleaner, more idiomatic testsAIFunctionMcpServerToolicon handling consistent with Prompt and Resource patternsTitleAttributeProperty_PropagatedToTitleandIconSourceAttributeProperty_PropagatedToIconstests into singleAttributeProperties_PropagatedtestsKey Changes Implemented
1. New Icon Class (
Icon.cs)Sourceproperty for URI pointing to icon resource (serialized as "src" in JSON)MimeType,Sizes, andThemepropertiesIList<string>?to support multiple size specifications (e.g.,["48x48", "96x96"])string?to specify UI theme ("light", "dark", or custom identifiers)Sourceproperty2. Enhanced Classes with Icon Support
IconsandWebsiteUrlpropertiesIconspropertyIconspropertyIconspropertyIconsproperty3. Server-Side Tooling Integration
Tools:
Iconsproperty for programmatic multi-icon configurationIconSourceproperty for simple attribute-based single-icon configurationPrompts:
Iconsproperty for programmatic multi-icon configurationIconSourceproperty for simple attribute-based single-icon configurationResources:
Iconsproperty for programmatic multi-icon configurationIconSourceproperty for simple attribute-based single-icon configurationCommon Features:
4. Specification Compliance
✅ Matches TypeScript schema exactly
✅ Correct JSON property names (
icons,websiteUrl,src,mimeType,sizes,theme)✅ All new properties are optional for backward compatibility
✅ Supports multiple icons per entity
✅ Supports multiple size specifications per icon (as string array)
✅ Supports theme specification per icon (light, dark, or custom)
✅ Documents required (PNG, JPEG) and recommended (SVG, WebP) MIME types
✅ Includes security considerations for SVG and URI validation
✅ Uses .NET naming conventions while preserving JSON compatibility
5. Comprehensive Test Coverage
IconTests.cs: Icon serialization, round-trip validation, JsonException tests, and Theme property validationImplementationTests.cs: Full Implementation testing with required property validationToolTests.cs: Tool functionality testing including new icon supportResourceTests.cs: Resource serialization and property validationPromptTests.cs: Prompt functionality testingMcpServerToolTests.cs: Server-side Tool icon support using idiomatic test patternsMcpServerPromptTests.cs: Server-side Prompt icon support via options and attributesMcpServerResourceTests.cs: Server-side Resource icon support via options and attributesMcpServerBuilderExtensionsToolsTests: Client-server test verifying tool icons retrieval and attribute propagationMcpServerBuilderExtensionsPromptsTests: Client-server test verifying prompt icons retrieval and attribute propagationMcpServerBuilderExtensionsResourcesTests: Client-server test verifying resource and resource template icons retrieval and attribute propagationMcpClientTests: Verifies server Implementation icons with Theme values and WebsiteUrlAssert.Single()pattern for cleaner assertionsUsage Examples
Simple Attribute-Based Icon Configuration:
For Tools:
For Prompts:
For Resources:
Advanced Multi-Icon Configuration with Theme:
Server Implementation with Icons and WebsiteUrl:
Technical Details
IList<Icon>?for consistency with existing collection patternsIList<string>?forIcon.Sizesto support multiple size specifications per the updated specstring?forIcon.Themeto support theme identifiersJsonPropertyNameattributesSecurity Features
Implementation includes documentation for:
Note: Build validation requires .NET 9 SDK. The implementation follows established patterns and should compile correctly with the appropriate SDK version.
Fixes #753.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.