Skip to content

Conversation

@nirinchev
Copy link
Collaborator

Proposed changes

This bumps the MCP SDK npm package and fixes some breaking changes.

@nirinchev nirinchev requested a review from a team as a code owner November 20, 2025 21:36
Copilot AI review requested due to automatic review settings November 20, 2025 21:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the @modelcontextprotocol/sdk package from version ^1.17.4 to ^1.22.0 and addresses breaking changes introduced by the new SDK version. The main changes involve updates to tool annotations, error handling, and server configuration.

Key Changes

  • Modified tool annotations to remove the redundant description field from annotations since it's now only present at the tool level
  • Updated error handling in tests to check for error responses instead of catching exceptions
  • Moved server instructions from registerCapabilities to the McpServer constructor

Reviewed Changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Updated @modelcontextprotocol/sdk to ^1.22.0 and mongodb to ^6.21.0
src/tools/tool.ts Removed description field from tool annotations
src/server.ts Removed instructions from capabilities registration
src/transports/base.ts Added instructions to McpServer constructor and created helper method
tests/integration/helpers.ts Updated test helpers to accept operation type parameter and modified error handling approach
tests/integration/tools/**/*.test.ts Added operation type parameter to all validateToolMetadata calls

protected get annotations(): ToolAnnotations {
const annotations: ToolAnnotations = {
title: this.name,
description: this.description,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT the description should never have been part of the annotations and now is rejected as it's an unknown key.

this.mcpServer.server.registerCapabilities({
logging: {},
resources: { listChanged: true, subscribe: true },
instructions: this.getInstructions(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was similarly never part of capabilities and was previously ignored. Now it's correctly rejected. I moved it to base.ts where it should live.

expect(tool.annotations.title).toBe(name);
expect(tool.annotations.description).toBe(description);

switch (tool.operationType) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This never worked - operationType would always be undefined, resulting in this switch getting largely ignored. This now fails correctly, which forced me to propagate the expectation across multiple tests, which is the reason for most of the changes here.

@coveralls
Copy link
Collaborator

coveralls commented Nov 20, 2025

Pull Request Test Coverage Report for Build 19552615840

Details

  • 17 of 19 (89.47%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 80.114%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/transports/base.ts 17 19 89.47%
Totals Coverage Status
Change from base Build 19532466655: 0.002%
Covered Lines: 6388
Relevant Lines: 7883

💛 - Coveralls

@nirinchev nirinchev merged commit e4d3d7b into main Nov 21, 2025
27 of 28 checks passed
@nirinchev nirinchev deleted the ni/bump-mcp-sdk branch November 21, 2025 15:40
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.

4 participants