Skip to content

Upgrade @modelcontextprotocol/sdk package #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 18, 2025

Conversation

mandelbro
Copy link
Contributor

@mandelbro mandelbro commented Jul 16, 2025

Description

This PR resolves the typescript errors we encountered when upgrading @modelcontextprotocol/sdk to version 1.16.0.

Root Cause: The MCP SDK upgrade introduced a breaking change in the server.tool() method signature, adding an annotations parameter between the schema and callback parameters.

Due to this change, all of the server.tool.callsFake... invocations with fixed params were resulting in typescript errors.

// This line in multiple spec files
server.tool.callsFake((_name, _description, _schema, callback)

// Was replaced by this line in the spec helper file
server.tool.callsFake((...args: any[]) => {
  toolCallback = args[args.length - 1];
  return mockRegisteredTool;
});

This is a follow up to #75

My approach was to add a spec helper for setting up mocks for the MCP tool tests with the resolved typescript errors, and then implement it in all of the affected files.

@mandelbro mandelbro force-pushed the montes/upgrade-modelcontextprotocol-sdk branch from 077ba08 to 2df3bc5 Compare July 16, 2025 00:22
@mandelbro mandelbro force-pushed the montes/upgrade-modelcontextprotocol-sdk branch from fd286c3 to 37ad9ed Compare July 17, 2025 20:42
@mandelbro mandelbro marked this pull request as ready for review July 17, 2025 21:54
@mandelbro mandelbro requested a review from a team as a code owner July 17, 2025 21:54
Copy link
Contributor

@justinwilaby justinwilaby left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work!

@mandelbro mandelbro merged commit b5d492d into main Jul 18, 2025
1 check passed
@mandelbro mandelbro deleted the montes/upgrade-modelcontextprotocol-sdk branch July 18, 2025 15:34
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.

2 participants