-
Notifications
You must be signed in to change notification settings - Fork 170
chore: bump mcp SDK, refactor tool arguments #779
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
Conversation
There was a problem hiding this 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 MCP SDK from version 1.22.0 to 1.24.2 to address security vulnerabilities, and refactors the tool argument structure to improve type consistency and simplify the API across all tools. The refactoring changes the tool callback signature from using spread/rest parameters to accepting structured objects with named properties.
Key changes:
- Upgraded
@modelcontextprotocol/sdkdependency from 1.22.0 to 1.24.2 - Refactored tool execution signatures to use structured objects instead of spread parameters
- Updated type definitions for
ToolArgs,ToolExecutionContext, and removedToolCallbackArgs
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Bumped MCP SDK dependency version |
| src/tools/tool.ts | Core refactoring of tool argument types and execution context; changed callback registration pattern |
| src/tools/mongodb/mongodbTool.ts | Updated telemetry metadata signature to match new argument structure |
| src/tools/mongodb/create/insertMany.ts | Refactored conditional argument handling for embedding parameters |
| src/tools/atlasLocal/atlasLocalTool.ts | Updated execute and executeWithAtlasLocalClient signatures to use structured arguments |
| src/tools/atlasLocal/delete/deleteDeployment.ts | Changed parameter order to match new structured signature |
| src/tools/atlasLocal/create/createDeployment.ts | Changed parameter order to match new structured signature |
| src/tools/atlasLocal/connect/connectDeployment.ts | Updated method signatures and telemetry metadata handling |
| src/tools/atlas/atlasTool.ts | Simplified telemetry metadata resolution to work with structured args |
| src/tools/atlas/read/getPerformanceAdvisorTool.ts | Updated telemetry metadata signature and removed unused imports |
| src/tools/atlas/connect/connectCluster.ts | Updated telemetry metadata signature and simplified argsShape |
| src/elicitation.ts | Updated type import to use new ElicitRequestFormParams |
| tests/unit/toolBase.test.ts | Updated test cases to use structured argument format instead of tuples |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
This bumps the SDK to the latest versions which patches some security issues. This also simplifies our typing and structure of our arguments so we can have a more consistant and simpler to reason about API across tools.
doesn't seem like registerTool even exists...
Pull Request Test Coverage Report for Build 19925638108Details
💛 - Coveralls |
src/tools/tool.ts
Outdated
| callback | ||
| ); | ||
| this.registeredTool = ( | ||
| server.mcpServer.tool as ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.tool is deprecated - should we swap this out for registerTool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I tried and then reverted, I thought there was something wrong with the SDK because I had incorrectly documented experiences from it before but it was actually our mock. Re-added
Now with actual fix for our mock... I thought there was something wrong This reverts commit f881902.
This bumps the SDK to the latest versions which patches some security issues. This also simplifies our typing and structure of our arguments so we can have a more consistant and simpler to reason about API across tools.