Skip to content

Conversation

@ochafik
Copy link
Collaborator

@ochafik ochafik commented Dec 17, 2025

Summary

  • Change generated schema imports from zod/v4 to standard zod entry point
  • Replace v4-only z.looseObject() with z.object().passthrough() (works in both v3 and v4)
  • Matches MCP TypeScript SDK's approach of supporting both Zod v3.25+ and v4
  • Bump version to 0.2.2

Why

Our peerDependency already claimed to support "zod": "^3.25.0 || ^4.0.0", but the generated schemas used v4-only features:

  • import * as z from "zod/v4" (v4 subpath)
  • z.looseObject() (v4-only API)

This broke users who only had Zod v3.25 installed. Now our schemas work with either version.

Verification

Tested with both Zod versions:

  • ✅ Zod 3.25.76: All schema operations work (parse, safeParse, passthrough)
  • ✅ Zod 4.1.13: All schema operations work (parse, safeParse, passthrough)
  • ✅ All existing tests pass
  • ✅ Build succeeds

🤖 Generated with Claude Code

- Change generated schema imports from `zod/v4` to standard `zod`
- Replace v4-only `z.looseObject()` with `z.object().passthrough()`
- Works with both Zod v3.25+ and v4, matching MCP TS SDK approach
- Bump version to 0.2.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@178

commit: 66933e6

@ochafik ochafik force-pushed the ochafik/zod-version-agnostic branch from b6d649a to 66933e6 Compare December 17, 2025 20:47
@ochafik ochafik changed the title feat: make Zod schemas version-agnostic (v3.25+/v4) chore: bump to 0.2.2 + make Zod schemas version-agnostic (v3.25+/v4) Dec 17, 2025
@ochafik ochafik merged commit 82ab3c8 into main Dec 17, 2025
19 checks passed
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