Skip to content

feat(server): accept icons in registerAppTool's tool config - #813

Open
naivedhya27-cmyk wants to merge 1 commit into
modelcontextprotocol:mainfrom
naivedhya27-cmyk:tool-config-icons
Open

naivedhya27-cmyk wants to merge 1 commit into
modelcontextprotocol:mainfrom
naivedhya27-cmyk:tool-config-icons

Conversation

@naivedhya27-cmyk

Copy link
Copy Markdown

Summary

MCP 2025-11-25 lets a tool carry icons, and the SDK's registerTool config accepts them. ToolConfig (and so McpUiAppToolConfig) left the field out, so TypeScript rejects icons in registerAppTool(...):

error TS2769: No overload matches this call.
  Object literal may only specify known properties, and 'icons' does not exist in type 'McpUiAppToolConfig & ...'

The runtime already spreads the config into registerTool, so only the type blocked it. App tools are the ones a host shows most prominently, yet they were the only tools that could not have an icon without a cast or a fallback to server.registerTool.

Changes

  • icons?: Icon[] on ToolConfig, using the SDK's own Icon type.
  • A test that registers an app tool with light and dark icons and checks that they reach tools/list through a real client.

Testing

  • tsc, the build's type check: the new test does not compile without the field, and does with it.
  • bun test src/server: 16 pass.
  • bun test src examples: 350 pass; the one failure and one error are the same on main in a checkout without npm run build (the pdf-server example cannot resolve @modelcontextprotocol/ext-apps/server).
  • prettier --check on the changed files: clean.

Found while building an Alexa+ add-on with Echo Show cards, where every tool has its own icon.

🤖 Generated with Claude Code

MCP 2025-11-25 tools can carry `icons`, and the SDK's `registerTool` config
accepts them, but `ToolConfig` (and so `McpUiAppToolConfig`) left the field
out. TypeScript rejected `icons` in `registerAppTool(...)` although the runtime
already spreads the config into `registerTool`, so an app tool could not have
an icon without a cast or a fallback to `registerTool`.

Adds `icons?: Icon[]` to `ToolConfig`, with a test that the icons reach
`tools/list`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant