Skip to content

chore: update mcp server to 1.10 COMPASS-10235#8017

Merged
lerouxb merged 5 commits intomainfrom
bump-mongodb-mcp-server-1-10
Apr 24, 2026
Merged

chore: update mcp server to 1.10 COMPASS-10235#8017
lerouxb merged 5 commits intomainfrom
bump-mongodb-mcp-server-1-10

Conversation

@lerouxb
Copy link
Copy Markdown
Member

@lerouxb lerouxb commented Apr 23, 2026

COMPASS-10235

Needed or maxTimeMS

Copilot AI review requested due to automatic review settings April 23, 2026 15:52
@lerouxb lerouxb requested a review from gagik April 23, 2026 15:55
Copy link
Copy Markdown
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

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-server from 1.9.0 to ^1.10.0 in relevant workspaces and lockfile.
  • Switch Generative AI MCP tool schema handling to use zod/v4 and update transform-stripping logic.
  • Remove the previewFeatures config 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.

Comment thread packages/compass-generative-ai/src/remove-zod-transforms.ts
Comment thread packages/compass-generative-ai/src/remove-zod-transforms.ts Outdated
Comment on lines 194 to 205
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)];
})
)
),
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't feel like upgrading mock-data-generator to use zod 4 right now.

@lerouxb lerouxb marked this pull request as ready for review April 23, 2026 19:58
@lerouxb lerouxb requested a review from a team as a code owner April 23, 2026 19:58
@lerouxb lerouxb requested review from ivandevp and removed request for ivandevp April 23, 2026 19:58
@lerouxb lerouxb merged commit 3ccde63 into main Apr 24, 2026
54 of 55 checks passed
@lerouxb lerouxb deleted the bump-mongodb-mcp-server-1-10 branch April 24, 2026 13:44
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.

3 participants