chore(deps): bump zod to ^4.2.0 across all workspaces - #3399
Conversation
Below zod 4.2.0, the MCP SDK's ~standard.jsonSchema self-conversion path silently drops .describe() annotations on tool/prompt input schemas when MCPJam acts as an MCP server, so served descriptions were disappearing on the wire. Bumps zod (dependency + overrides) in sdk, cli, mcp, and mcpjam-inspector, regenerates the root lockfile, and adds a regression test that registers a described tool on an in-test McpServer and asserts the description survives tools/list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
MCP worker previewPreview worker |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated Zod dependency and override versions to Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sdk/tests/zod-describe-preservation.test.ts`:
- Around line 56-68: Move client.connect(transport) inside the existing
try/finally block in the test, keeping the listTools assertions unchanged.
Ensure any connection or handshake failure still reaches the finally block and
invokes client.close().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 733191d1-a2de-4cf7-92f5-a997c77f0c61
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
cli/package.jsonmcp/package.jsonmcpjam-inspector/package.jsonsdk/package.jsonsdk/tests/zod-describe-preservation.test.ts
Internal previewPreview URL: https://mcp-inspector-pr-3399.up.railway.app |
…client Address CodeRabbit review: `client.connect(transport)` ran before the try/finally, so a rejected connection skipped `client.close()`. Move the connect inside the try so partial transport setup is torn down even when the handshake fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fdbef0887
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "xml-crypto": "^6.1.2", | ||
| "xpath": "^0.0.34", | ||
| "zod": "^4.1.12" | ||
| "zod": "^4.2.0" |
There was a problem hiding this comment.
Add a changeset for the releaseable dependency bump
This updates releaseable packages (@mcpjam/sdk, @mcpjam/cli, and @mcpjam/inspector) but does not add a .changeset entry, even though .changeset/README.md:3-5 says Changesets are used for npm package publication. With this commit as-is, the release workflow's npx changeset status preflight fails with Some packages have been changed but no changesets were found, blocking publication of the bumped manifests from main; add a changeset for these package changes, or an empty one only if this is intentionally unreleased.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in a0dc6fa — added .changeset/zod-4-2-bump.md (patch for @mcpjam/sdk, @mcpjam/cli, @mcpjam/inspector) so the dependency bump releases through the normal changesets flow.
The bump touches releaseable packages (@mcpjam/sdk, @mcpjam/cli, @mcpjam/inspector); add a patch changeset so the version bump is released via the normal changesets flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Below zod 4.2.0, the MCP SDK's
~standard.jsonSchemaself-conversion path silently drops.describe()annotations on tool/prompt input schemas whenever MCPJam is acting as an MCP server (mcp/, cli/ MCP-server surfaces). This bumps zod to^4.2.0across every workspace so served tool/prompt descriptions stop disappearing on the wire.zoddependency andoverridesentries (both matter — npm keeps resolving the old range if only one is bumped) in:sdk/package.json(dependencies + overrides)cli/package.jsonmcp/package.jsonmcpjam-inspector/package.json(dependency + overrides)package-lock.jsonvia a cleannpm install.npm ls zod --allnow resolveszod@4.3.6everywhere in scope (satisfies^4.2.0); the only other zod version present iszod@3.25.76, pulled in transitively by the harness-claude-code/harness-codex canary AI SDK dependency chain — unrelated to this bump and out of scope.examples/**were intentionally left untouched (not npm workspaces).sdk/tests/zod-describe-preservation.test.ts) that registers a tool with az.string().describe("SOME_DESCRIPTION")input on an in-testMcpServer, round-trips it through a realcreateMcpHandler+Client/StreamableHTTPClientTransportconnection, and asserts the description survives onto the wiretools/listinputSchema.z.toJSONSchemacall sites (mcpjam-tool-helpers.ts,model-request-payload.ts,mcp-http-bridge.ts) — these callz.toJSONSchemadirectly rather than going through the SDK's internal~standard.jsonSchemapath, so no code changes were needed there; they compile and behave identically.Decisions to review
mcp/src/generated/McpAppsHtml.bundled.tsdiff. Runningnpm run typecheckregenerates this bundled-HTML artifact as a side effect, and it came out with a large unrelated diff (build-hash/minification drift, not a functional change — this bundle doesn't consume zod). I checked it back out to keep this PR scoped to the zod bump; if the repo wants this regenerated, that should be its own PR.zod@3.25.76tree alone. It's pulled in by@ai-sdk/harness-claude-code/@ai-sdk/harness-codexcanary dependencies (their ownai@7.0.0-canary.176/@ai-sdk/provider-utils@5.0.0-canary.48pin zod v3), which is a separate major version and outside this PR's "bump the v4 line to 4.2.0" scope.npm cache clean --forcefreed space and a clean re-run of the full test suite passed (877 files / 9540 tests, 0 failures). Flagging in case the same transient[vitest-worker]: Timeout calling "fetch"symptom shows up in CI on a loaded runner.Test plan
npm run typecheck(root) — exit 0, no new errors (only the pre-existing gitignoredHarnessPageBundle.generated.ts/ unrelated deprecation warnings, noresourceMetadataUrlerrors surfaced in this run)npm run test(root) — exit 0 on a clean run: sdk 140/140 test files (2461 passed, 1 skipped, includes the new regression test), inspector 877/879 test files (9540 passed, 6 skipped), cli/mcp/design/chatui/widget all greennpm run build:inspector— exit 0🤖 Generated with Claude Code
Note
Low Risk
Dependency-only bump with a targeted regression test; no auth or runtime logic changes beyond restored tool schema descriptions on the wire.
Overview
Raises
zodto^4.2.0(lockfile resolves to 4.3.x) insdk,cli,mcp, andmcpjam-inspector, including matchingoverrideswhere the repo pins the v4 line. Rootpackage-lock.jsonis regenerated; a changeset marks patch releases for@mcpjam/sdk,@mcpjam/cli, and@mcpjam/inspector.The bump fixes MCP server tool listing where, below 4.2.0, Zod
.describe()text on toolinputSchemafields could be dropped when the MCP SDK converts schemas fortools/list. No application code changes—only dependency alignment plus coverage.Adds
sdk/tests/zod-describe-preservation.test.ts, which registers a tool with a described field, round-trips throughcreateMcpHandlerand a real client, and asserts the description appears on the wireinputSchema.Reviewed by Cursor Bugbot for commit a0dc6fa. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Bumps
zodto ^4.2.0 across all workspaces to stop.describe()annotations from being dropped during JSON Schema conversion in MCP server paths. Restores tool/prompt descriptions on the wire.Bug Fixes
sdk/tests/zod-describe-preservation.test.tsto verify a described input field retains its description through a real server/client round-trip.client.connect(...)insidetrysoclient.close()always runs if the handshake fails.Dependencies
zoddependency andoverridesto^4.2.0insdk,cli,mcp, andmcpjam-inspector.package-lock.json; added.changeset/zod-4-2-bump.mdfor patch releases in@mcpjam/sdk,@mcpjam/cli, and@mcpjam/inspector.examples/**unchanged; unrelated transitivezod@3.xfrom@ai-sdk/*remains.Written for commit a0dc6fa. Summary will update on new commits.