- Symptom
- TS2589: Type instantiation is excessively deep and possibly infiniteThe error points at an unrelated-looking registerTool or ToolCallback call site
- Cause
- Two copies of zod in the dependency tree make TypeScript instantiate cross-version schema types until it hits its recursion limit.
- Fix
- Align the project on one Zod 4 version and force it with an override when a transitive dependency pins another copy.
- Apply
// package.json "overrides": { "zod": "^4.2.0" } // verify: npm ls zod- Affected
- @modelcontextprotocol/sdk 1.x and @modelcontextprotocol/server 2.x with mixed zod versions, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders