Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Zod 4 is now stable and bring a lot of performance optimization, it’s time to use it for mcp to benefit from this.
https://zod.dev/v4
How Has This Been Tested?
I only run the unit tests locally
Breaking Changes
The user zod schemas are now using
zod@4instead ofzod@3Here are the list of breaking changes -> https://zod.dev/v4/changelog?id=default-updatesYou can also run
npx zod-v3-to-v4to migrate your existing projects (https://github.com/nicoespeon/zod-v3-to-v4)Types of changes
Checklist
Additional context
Zod 4 introduces two new concepts: Registries and JSON schema. Those both features were used to provide a better implementation (I hope)
The regitry is used to provide the metadata required for
completable, the types are following but so far I needed to add a ts-ignore to make typescript happy. Any help will be appreciated to fix this but I’m not sure it’s worth it.