From 71097101c063b422ef9e89c2c971d88daff8330f Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Fri, 11 Jul 2025 15:27:25 -0600 Subject: [PATCH 01/17] Expose additional metadata for Implementations --- schema/draft/schema.json | 129 ++++++++++++++++++++++++++++++++++++++- schema/draft/schema.ts | 35 ++++++++++- 2 files changed, 162 insertions(+), 2 deletions(-) diff --git a/schema/draft/schema.json b/schema/draft/schema.json index 068005634..c16d8e196 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -60,6 +60,13 @@ "BaseMetadata": { "description": "Base interface for metadata with name (identifier) and title (display name) properties.", "properties": { + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -67,6 +74,11 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -834,6 +846,25 @@ ], "type": "object" }, + "Icons": { + "properties": { + "mimeType": { + "description": "The MIME type of the icon.", + "type": "string" + }, + "sizes": { + "description": "A string that specifies one or more sizes at which the icon file can be used.\nEach size is specified as x. If multiple sizes are specified, they are separated by spaces; for example, 48x48 96x96.\nFor vector formats like SVG, you can use any to indicate scalability", + "type": "string" + }, + "src": { + "type": "string" + } + }, + "required": [ + "src" + ], + "type": "object" + }, "ImageContent": { "description": "An image provided to or from an LLM.", "properties": { @@ -868,8 +899,15 @@ "type": "object" }, "Implementation": { - "description": "Describes the name and version of an MCP implementation, with an optional title for UI representation.", + "description": "Describes the MCP implementation", "properties": { + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -880,6 +918,11 @@ }, "version": { "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -1706,6 +1749,13 @@ "description": "An optional description of what this prompt provides", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -1713,6 +1763,11 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -1727,6 +1782,13 @@ "description": "A human-readable description of the argument.", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -1738,6 +1800,11 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -1793,6 +1860,13 @@ "PromptReference": { "description": "Identifies a prompt.", "properties": { + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -1804,6 +1878,11 @@ "type": { "const": "ref/prompt", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -1926,6 +2005,13 @@ "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" @@ -1946,6 +2032,11 @@ "description": "The URI of this resource.", "format": "uri", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -1993,6 +2084,13 @@ "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" @@ -2017,6 +2115,11 @@ "description": "The URI of this resource.", "format": "uri", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -2071,6 +2174,13 @@ "description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "mimeType": { "description": "The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.", "type": "string" @@ -2087,6 +2197,11 @@ "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.", "format": "uri-template", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ @@ -2553,6 +2668,13 @@ "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.", "type": "string" }, + "icons": { + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "items": { + "$ref": "#/definitions/Icons" + }, + "type": "array" + }, "inputSchema": { "description": "A JSON Schema object defining the expected parameters for the tool.", "properties": { @@ -2614,6 +2736,11 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" + }, + "websiteUrl": { + "description": "An optional URL of the website for this implementation.", + "format": ": uri", + "type": "string" } }, "required": [ diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index b9ec8c7a1..47f7908d4 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -288,6 +288,22 @@ export interface ServerCapabilities { }; } +interface Icons { + src: string; + /** + * The MIME type of the icon. + */ + mimeType?: string; + /** + * A string that specifies one or more sizes at which the icon file can be used. + * Each size is specified as x. 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 + * + * @TJS-type string + */ + sizes?: string; +} + /** * Base interface for metadata with name (identifier) and title (display name) properties. * @@ -308,10 +324,27 @@ export interface BaseMetadata { * if present). */ title?: string; + + /** + * 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 `src` property that points to the icon file, 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?: Icons[]; } /** - * Describes the name and version of an MCP implementation, with an optional title for UI representation. + * Describes the MCP implementation */ export interface Implementation extends BaseMetadata { version: string; From 47a03955ae99a8914feeff1520eb538a22ab0b75 Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Thu, 17 Jul 2025 14:32:38 -0600 Subject: [PATCH 02/17] mcp: add distriminated union for icons for more typing clarity --- schema/draft/schema.json | 94 +++++++++++++++++++++++++++++----------- schema/draft/schema.ts | 30 +++++++++---- 2 files changed, 90 insertions(+), 34 deletions(-) diff --git a/schema/draft/schema.json b/schema/draft/schema.json index c16d8e196..ad27e2b2a 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -63,7 +63,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -597,6 +597,33 @@ "description": "An opaque token used to represent a cursor for pagination.", "type": "string" }, + "DataIcon": { + "description": "Inline icon: base64-encoded data URI", + "properties": { + "kind": { + "const": "data", + "type": "string" + }, + "mimeType": { + "description": "Always required for clarity, though data URI also encodes it", + "type": "string" + }, + "sizes": { + "type": "string" + }, + "src": { + "description": "Data URI embedding the image, e.g.:\n \"data:image/png;base64,iVBORw0KGgoAAAANS…\"", + "pattern": "^data:.*;base64,.*$", + "type": "string" + } + }, + "required": [ + "kind", + "mimeType", + "src" + ], + "type": "object" + }, "ElicitRequest": { "description": "A request from the server to elicit additional information from the user via the client.", "properties": { @@ -846,24 +873,15 @@ ], "type": "object" }, - "Icons": { - "properties": { - "mimeType": { - "description": "The MIME type of the icon.", - "type": "string" - }, - "sizes": { - "description": "A string that specifies one or more sizes at which the icon file can be used.\nEach size is specified as x. If multiple sizes are specified, they are separated by spaces; for example, 48x48 96x96.\nFor vector formats like SVG, you can use any to indicate scalability", - "type": "string" + "Icon": { + "anyOf": [ + { + "$ref": "#/definitions/UrlIcon" }, - "src": { - "type": "string" + { + "$ref": "#/definitions/DataIcon" } - }, - "required": [ - "src" - ], - "type": "object" + ] }, "ImageContent": { "description": "An image provided to or from an LLM.", @@ -904,7 +922,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -1752,7 +1770,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -1785,7 +1803,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -1863,7 +1881,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -2008,7 +2026,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -2087,7 +2105,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -2177,7 +2195,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -2671,7 +2689,7 @@ "icons": { "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { - "$ref": "#/definitions/Icons" + "$ref": "#/definitions/Icon" }, "type": "array" }, @@ -2839,6 +2857,32 @@ "params" ], "type": "object" + }, + "UrlIcon": { + "properties": { + "kind": { + "const": "url", + "type": "string" + }, + "mimeType": { + "description": "Optional override if the server’s MIME type is missing or generic.", + "type": "string" + }, + "sizes": { + "description": "e.g. \"48x48\", \"any\" (for SVG), or \"48x48 96x96\"", + "type": "string" + }, + "src": { + "description": "A standard URI pointing to an icon resource.", + "format": "uri", + "type": "string" + } + }, + "required": [ + "kind", + "src" + ], + "type": "object" } } } diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 47f7908d4..060be8a84 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -288,22 +288,34 @@ export interface ServerCapabilities { }; } -interface Icons { - src: string; +interface UrlIcon { + kind: 'url'; /** - * The MIME type of the icon. + * A standard URI pointing to an icon resource. + * @format uri */ + src: string; + /** Optional override if the server’s MIME type is missing or generic. */ mimeType?: string; + /** e.g. "48x48", "any" (for SVG), or "48x48 96x96" */ + sizes?: string; +} + +/** Inline icon: base64-encoded data URI */ +interface DataIcon { + kind: 'data'; /** - * A string that specifies one or more sizes at which the icon file can be used. - * Each size is specified as x. 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 - * - * @TJS-type string + * Data URI embedding the image, e.g.: + * "data:image/png;base64,iVBORw0KGgoAAAANS…" */ + src: `data:${string};base64,${string}`; + /** Always required for clarity, though data URI also encodes it */ + mimeType: string; sizes?: string; } +export type Icon = UrlIcon | DataIcon; + /** * Base interface for metadata with name (identifier) and title (display name) properties. * @@ -340,7 +352,7 @@ export interface BaseMetadata { * 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?: Icons[]; + icons?: Icon[]; } /** From 60438f9d4e9c173aa3e7fa28712853f358ded186 Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Thu, 17 Jul 2025 15:13:56 -0600 Subject: [PATCH 03/17] mcp: update comments --- schema/draft/schema.json | 18 +++++++++--------- schema/draft/schema.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/schema/draft/schema.json b/schema/draft/schema.json index ad27e2b2a..372036c6d 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -61,7 +61,7 @@ "description": "Base interface for metadata with name (identifier) and title (display name) properties.", "properties": { "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -920,7 +920,7 @@ "description": "Describes the MCP implementation", "properties": { "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -1768,7 +1768,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -1801,7 +1801,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -1879,7 +1879,7 @@ "description": "Identifies a prompt.", "properties": { "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2024,7 +2024,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2103,7 +2103,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2193,7 +2193,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2687,7 +2687,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach icon should have a `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 060be8a84..16b63f88d 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -347,7 +347,7 @@ export interface BaseMetadata { /** * 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 `src` property that points to the icon file, and may also include a `mimeType` and `sizes` property. + * 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. From bfd102c11ab1a6c111f2bf57b8727cdbbdc2b6a2 Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Tue, 22 Jul 2025 13:49:51 -0600 Subject: [PATCH 04/17] mcp: only put icons on Tools/Prompts/Resources, and put website url on Implementations only --- schema/draft/schema.json | 153 ++++++--------------------------------- schema/draft/schema.ts | 72 ++++++++++-------- 2 files changed, 65 insertions(+), 160 deletions(-) diff --git a/schema/draft/schema.json b/schema/draft/schema.json index 372036c6d..80f7b1a6c 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -60,13 +60,6 @@ "BaseMetadata": { "description": "Base interface for metadata with name (identifier) and title (display name) properties.", "properties": { - "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", - "items": { - "$ref": "#/definitions/Icon" - }, - "type": "array" - }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -74,11 +67,6 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -597,33 +585,6 @@ "description": "An opaque token used to represent a cursor for pagination.", "type": "string" }, - "DataIcon": { - "description": "Inline icon: base64-encoded data URI", - "properties": { - "kind": { - "const": "data", - "type": "string" - }, - "mimeType": { - "description": "Always required for clarity, though data URI also encodes it", - "type": "string" - }, - "sizes": { - "type": "string" - }, - "src": { - "description": "Data URI embedding the image, e.g.:\n \"data:image/png;base64,iVBORw0KGgoAAAANS…\"", - "pattern": "^data:.*;base64,.*$", - "type": "string" - } - }, - "required": [ - "kind", - "mimeType", - "src" - ], - "type": "object" - }, "ElicitRequest": { "description": "A request from the server to elicit additional information from the user via the client.", "properties": { @@ -874,14 +835,26 @@ "type": "object" }, "Icon": { - "anyOf": [ - { - "$ref": "#/definitions/UrlIcon" + "description": "A url pointing to an icon URL or a base64-encoded data URI", + "properties": { + "mimeType": { + "description": "Optional override if the server’s MIME type is missing or generic.", + "type": "string" }, - { - "$ref": "#/definitions/DataIcon" + "sizes": { + "description": "e.g. \"48x48\", \"any\" (for SVG), or \"48x48 96x96\"", + "type": "string" + }, + "src": { + "description": "A standard URI pointing to an icon resource.", + "format": "uri", + "type": "string" } - ] + }, + "required": [ + "src" + ], + "type": "object" }, "ImageContent": { "description": "An image provided to or from an LLM.", @@ -1768,7 +1741,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for a prompt.\nThis can be used by clients to display the prompt's icon in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -1781,11 +1754,6 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -1800,13 +1768,6 @@ "description": "A human-readable description of the argument.", "type": "string" }, - "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", - "items": { - "$ref": "#/definitions/Icon" - }, - "type": "array" - }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -1818,11 +1779,6 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -1878,13 +1834,6 @@ "PromptReference": { "description": "Identifies a prompt.", "properties": { - "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", - "items": { - "$ref": "#/definitions/Icon" - }, - "type": "array" - }, "name": { "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).", "type": "string" @@ -1896,11 +1845,6 @@ "type": { "const": "ref/prompt", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -2024,7 +1968,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for a resource.\nThis can be used by clients to display the resource's icon in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2050,11 +1994,6 @@ "description": "The URI of this resource.", "format": "uri", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -2103,7 +2042,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for a resource.\nThis can be used by clients to display the resource's icon in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2133,11 +2072,6 @@ "description": "The URI of this resource.", "format": "uri", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -2192,13 +2126,6 @@ "description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, - "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", - "items": { - "$ref": "#/definitions/Icon" - }, - "type": "array" - }, "mimeType": { "description": "The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.", "type": "string" @@ -2215,11 +2142,6 @@ "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.", "format": "uri-template", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -2687,7 +2609,7 @@ "type": "string" }, "icons": { - "description": "An optional list of icons for this implementation.\nThis can be used by clients to display the implementation in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", + "description": "An optional list of icons for a tool.\nThis can be used by clients to display the tool's icon in a user interface.\nEach 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.\nThe `mimeType` property should be a valid MIME type for the icon file, such as \"image/png\" or \"image/svg+xml\".\nThe `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.\nThe `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.", "items": { "$ref": "#/definitions/Icon" }, @@ -2754,11 +2676,6 @@ "title": { "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere `annotations.title` should be given precedence over using `name`,\nif present).", "type": "string" - }, - "websiteUrl": { - "description": "An optional URL of the website for this implementation.", - "format": ": uri", - "type": "string" } }, "required": [ @@ -2857,32 +2774,6 @@ "params" ], "type": "object" - }, - "UrlIcon": { - "properties": { - "kind": { - "const": "url", - "type": "string" - }, - "mimeType": { - "description": "Optional override if the server’s MIME type is missing or generic.", - "type": "string" - }, - "sizes": { - "description": "e.g. \"48x48\", \"any\" (for SVG), or \"48x48 96x96\"", - "type": "string" - }, - "src": { - "description": "A standard URI pointing to an icon resource.", - "format": "uri", - "type": "string" - } - }, - "required": [ - "kind", - "src" - ], - "type": "object" } } } diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 16b63f88d..94132b3e5 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -288,8 +288,8 @@ export interface ServerCapabilities { }; } -interface UrlIcon { - kind: 'url'; +/** A url pointing to an icon URL or a base64-encoded data URI */ +export interface Icon { /** * A standard URI pointing to an icon resource. * @format uri @@ -301,20 +301,6 @@ interface UrlIcon { sizes?: string; } -/** Inline icon: base64-encoded data URI */ -interface DataIcon { - kind: 'data'; - /** - * Data URI embedding the image, e.g.: - * "data:image/png;base64,iVBORw0KGgoAAAANS…" - */ - src: `data:${string};base64,${string}`; - /** Always required for clarity, though data URI also encodes it */ - mimeType: string; - sizes?: string; -} - -export type Icon = UrlIcon | DataIcon; /** * Base interface for metadata with name (identifier) and title (display name) properties. @@ -336,14 +322,13 @@ export interface BaseMetadata { * if present). */ title?: string; +} - /** - * An optional URL of the website for this implementation. - * - * @format: uri - */ - websiteUrl?: string; - +/** + * Describes the MCP implementation + */ +export interface Implementation extends BaseMetadata { + version: string; /** * An optional list of icons for this implementation. * This can be used by clients to display the implementation in a user interface. @@ -353,13 +338,13 @@ export interface BaseMetadata { * The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size. */ icons?: Icon[]; -} + /** + * An optional URL of the website for this implementation. + * + * @format: uri + */ + websiteUrl?: string; -/** - * Describes the MCP implementation - */ -export interface Implementation extends BaseMetadata { - version: string; } /* Ping */ @@ -583,6 +568,16 @@ export interface Resource extends BaseMetadata { */ size?: number; + /** + * An optional list of icons for a resource. + * This can be used by clients to display the resource's icon 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[]; + /** * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. */ @@ -723,6 +718,15 @@ export interface Prompt extends BaseMetadata { * A list of arguments to use for templating the prompt. */ arguments?: PromptArgument[]; + /** + * An optional list of icons for a prompt. + * This can be used by clients to display the prompt's icon 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[]; /** * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. @@ -963,6 +967,16 @@ export interface Tool extends BaseMetadata { */ annotations?: ToolAnnotations; + /** + * An optional list of icons for a tool. + * This can be used by clients to display the tool's icon 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[]; + /** * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. */ From 5cb335b40fcb9708b3169a9de00046a2da7e26fa Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Tue, 22 Jul 2025 13:57:10 -0600 Subject: [PATCH 05/17] Add additional hint for Icon urls --- schema/draft/schema.json | 2 +- schema/draft/schema.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/schema/draft/schema.json b/schema/draft/schema.json index 80f7b1a6c..ce6b9adf8 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -846,7 +846,7 @@ "type": "string" }, "src": { - "description": "A standard URI pointing to an icon resource.", + "description": "A standard URI pointing to an icon resource.\nFor streamable HTTP servers, the URL SHOULD be on the same origin as the server itself", "format": "uri", "type": "string" } diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 94132b3e5..8fda49a6b 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -292,6 +292,7 @@ export interface ServerCapabilities { export interface Icon { /** * A standard URI pointing to an icon resource. + * For streamable HTTP servers, the URL SHOULD be on the same origin as the server itself * @format uri */ src: string; From dbdea15a49fe739287eb1be31e7f10d10336ec84 Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Fri, 22 Aug 2025 12:35:09 -0600 Subject: [PATCH 06/17] mcp: update Icon to include some additional security hints --- docs/specification/draft/schema.mdx | 45 +++++++++++++++++++++++++---- schema/draft/schema.json | 4 +-- schema/draft/schema.ts | 14 ++++++++- 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/docs/specification/draft/schema.mdx b/docs/specification/draft/schema.mdx index 58957a76e..1b65f47e9 100644 --- a/docs/specification/draft/schema.mdx +++ b/docs/specification/draft/schema.mdx @@ -54,16 +54,29 @@ of the LLM and/or the user.

interface Error {
  code: number;
  data?: unknown;
  message: string;
}
code: number

The error type that occurred.

data?: unknown

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

message: string

A short description of the error. The message SHOULD be limited to a concise single sentence.

+### `Icon` + +
interface Icon {
  mimeType?: string;
  sizes?: string;
  src: string;
}

A url pointing to an icon URL or a base64-encoded data URI

mimeType?: string

Optional override if the server’s MIME type is missing or generic.

sizes?: string

e.g. "48x48", "any" (for SVG), or "48x48 96x96"

src: string

A standard URI pointing to an icon resource.

Consumers SHOULD takes steps to ensure URLs serving icons are from the +same domain as the client/server or a trusted domain.

Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain +executable JavaScript

+ ### `ImageContent`
interface ImageContent {
  _meta?: { [key: string]: unknown };
  annotations?: Annotations;
  data: string;
  mimeType: string;
  type: "image";
}

An image provided to or from an LLM.

_meta?: { [key: string]: unknown }

See General fields: _meta for notes on _meta usage.

annotations?: Annotations

Optional annotations for the client.

data: string

The base64-encoded image data.

mimeType: string

The MIME type of the image. Different providers may support different image types.

### `Implementation` -
interface Implementation {
  name: string;
  title?: string;
  version: string;
}

Describes the name and version of an MCP implementation, with an optional title for UI representation.

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

title?: string

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, +

interface Implementation {
  icons?: Icon[];
  name: string;
  title?: string;
  version: string;
  websiteUrl?: string;
}

Describes the MCP implementation

icons?: Icon[]

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.

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

title?: string

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.

If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, -if present).

+if present).

websiteUrl?: string

An optional URL of the website for this implementation.

Consumers SHOULD takes steps to ensure URLs serving icons are from the +same domain as the client/server or a trusted domain.

Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain +executable JavaScript

@format: uri

### `JSONRPCError` @@ -123,7 +136,12 @@ without nested objects or arrays.

interface Prompt {
  _meta?: { [key: string]: unknown };
  arguments?: PromptArgument[];
  description?: string;
  name: string;
  title?: string;
}

A prompt or prompt template that the server offers.

_meta?: { [key: string]: unknown }

See General fields: _meta for notes on _meta usage.

arguments?: PromptArgument[]

A list of arguments to use for templating the prompt.

description?: string

An optional description of what this prompt provides

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

title?: string

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, +

interface Prompt {
  _meta?: { [key: string]: unknown };
  arguments?: PromptArgument[];
  description?: string;
  icons?: Icon[];
  name: string;
  title?: string;
}

A prompt or prompt template that the server offers.

_meta?: { [key: string]: unknown }

See General fields: _meta for notes on _meta usage.

arguments?: PromptArgument[]

A list of arguments to use for templating the prompt.

description?: string

An optional description of what this prompt provides

icons?: Icon[]

An optional list of icons for a prompt. +This can be used by clients to display the prompt's icon 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.

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).

title?: string

Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.

If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).

@@ -153,7 +171,12 @@ if present).