Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/specification/draft/basic/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 mediaType instead as the term mimeType was replaced decades ago https://www.iana.org/assignments/media-types/media-types.xhtml

Copy link
Member

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 mimeType is consistent with other occurrences within our schema. For example, Resource.mimeType.

- `sizes`: Optional size specification (e.g., "48x48", "any" for scalable formats like SVG, or "48x48 96x96" for multiple sizes)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be size instead of sizes?


**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:**

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.
20 changes: 18 additions & 2 deletions docs/specification/draft/basic/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ The client **MUST** initiate this phase by sending an `initialize` request conta
"clientInfo": {
"name": "ExampleClient",
"title": "Example Client Display Name",
"version": "1.0.0"
"version": "1.0.0",
"icons": [
{
"src": "https://example.com/icon.png",
"mimeType": "image/png",
"sizes": "48x48"
}
],
"websiteUrl": "https://example.com"
}
}
}
Expand Down Expand Up @@ -99,7 +107,15 @@ The server **MUST** respond with its own capabilities and information:
"serverInfo": {
"name": "ExampleServer",
"title": "Example Server Display Name",
"version": "1.0.0"
"version": "1.0.0",
"icons": [
{
"src": "https://example.com/server-icon.svg",
"mimeType": "image/svg+xml",
"sizes": "any"
}
],
"websiteUrl": "https://example.com/server"
},
"instructions": "Optional instructions for the client"
}
Expand Down
1 change: 1 addition & 0 deletions docs/specification/draft/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ the previous revision, [2025-06-18](/specification/2025-06-18).
## Major changes

1. Enhance authorization server discovery with support for [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html). (PR [#797](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/797))
2. Allow servers to expose icons as additional metadata for tools, resources and prompts ([SEP-973](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/973)).

## Other schema changes

Expand Down
45 changes: 39 additions & 6 deletions docs/specification/draft/schema.mdx

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/specification/draft/server/prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ supports [pagination](/specification/draft/server/utilities/pagination).
"description": "The code to review",
"required": true
}
],
"icons": [
{
"src": "https://example.com/review-icon.svg",
"mimeType": "image/svg+xml",
"sizes": "any"
}
]
}
],
Expand Down
9 changes: 8 additions & 1 deletion docs/specification/draft/server/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Copy link
Contributor

Choose a reason for hiding this comment

The 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"
Expand Down
9 changes: 8 additions & 1 deletion docs/specification/draft/server/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ To discover available tools, clients send a `tools/list` request. This operation
}
},
"required": ["location"]
}
},
"icons": [
{
"src": "https://example.com/weather-icon.png",
"mimeType": "image/png",
"sizes": "48x48"
}
]
}
],
"nextCursor": "next-page-cursor"
Expand Down
64 changes: 63 additions & 1 deletion schema/draft/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading