-
Notifications
You must be signed in to change notification settings - Fork 2.8k
update MCP SDK to v1.25.1 and migrate to zod v4 #16780
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
base: master
Are you sure you want to change the base?
Conversation
|
@ndoschek |
|
I will review at the latest next week. |
sdirix
left a comment
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.
I tested the scenarios outlined in the PR.
The MCP server within Theia worked and the MCP server of Theia did work in VS Code. However in Roo Code the MCP integration breaks with this PR. Is there something we can do to be backwards compatible? Sadly they don't log any error so maybe we can't do too much.
Besides that I added a minor comment regarding imports and a larger one regarding the package-lock. We have duplicated zod libraries including an old version in it.
| import { McpServer, RegisteredTool, RegisteredPrompt, RegisteredResource } from '@modelcontextprotocol/sdk/server/mcp.js'; | ||
| import type { ReadResourceResult } from '@modelcontextprotocol/sdk/types.js'; | ||
| import { MCPToolFrontendDelegate } from '../common/mcp-tool-delegate'; | ||
| import z from 'zod'; |
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.
All other imports look like this:
import { z } from 'zod';
| "version": "1.3.24", | ||
| "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-1.3.24.tgz", | ||
| "integrity": "sha512-GYXnGJTHRTZc4gJMSmFRgEQudjqd4PUN0ZjQhPwOAYH1yOAvQoG/Ikqs+HyISRbLPCrhbZnPKCNHuRU4OfpW0Q==", | ||
| "node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils": { |
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.
This looks like a duplicated dependency. @ai-sdk/provider-utils is now included multiple times in the same version, see for example node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils
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.
Good catch 👍
This looks like both @ai-sdk/openai and @ai-sdk/anthropic depend on @ai-sdk/provider-utils, and npm installs it under each package even though the versions match.
Since @ai-sdk/openai and @ai-sdk/anthropic are pulled in via the ai-vercel-ai package, I'd prefer not to touch or restructure those dependencies in this PR. I'll take another look at this on the next npm upgrade to see if we can upgrade those and remove the duplication.
package-lock.json
Outdated
| "packages/ai-ide/node_modules/zod": { | ||
| "version": "3.25.76", |
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.
We still consume an old version here in ai-ide
- Update @modelcontextprotocol/sdk from v1.15.1 to v1.25.1 - Migrate zod from v3.23.8 to v4.2.1 to avoid type conflicts - Update MCP tool registration API from server.tool() to server.registerTool() - Replace zod-to-json-schema with native zod toJSONSchema() method - Remove zod-to-json-schema dependency from ai-terminal package Fixes GH-16615
|
Thanks for the review @sdirix! Regarding the roo code extension: |
What it does
Fixes GH-16615
How to test
test-tool. start the browser backend and test in a mcp client e.g. in VS Code:{ "servers": { "theia-mcp-server": { "url": "http://localhost:3000/mcp", "type": "http" } }, "inputs": [] }Follow-ups
Breaking changes
Attribution
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers