From 89b18e70bd308aa479324c8bb78c8e99187a2edd Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Thu, 28 Aug 2025 12:48:41 -0600 Subject: [PATCH 1/2] mcp: update SDK for SEP 973 + add to example server --- src/examples/server/simpleStreamableHttp.ts | 4 +- src/types.ts | 48 +++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/examples/server/simpleStreamableHttp.ts b/src/examples/server/simpleStreamableHttp.ts index 3271e6213..ba93fd4e5 100644 --- a/src/examples/server/simpleStreamableHttp.ts +++ b/src/examples/server/simpleStreamableHttp.ts @@ -21,7 +21,9 @@ const strictOAuth = process.argv.includes('--oauth-strict'); const getServer = () => { const server = new McpServer({ name: 'simple-streamable-http-server', - version: '1.0.0' + version: '1.0.0', + icons: [{src: './mcp.svg', sizes: '512x512', type: 'image/svg+xml'}], + websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk', }, { capabilities: { logging: {} } }); // Register a simple tool that returns a greeting diff --git a/src/types.ts b/src/types.ts index 323e37389..262e3b623 100644 --- a/src/types.ts +++ b/src/types.ts @@ -200,6 +200,26 @@ export const CancelledNotificationSchema = NotificationSchema.extend({ }); /* Base Metadata */ +/** + * Icon schema for use in tools, prompts, resources, and implementations. + */ +export const IconSchema = z + .object({ + /** + * URL or data URI for the icon. + */ + src: z.string(), + /** + * Optional MIME type for the icon. + */ + mimeType: z.optional(z.string()), + /** + * Optional string specifying icon dimensions (e.g., "48x48 96x96"). + */ + sizes: z.optional(z.string()), + }) + .passthrough(); + /** * Base metadata interface for common properties across resources, tools, prompts, and implementations. */ @@ -225,6 +245,19 @@ export const BaseMetadataSchema = z */ export const ImplementationSchema = BaseMetadataSchema.extend({ version: z.string(), + /** + * An optional URL of the website for this implementation. + */ + websiteUrl: z.optional(z.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: z.optional(z.array(IconSchema)), }); /** @@ -506,6 +539,11 @@ export const ResourceSchema = BaseMetadataSchema.extend({ */ mimeType: z.optional(z.string()), + /** + * An optional list of icons for this resource. + */ + icons: z.optional(z.array(IconSchema)), + /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. @@ -672,6 +710,10 @@ export const PromptSchema = BaseMetadataSchema.extend({ * A list of arguments to use for templating the prompt. */ arguments: z.optional(z.array(PromptArgumentSchema)), + /** + * An optional list of icons for this prompt. + */ + icons: z.optional(z.array(IconSchema)), /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. @@ -930,6 +972,11 @@ export const ToolSchema = BaseMetadataSchema.extend({ */ annotations: z.optional(ToolAnnotationsSchema), + /** + * An optional list of icons for this tool. + */ + icons: z.optional(z.array(IconSchema)), + /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. @@ -1535,6 +1582,7 @@ export type EmptyResult = Infer; export type CancelledNotification = Infer; /* Base Metadata */ +export type Icon = Infer; export type BaseMetadata = Infer; /* Initialization */ From 2efdc2011888a3e58b38fa0a96c5a00781a3c6d6 Mon Sep 17 00:00:00 2001 From: Jesse Lumarie Date: Wed, 3 Sep 2025 20:24:42 -0600 Subject: [PATCH 2/2] Update src/examples/server/simpleStreamableHttp.ts Co-authored-by: David Soria Parra <167242713+dsp-ant@users.noreply.github.com> --- src/examples/server/simpleStreamableHttp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/server/simpleStreamableHttp.ts b/src/examples/server/simpleStreamableHttp.ts index ba93fd4e5..6f1e20080 100644 --- a/src/examples/server/simpleStreamableHttp.ts +++ b/src/examples/server/simpleStreamableHttp.ts @@ -22,7 +22,7 @@ const getServer = () => { const server = new McpServer({ name: 'simple-streamable-http-server', version: '1.0.0', - icons: [{src: './mcp.svg', sizes: '512x512', type: 'image/svg+xml'}], + icons: [{src: './mcp.svg', sizes: '512x512', mimeType: 'image/svg+xml'}], websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk', }, { capabilities: { logging: {} } });