-
Notifications
You must be signed in to change notification settings - Fork 871
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
base: main
Are you sure you want to change the base?
SEP-973: Expose additional metadata for Implementations, Resources, Tools and Prompts #955
Conversation
schema/draft/schema.ts
Outdated
/** | ||
* 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 |
There was a problem hiding this comment.
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 😅
@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. |
I would love if this would have an accompanying Specification Enhancement Proposal, that we can then put forward to @modelcontextprotocol/core-maintainers |
schema/draft/schema.ts
Outdated
/** | ||
* 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[]; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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:
schema/draft/schema.ts
Outdated
sizes?: string; | ||
} | ||
|
||
export type Icon = UrlIcon | DataIcon; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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');
There was a problem hiding this comment.
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 :)
Currently, prompts and tool descriptions are often concatenated within a namespace to assure there are no collisions e.g.

This change adds an optional
Icons
argument so that Implementations can identify themselves visually, as well as awebsiteUrl
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
Checklist
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 🙏🏻