Skip to content

Update MCP SDK to 1.29.0 and adapt CLI for zod 4 compatibility#24

Open
Nemo64 wants to merge 4 commits into
mainfrom
claude/fix-security-issues-78Frt
Open

Update MCP SDK to 1.29.0 and adapt CLI for zod 4 compatibility#24
Nemo64 wants to merge 4 commits into
mainfrom
claude/fix-security-issues-78Frt

Conversation

@Nemo64

@Nemo64 Nemo64 commented May 15, 2026

Copy link
Copy Markdown
Member

Summary

Updates the MCP SDK dependency to version 1.29.0 and zod to 4.1.8, then adapts the CLI to work with the new SDK's internal changes and zod 4's schema structure.

Key Changes

  • Dependency Updates: Bumped @modelcontextprotocol/sdk to ^1.29.0, zod to ^4.1.8, @anthropic-ai/mcpb to ^2.1.2, and undici to ^7.25.0
  • Added supply-chain hardening: New .npmrc with min-release-age=7 to mitigate fast-moving supply-chain attacks
  • Added dependency override: tmp pinned to ^0.2.5 to clear remaining transitive advisories
  • CLI schema extraction: Added extractShape() helper to handle zod 4's new schema internals (_zod.def.shape in addition to _def.shape)
  • CLI schema validation: Added safeParseSchema() helper to safely validate schemas across different zod versions
  • Tool handler updates: Updated tool invocation to use new handler property (replacing callback) and pass required extra argument with signal, requestId, sendNotification, and sendRequest
  • Improved error reporting: Enhanced parameter validation error messages to show detailed issue information
  • Schema description extraction: Updated to handle zod 4's nested description locations (_zod.def.description)

Notable Implementation Details

  • The extractShape() function handles multiple zod schema internals to maintain compatibility
  • The safeParseSchema() function gracefully falls back when schema parsing isn't available
  • Tool handlers now receive an extra object with mock implementations for CLI testing (AbortController signal, mock sendNotification/sendRequest)
  • All changes maintain backward compatibility with the CLI interface while supporting the new SDK structure

https://claude.ai/code/session_01GVKRpcCMzbX1zuyJsusN1p

claude added 4 commits May 12, 2026 09:06
- @modelcontextprotocol/sdk 1.15.1 -> ^1.29.0 (ReDoS, cross-client leak,
  DNS rebinding)
- @anthropic-ai/mcpb 1.1.1 -> ^2.1.2 (devDep)
- undici 7.16 -> ^7.25 (devDep; staying on 7.x keeps the MockAgent API
  used by tests stable)
- zod 3.24 -> ^4.1.8 (the new SDK's zod-compat types caused TS2589
  with zod 3 due to the dual zod/v3+zod/v4/core import paths)
- overrides.tmp ^0.2.5 to clear the last transitive low-sev advisory
  coming through mcpb's @inquirer/prompts chain

npm audit is now clean; build and the 31-test suite pass.
The SDK renamed the registered-tool field from `callback` to `handler`
and now passes a second `extra` argument. Zod 4 also moved schema
internals from `_def.shape` to `_zod.def.shape` and `safeParse` is now
exposed via `zod/v4/core`. Adds small zod3/zod4 compat helpers so the
CLI works against both shapes.

Verified end-to-end against live ClickUp: searchSpaces, searchTasks,
getTaskById, getListInfo, getTimeEntries, readDocument.
Skips dependency versions less than a week old during `npm install`
resolution. Most malicious uploads to the npm registry are detected
and yanked within hours, so a short cooldown trades a small amount
of freshness for a meaningful drop in zero-day exposure when bumping
deps (Shai-Hulud-style attacks, the March 2026 axios compromise,
etc).

Requires npm CLI >= 11.10.0; silently ignored on older npm. Only
affects `npm install` (resolution path); `npm ci` keeps installing
exactly from package-lock.json.
The README comparison table and image MIME fix were sitting in
[Unreleased] but actually shipped in v1.6.1 (2026-02-01). v1.6.2
(2026-04-17) wasn't represented at all.

Recreate both sections from the GitHub releases / commit history;
keep only the genuinely upcoming work (security bumps and the cli.ts
update for SDK 1.29) under [Unreleased].
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.

2 participants