`registerPrompt()` silently drops `icons` from PromptDefinition config
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start at registerPrompt() in dist/cjs/server/mcp.js:734 and trace how registered prompts are serialized for prompts/list responses. Compare the stored PromptDefinition fields with the MCP 2025-11-25 prompt definition, then verify that a prompt configured with icons returns them in the wire response.
Written by the indexing model from the issue text.
Description
Summary
server.registerPrompt() accepts a config object but destructures only { title, description, argsSchema } before storing the prompt. Any additional fields — including icons: Icon[], which the MCP 2025-11-25 spec explicitly allows on prompt definitions — are silently discarded. Clients calling prompts/list never receive icons.
SDK Version
@modelcontextprotocol/sdk 1.29.0
Affected Line
dist/cjs/server/mcp.js:734:
const { title, description, argsSchema } = config; // ← icons dropped here
Spec Reference
MCP 2025-11-25 server/prompts.md — prompts can have icons?: Icon[]. The Icon interface (spec.types.d.ts:449–487) has src, mimeType, sizes, and optional theme.
Reproduction
server.registerPrompt('my_prompt', {
description: 'A prompt with an icon',
argsSchema: {},
icons: [{ src: 'data:image/svg+xml;base64,...', mimeType: 'image/svg+xml', sizes: ['24x24'] }],
}, async () => ({ messages: [] }));
// prompts/list response: icons field is absent
Expected Behavior
icons in registerPrompt() config should be stored and returned in prompts/list wire responses.
Workaround
Intercept prompts/list via server.server.setRequestHandler(ListPromptsRequestSchema, ...) and inject icons from a parallel Map<name, Icon[]>.
Fix Suggestion
// In registerPrompt():
const { title, description, argsSchema, icons } = config; // include icons
registeredPrompt.icons = icons; // persist
// In prompts/list serializer: include icons if present
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/typescript-sdk
-
Auth metadata discovery: fallback URL built on resource host instead of authorization-server host Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
modelcontextprotocol/typescript-sdk#2783 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
modelcontextprotocol/typescript-sdk#2766 · 1 comment ·
-
Difficulty 2/5 1-2 days Newbie friendliness 72/100
All issues in modelcontextprotocol/typescript-sdk
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100