Skip to content

SEP-973: Expose additional metadata for Implementations, Resources, Tools and Prompts #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jesselumarie
Copy link

@jesselumarie jesselumarie commented Jul 11, 2025

Currently, prompts and tool descriptions are often concatenated within a namespace to assure there are no collisions e.g.
image

This change adds an optional Icons argument so that Implementations can identify themselves visually, as well as a websiteUrl for linking to documentation. It also adds icons to Resources, Tools, and Prompts.

This PR consolidates @timrogers PR #417 and my PR #862, taking in feedback from @dsp-ant and @myaroshefsky to allow icons of multiple sizes.

Motivation and Context

While we can encourage MCP clients to only show the tool/prompt name, it makes it difficult to succinctly show in the UI that it's coming from a specified 3rd party source. Adding an icon would allow for better affordances for tool/resource/prompt source identification for users, and the website url can help client self direct to documentation.

How Has This Been Tested?

n/a

Breaking Changes

n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Would love to get this merged in so we can make it a bit easier to highlight where tools/resources are coming from 🙏🏻

/**
* A string that specifies one or more sizes at which the icon file can be used.
* Each size is specified as <width in pixels>x<height in pixels>. If multiple sizes are specified, they are separated by spaces; for example, 48x48 96x96.
* For vector formats like SVG, you can use any to indicate scalability
Copy link
Author

@jesselumarie jesselumarie Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i borrowed heavily from the the web manifest docs here 😅

@timrogers
Copy link
Contributor

@jesselumarie Thanks for taking these changes forward. This looks great to me, and is something I'd love to implement in GitHub Copilot coding agent.

@dsp-ant
Copy link
Member

dsp-ant commented Jul 15, 2025

I would love if this would have an accompanying Specification Enhancement Proposal, that we can then put forward to @modelcontextprotocol/core-maintainers

@dsp-ant dsp-ant added SEP and removed SEP-requested labels Jul 15, 2025
@dsp-ant dsp-ant added this to the DRAFT-XX-XX milestone Jul 15, 2025
@dsp-ant dsp-ant moved this from Draft to Consulting in Standards Track Jul 15, 2025
@dsp-ant dsp-ant changed the title Expose additional metadata for Implementations SEP-002: Expose additional metadata for Implementations Jul 15, 2025
@dsp-ant dsp-ant added the draft SEP proposal with a sponsor. label Jul 15, 2025
@jesselumarie jesselumarie requested a review from a team as a code owner July 17, 2025 20:32
Comment on lines 317 to 332
/**
* An optional URL of the website for this implementation.
*
* @format: uri
*/
websiteUrl?: string;

/**
* An optional list of icons for this implementation.
* This can be used by clients to display the implementation in a user interface.
* Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
* The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
* The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
* The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
*/
icons?: Icon[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now there are many types that extend BaseMetadata:

I think websiteUrl is probably only appropriate for Implementation, and icons is probably only appropriate for Implementation + primitives (i.e. not PromptArgument nor PromptReference).

Also, websiteUrl will probably be covered by the upcoming server.json file. (See also modelcontextprotocol/registry#183.)

One alternative would be to create a dedicated Icons interface, and make the relevant types extend that interface.

Another alternative would be to add a new base type like SupremeDeluxeBaseMetadata that itself extends BaseMetadata and adds icons.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth separating these out.

i'm happy to exclude websiteUrl from arguments/templates (I agree it doesn't make sense under PromptArgument or PromptReference).

The one nice thing about having URLs on all of these is you could potentially have deep links to sections for specific documentation e.g. link to a tool's docs. Right now the UI can get crowded with tool argument descriptions:
image

sizes?: string;
}

export type Icon = UrlIcon | DataIcon;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unconvinced a separate icon type between URL or data icons is useful. A data URI is an entirely valid URL and it's easy to distinguish the two by looking at the scheme. Do we see the types here diverging further?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to what @connor4312 suggested - it feels like this can be simplified.

* A standard URI pointing to an icon resource.
* @format uri
*/
src: string;
Copy link
Contributor

@connor4312 connor4312 Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Displaying arbitrary URLs is kind of annoying for web-based applications. Best practice to avoid leaking user IP's is to proxy an image through a proxy which is some work to set up and maintain, and is required for web applications using strict Content-Security-Policies

Creative idea: I wonder if we could say the URI here is an MCP resource URI and can be requested as such. That would also solve a potential difficulty where people would otherwise use data URIs reused between multiple prompts/types of data

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice to avoid leaking user IP's is to proxy an image through a proxy which is some work to set up and maintain, and is required for web applications using strict Content-Security-Policies

^ for this concern, couldn't folks use base64? I think putting it as a MCP resource URI is too prescriptive (and it's also something that is technically possible today https://modelcontextprotocol.io/specification/2025-06-18/server/resources#https%3A%2F%2F)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely, but this is a concern for client implementors and server implementors might not consider that when building their servers.

I don't have much better ideas here honestly aside from saying it can only be data URLs which is unpleasant 😕 One thing we could at least say is that, for streamable HTTP servers, the URL SHOULD be on the same origin as the server itself. For stdio servers we don't get though since a client doesn't know the path to the server entrypoint, just a command.

Maybe someone else will come along with more inspiration.

Copy link
Author

@jesselumarie jesselumarie Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for streamable HTTP servers, the URL SHOULD be on the same origin as the server itself

^^ added this as part of the Icon type definition!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jesselumarie in this context, should the URL be relative? That way we can make sure that the construction is always done against the origin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one other annoying thing we'll have to look out for is XSS:
e.g. a URL like: javascript:alert('XSS');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this as part of the Icon type definition!

I think I'm happy enough with this solution, we can resolve this comment :)

@jesselumarie jesselumarie changed the title SEP-002: Expose additional metadata for Implementations SEP-002: Expose additional metadata for Implementations, Resources, Tools and Prompts Jul 23, 2025
@dsp-ant dsp-ant changed the title SEP-002: Expose additional metadata for Implementations, Resources, Tools and Prompts SEP-973: Expose additional metadata for Implementations, Resources, Tools and Prompts Jul 24, 2025
@tadasant tadasant mentioned this pull request Jul 25, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft SEP proposal with a sponsor. SEP
Projects
Status: Consulting
Development

Successfully merging this pull request may close these issues.

SEP-973: Expose additional metadata for Implementations, Resources, Tools and Prompts
7 participants