Skip to content

Commit 7d29cee

Browse files
authored
fix: change Icon.sizes from string to string[] (#981)
1 parent 7146eed commit 7d29cee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/examples/server/simpleStreamableHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const getServer = () => {
2222
const server = new McpServer({
2323
name: 'simple-streamable-http-server',
2424
version: '1.0.0',
25-
icons: [{src: './mcp.svg', sizes: '512x512', mimeType: 'image/svg+xml'}],
25+
icons: [{src: './mcp.svg', sizes: ['512x512'], mimeType: 'image/svg+xml'}],
2626
websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk',
2727
}, { capabilities: { logging: {} } });
2828

src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,11 @@ export const IconSchema = z
214214
*/
215215
mimeType: z.optional(z.string()),
216216
/**
217-
* Optional string specifying icon dimensions (e.g., "48x48 96x96").
217+
* Optional array of strings that specify sizes at which the icon can be used.
218+
* Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.
219+
* If not provided, the client should assume that the icon can be used at any size.
218220
*/
219-
sizes: z.optional(z.string()),
221+
sizes: z.optional(z.array(z.string())),
220222
})
221223
.passthrough();
222224

0 commit comments

Comments
 (0)