chore: update mcp server to 1.10 COMPASS-10235#8017
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Compass’ MCP server dependency to mongodb-mcp-server@^1.10.0 and adapts the Generative AI integration to work with updated Zod/MCP schema behavior.
Changes:
- Bump
mongodb-mcp-serverfrom1.9.0to^1.10.0in relevant workspaces and lockfile. - Switch Generative AI MCP tool schema handling to use
zod/v4and update transform-stripping logic. - Remove the
previewFeaturesconfig passed into MCP user config.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-web/package.json | Updates MCP server dependency version range. |
| packages/compass-generative-ai/package.json | Updates MCP server dependency version range. |
| packages/compass-generative-ai/src/tools-controller.ts | Uses zod/v4, adjusts MCP config, and builds tool input schemas via transform stripping. |
| packages/compass-generative-ai/src/remove-zod-transforms.ts | Reworks transform stripping implementation for Zod v4 internals. |
| packages/compass-generative-ai/src/remove-zod-transforms.spec.ts | Updates/reshapes tests to match Zod v4 internals and MCP zEJSON pattern. |
| package-lock.json | Locks updated MCP server version and new transitive dependencies. |
| tools[toolBase.name] = tool({ | ||
| description: getCustomToolDescription(toolBase), | ||
| inputSchema: z.object( | ||
| Object.fromEntries( | ||
| Object.entries(toolBase.argsShape).map(([key, value]) => { | ||
| return [ | ||
| key, | ||
| // TODO: MCP server applies transformations like toEJSON. | ||
| // We should come up with a better solution for this but for now we recursively remove the transforms. | ||
| // AI SDK applies transformations defined in the schema *before* sending the request to the model. | ||
| removeZodTransforms(value), | ||
| ]; | ||
| // TODO: MCP server applies transformations like toEJSON. | ||
| // We should come up with a better solution for this but for now we recursively remove the transforms. | ||
| // AI SDK applies transformations defined in the schema *before* sending the request to the model. | ||
| return [key, removeZodTransforms(value)]; | ||
| }) | ||
| ) | ||
| ), |
There was a problem hiding this comment.
Potentially risky Zod-version mixing: mongodb-mcp-server@^1.10.0 now pulls in zod@^4, while this package still depends on zod@^3 and imports zod/v4 from there. That can lead to schemas from the MCP server (built with a different Zod instance) being combined into z.object(...) here, which may fail or behave incorrectly if Zod relies on instanceof checks. Consider aligning this package’s zod dependency to v4 (so it can be deduped/hoisted) or ensuring removeZodTransforms never constructs schemas with a different Zod instance than the input schema.
There was a problem hiding this comment.
I don't feel like upgrading mock-data-generator to use zod 4 right now.
COMPASS-10235
Needed or maxTimeMS