-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changes from all commits
7109710
47a0395
60438f9
bfd102c
5cb335b
dbdea15
24d190a
5e4eecd
4c68a70
8f79588
6df974b
7569f2d
57c01e8
e039be1
068d6bb
5eb9b0a
138c82a
5ad28b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,3 +147,54 @@ may reserve particular names for purpose-specific metadata, as declared in those | |
|
|
||
| - Unless empty, MUST begin and end with an alphanumeric character (`[a-z0-9A-Z]`). | ||
| - MAY contain hyphens (`-`), underscores (`_`), dots (`.`), and alphanumerics in between. | ||
|
|
||
| #### `icons` | ||
|
|
||
| The `icons` property provides a standardized way for servers to expose visual identifiers for their resources, tools, prompts, and implementations. Icons enhance user interfaces by providing visual context and improving the discoverability of available functionality. | ||
|
|
||
| Icons are represented as an array of `Icon` objects, where each icon includes: | ||
|
|
||
| - `src`: A URI pointing to the icon resource (required). This can be: | ||
| - An HTTP/HTTPS URL pointing to an image file | ||
| - A data URI with base64-encoded image data | ||
| - `mimeType`: Optional MIME type if the server's type is missing or generic | ||
| - `sizes`: Optional size specification (e.g., "48x48", "any" for scalable formats like SVG, or "48x48 96x96" for multiple sizes) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be |
||
|
|
||
| **Required MIME type support:** | ||
|
|
||
| Clients that support rendering icons **MUST** support at least the following MIME types: | ||
|
|
||
| - `image/png` - PNG images (safe, universal compatibility) | ||
| - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) | ||
|
|
||
| Clients that support rendering icons **SHOULD** also support: | ||
|
|
||
| - `image/svg+xml` - SVG images (scalable but requires security precautions as noted below) | ||
| - `image/webp` - WebP images (modern, efficient format) | ||
|
|
||
| **Security considerations:** | ||
|
|
||
dsp-ant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Consumers of icon metadata **MUST** take appropriate security precautions when handling icons to prevent compromise: | ||
|
|
||
| - Treat icon metadata and icon bytes as untrusted inputs and defend against network, privacy, and parsing risks. | ||
| - Ensure that the icon URI is either a HTTPS or `data:` URI. Clients **MUST** reject icon URIs that use unsafe schemes and redirects, such as `javascript:`, `file:`, `ftp:`, `ws:`, or local app URI schemes. | ||
| - Disallow scheme changes and redirects to hosts on different origins. | ||
| - Be resilient against resource exhaustion attacks stemming from oversized images, large dimensions, or excessive frames (e.g., in GIFs). | ||
| - Consumers **MAY** set limits for image and content size. | ||
| - Fetch icons without credentials. Do not send cookies, `Authorization` headers, or client credentials. | ||
| - Verify that icon URIs are from the same origin as the server. This minimizes the risk of exposing data or tracking information to third-parties. | ||
| - Exercise caution when fetching and rendering icons as the payload **MAY** contain executable content (e.g., SVG with [embedded JavaScript](https://www.w3.org/TR/SVG11/script.html) or [extended capabilities](https://www.w3.org/TR/SVG11/extend.html)). | ||
| - Consumers **MAY** choose to disallow specific file types or otherwize sanitize icon files before rendering. | ||
| - Validate MIME types and file contents before rendering. Treat the MIME type information as advisory. Detect content type via magic bytes; reject on mismatch or unknown types. | ||
| - Maintain a strict allowlist of image types. | ||
|
|
||
| **Usage:** | ||
|
|
||
| Icons can be attached to: | ||
|
|
||
| - `Implementation`: Visual identifier for the MCP server/client implementation | ||
| - `Tool`: Visual representation of the tool's functionality | ||
| - `Prompt`: Icon to display alongside prompt templates | ||
| - `Resource`: Visual indicator for different resource types | ||
|
|
||
| Multiple icons can be provided to support different display contexts and resolutions. Clients should select the most appropriate icon based on their UI requirements. | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,7 +115,14 @@ supports [pagination](/specification/draft/server/utilities/pagination). | |
| "name": "main.rs", | ||
| "title": "Rust Software Application Main File", | ||
| "description": "Primary application entry point", | ||
| "mimeType": "text/x-rust" | ||
| "mimeType": "text/x-rust", | ||
| "icons": [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason that resource templates don't also have icons? |
||
| { | ||
| "src": "https://example.com/rust-file-icon.png", | ||
| "mimeType": "image/png", | ||
| "sizes": "48x48" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "nextCursor": "next-page-cursor" | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
It would be nice if this was
mediaTypeinstead as the termmimeTypewas replaced decades ago https://www.iana.org/assignments/media-types/media-types.xhtmlThere 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 agree with you, but
mimeTypeis consistent with other occurrences within our schema. For example,Resource.mimeType.