Skip to content

fix(server): include registered tool icons#1977

Open
Genmin wants to merge 1 commit intomodelcontextprotocol:mainfrom
Genmin:fix/register-tool-icons
Open

fix(server): include registered tool icons#1977
Genmin wants to merge 1 commit intomodelcontextprotocol:mainfrom
Genmin:fix/register-tool-icons

Conversation

@Genmin
Copy link
Copy Markdown

@Genmin Genmin commented Apr 29, 2026

Summary

  • add icons to the high-level McpServer.registerTool() config and registered tool state
  • include registered tool icons in tools/list responses
  • carry the same icons option through experimental task tool registration
  • add an integration regression test and a server patch changeset

Fixes #1864.

Testing

  • pnpm --filter @modelcontextprotocol/server typecheck
  • pnpm --filter @modelcontextprotocol/server lint
  • pnpm --filter @modelcontextprotocol/test-integration lint -- test/server/mcp.test.ts
  • pnpm --filter @modelcontextprotocol/test-integration test -- test/server/mcp.test.ts -t "should register tool with icons"
  • pre-push hook: full Typecheck, Build, and Lint passed

@Genmin Genmin requested a review from a team as a code owner April 29, 2026 00:12
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 57b39a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@modelcontextprotocol/server Patch
@modelcontextprotocol/express Patch
@modelcontextprotocol/fastify Patch
@modelcontextprotocol/hono Patch
@modelcontextprotocol/node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@1977

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@1977

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@1977

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@1977

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@1977

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@1977

commit: 57b39a3

@Genmin Genmin force-pushed the fix/register-tool-icons branch from e2ecb3e to 57b39a3 Compare April 29, 2026 19:58
@Genmin
Copy link
Copy Markdown
Author

Genmin commented Apr 29, 2026

The remaining red check appears unrelated to this PR: test (22) failed only in test/server/cloudflareWorkers.test.ts with Miniflare returning Error: Network connection lost. All other matrix jobs and the local/pre-push validation are green after the rebase. I tried to rerun the failed job, but GitHub reports that rerunning requires repository admin rights.

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.

McpServer.registerTool() does not support icons field from ToolScheme

1 participant