Skip to content

fix(server): preserve explicit tool listChanged capability - #2625

Open
LizunovSergey wants to merge 2 commits into
modelcontextprotocol:v1.xfrom
LizunovSergey:fix/v1-listchanged-capability
Open

fix(server): preserve explicit tool listChanged capability#2625
LizunovSergey wants to merge 2 commits into
modelcontextprotocol:v1.xfrom
LizunovSergey:fix/v1-listchanged-capability

Conversation

@LizunovSergey

Copy link
Copy Markdown

Summary

  • preserve an explicitly configured tools.listChanged: false value when the first tool is registered
  • expose the server's current capabilities so McpServer can merge its default without overwriting caller configuration
  • keep the existing listChanged: true default when no value is provided

Root cause

McpServer.setToolRequestHandlers() unconditionally registered tools.listChanged: true, and the capability merge allowed that internal default to overwrite the constructor-provided value. The v2 server already reads the current capability before applying the default; this brings the same tool behavior to v1.x.

Closes #2622.

Validation

  • npx vitest run test/server/mcp.test.ts (236 passed)
  • npm run typecheck
  • npm run lint

AI assistance disclosure: Codex was used to help investigate and implement this change. I reviewed the diff and validated the code and tests locally.

@changeset-bot

changeset-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15cf0fa

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

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

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@2625

commit: 15cf0fa

@LizunovSergey
LizunovSergey marked this pull request as ready for review August 8, 2026 19:02
@LizunovSergey
LizunovSergey requested a review from a team as a code owner August 8, 2026 19:02
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