upgrade MCP SDK to v1.25.1 and Zod to v4.2.1 - #69
Merged
Conversation
- Upgrade @modelcontextprotocol/sdk and zod dependencies - Fix Zod v4 compatibility (z.record() API changes) - Update test mocks for new SDK structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Upgrade MCP SDK to v1.25.1 and Zod to v4.2.1
📋 Summary
Upgrades critical dependencies to their latest versions: MCP SDK from v1.0.1 to v1.25.1 and Zod from v3.22.0 to v4.2.1. Includes compatibility fixes for Zod v4 breaking changes and test mock updates for the new MCP SDK structure.
🎯 Problem
Outdated Dependencies
The project was using outdated versions of critical dependencies:
MCP SDK v1.0.1 (released ~2024)
Zod v3.22.0 (released ~2024)
Breaking Changes
Zod v4 introduced breaking changes:
z.record()API changed - now requires explicit key typez.record(z.unknown())z.record(z.string(), z.unknown())Business Impact
✨ Solution
1. MCP SDK Upgrade (
@modelcontextprotocol/sdk:^1.0.1→^1.25.1)Major Version Upgrade: Significant version jump
New Dependencies Added:
@hono/node-server@^1.19.7- Hono server integrationjose@^6.1.1- JWT/JWE/JWS implementationjson-schema-typed@^8.0.2- Typed JSON schema supportUpdated Dependencies:
zod-to-json-schema@^3.25.0- Updated to latest version^3.25 || ^4.0(supports both v3 and v4)Changes:
zod: ^3.25 || ^4.0(non-optional)Benefits:
2. Zod Upgrade (
zod:^3.22.0→^4.2.1)Major Version Upgrade: Breaking changes addressed
Breaking Changes:
z.record()now requires explicit key type parameterMigration Required:
Benefits:
3. Zod v4 Compatibility Fixes (
config.schema.ts)Updated 4
z.record()calls:TechDetailSchema.config
TechStackConfigSchema.details
ConventionsConfigSchema.rules
CodingBuddyConfigSchema.custom
Impact:
4. Test Mock Updates (
mcp.service.spec.ts)Updated Schema Structure Access:
Before (MCP SDK v1.0.1):
After (MCP SDK v1.25.1+):
Changes:
shape.method._def.valuetodef.shape.method.def.values[0]Impact:
5. Dependency Lock File Updates (
yarn.lock)Updated Entries:
@modelcontextprotocol/sdk: 1.22.0 → 1.25.1zod: 3.25.76 → 4.2.1zod-to-json-schema: 3.24.1 → 3.25.0@hono/node-server@1.19.7jose@6.1.3json-schema-typed@8.0.2Lock File Size:
📁 Files Changed
mcp-server/package.jsonmcp-server/src/config/config.schema.tsz.record()calls)mcp-server/src/mcp/mcp.service.spec.tsmcp-server/yarn.lockmcp-server/.yarn/install-state.gzTotal: 5 files changed, +51 insertions, -22 deletions
🧪 Testing
Compatibility Testing
Type Safety
Integration Testing
🎯 Benefits
1. Latest Features
Access to latest MCP SDK features and improvements.
2. Security Updates
Latest security patches from dependency updates.
3. Performance Improvements
Zod v4 performance improvements benefit validation.
4. Better Type Safety
Explicit key types in
z.record()improve type safety.5. Future-Proof
Staying current with dependency versions prevents technical debt.
6. Compatibility
Compatible with latest MCP protocol specifications.
7. Maintainability
Easier to maintain with current dependencies.
📖 Code Examples
Zod v4 Migration
Test Mock Update
🔗 Related Documentation
📝 Design Decisions
Why Upgrade Both Dependencies Together?
Why Explicit Key Types?
Why Update Test Mocks?
✅ Acceptance Criteria
z.record()calls updated for Zod v4 compatibility🚀 Impact
Dependency Versions
Code Changes
z.record()calls updatedPerformance
💡 Future Enhancements
Potential Improvements
📊 Before/After Comparison
Before
z.record()without key typesAfter
z.record()with explicit key types🎓 Lessons Learned
Best Practices
Common Patterns