Skip to content

chore(deps): Upgrade to Zod v4#923

Merged
yamadashy merged 5 commits intomainfrom
chore/zod4
Oct 25, 2025
Merged

chore(deps): Upgrade to Zod v4#923
yamadashy merged 5 commits intomainfrom
chore/zod4

Conversation

@yamadashy
Copy link
Owner

Summary

This PR upgrades Zod from v3.25.76 to v4.1.12 and addresses all breaking changes introduced by Zod v4.

Main Changes

  1. Fixed Zod v4 breaking changes in main codebase:

    • Changed ZodError.errors to ZodError.issues in error handling
    • Removed outer .default({}) from nested object schemas to preserve inner field defaults
    • Added explicit merging logic for tokenCount and output.git in config loading
    • Updated test expectations for schema validation
  2. Maintained MCP SDK compatibility (Zod v3):

    • MCP SDK v1.20.1 requires zod@^3.23.8
    • Used import { z } from 'zod/v3' for runtime compatibility
    • Applied @ts-nocheck to MCP files due to type-level incompatibility
    • Created src/mcp/tsconfig.json for improved IDE experience
  3. Dual Zod version strategy:

    • Main codebase (src/): Zod v4
    • MCP integration (src/mcp/): Zod v3 (via zod/v3 subpath)
    • Will be unified when MCP SDK adds Zod v4 support

Technical Details

Zod v4 Breaking Changes Addressed:

  1. ZodError.errorsZodError.issues (src/shared/errorHandle.ts)

    • Zod v4 renamed the errors property to issues
  2. Nested .default({}) behavior change (src/config/configSchema.ts)

    • In Zod v4, outer .default({}) overrides inner field defaults
    • Removed outer defaults from: input, output, output.git, ignore, security, tokenCount
    • Inner field defaults (e.g., encoding: z.string().default('o200k_base')) are preserved
  3. Config merging logic (src/config/configLoad.ts)

    • Added explicit merging for tokenCount and output.git objects
    • Previously handled automatically by outer .default({})

MCP SDK Compatibility:

  • TypeScript's exclude doesn't work for files imported by other TypeScript files
  • src/mcp/mcpAction.ts imports MCP tool files, preventing exclusion from type checking
  • @ts-nocheck is necessary due to type-level incompatibility between Zod v3 and v4
  • Investigation showed that fine-grained @ts-expect-error would require extensive handler function refactoring

Testing

  • ✅ All 800 tests passing
  • ✅ All lint checks passing (biome, oxlint, TypeScript, secretlint)
  • ✅ Runtime behavior verified

Future Work

When MCP SDK supports Zod v4:

  1. Remove zod/v3 imports from src/mcp/ files
  2. Remove @ts-nocheck comments
  3. Use unified import { z } from 'zod' throughout the codebase

Track MCP SDK Zod v4 support: https://github.com/modelcontextprotocol/typescript-sdk/issues

Checklist

  • Run npm run test
  • Run npm run lint

Zod v4への対応を完了しました。

主な変更:
- package.json: Zod v3.25.76 → v4.1.12にアップグレード
- ZodError.errors → ZodError.issuesに変更(Zod v4の破壊的変更)
- configSchemaでネストされたオブジェクトの外側の.default({})を削除
  (Zod v4では外側のdefaultが内側のdefaultを上書きするため)
- configLoadでtokenCountとoutput.gitのマージ処理を追加
- テストの期待値を修正(空オブジェクトのパースが失敗するように)

MCP SDK互換性の対応:
- MCP SDKはZod v3を使用しているため、src/mcp配下でzod/v3をインポート
- src/mcp/tsconfig.jsonを作成し、型チェックを緩和(noImplicitAny: false)
- TypeScriptの制限(importされたファイルはexcludeできない)により、
  MCPツール・プロンプトファイルに@ts-nocheckを追加
- repomixOutputStyleSchemaの代わりにz.enum()を直接使用
- biome-ignoreコメントを追加してas any使用箇所のlintエラーを抑制

すべてのテスト(800テスト)とlintチェックが成功しています。
Copilot AI review requested due to automatic review settings October 25, 2025 13:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Upgraded Zod from major version 3 to version 4, with MCP tools maintaining v3 compatibility through a compatibility layer. Restructured configuration schema defaults and fixed error handling to use Zod v4's error.issues property. Updated TypeScript configuration to exclude MCP directory.

Changes

Cohort / File(s) Summary
Zod dependency upgrade
package.json
Upgraded zod from ^3.25.76 to ^4.1.12 (major version bump)
Configuration schema and defaults
src/config/configSchema.ts, src/config/configLoad.ts
Restructured default schema definitions to remove nested defaulted blocks; updated config merging to explicitly handle output.git and add top-level tokenCount object
Zod v3 compatibility in MCP prompts
src/mcp/prompts/packRemoteRepositoryPrompts.ts
Changed Zod import to zod/v3 with ts-nocheck directive for compatibility
Zod v3 compatibility in MCP tools
src/mcp/tools/attachPackedOutputTool.ts, src/mcp/tools/fileSystemReadDirectoryTool.ts, src/mcp/tools/fileSystemReadFileTool.ts, src/mcp/tools/grepRepomixOutputTool.ts, src/mcp/tools/readRepomixOutputTool.ts
Changed Zod import to zod/v3, added ts-nocheck directives, cast input/output schemas to any with biome-ignore comments
Zod v3 compatibility + schema consolidation in MCP tools
src/mcp/tools/packCodebaseTool.ts, src/mcp/tools/packRemoteRepositoryTool.ts
Changed Zod import to zod/v3, replaced repomixOutputStyleSchema with inline enum validation, cast schemas to any with biome-ignore comments
Zod v3 compatibility in MCP runtime
src/mcp/tools/mcpToolRuntime.ts
Added ts-nocheck directive for Zod v3 compatibility
Zod v4 error handling
src/shared/errorHandle.ts
Updated validation error handling to read error.issues instead of error.errors for Zod v4 compatibility
TypeScript configuration
src/mcp/tsconfig.json, tsconfig.json
Created new MCP-specific tsconfig with permissive settings; added src/mcp/\\ to root tsconfig exclude list
Configuration schema tests
tests/config/configSchema.test.ts
Updated default schema test to expect parsing failure on empty config instead of success

Sequence Diagram(s)

sequenceDiagram
    participant Main as Main Code (Zod v4)
    participant Config as Config Schema
    participant MCP as MCP Tools (Zod v3 compat)
    participant Runtime as Runtime Execution

    Main->>Config: Parse configuration with Zod v4
    Config->>Config: Merge input, output.git, tokenCount
    Config-->>Main: Return merged config
    
    Main->>Runtime: Initialize application
    Runtime->>MCP: Register MCP tools
    MCP->>MCP: Import from zod/v3 layer
    MCP->>MCP: Cast schemas to any
    MCP-->>Runtime: Tool registration complete
    
    Runtime->>Runtime: Validate inputs using Zod v4
    Note over Runtime: error.issues (v4 format)
    Runtime-->>Main: Validation result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Zod v4 migration complexity: Multiple interconnected changes across configuration, error handling, and MCP tool layers require understanding the v3/v4 compatibility strategy
  • Schema restructuring logic: Configuration merging changes in configLoad.ts and schema defaults in configSchema.ts need verification for correctness
  • Type casting patterns: Extensive use of as any casts in MCP tools as a workaround requires review to ensure they are temporary/necessary and don't mask actual issues
  • Test coverage changes: Updated schema test expectations align with new defaults but should be verified to match intended behavior
  • Cross-file consistency: The compatibility layer approach across multiple MCP tool files follows a consistent pattern but needs verification that exclusions in tsconfig.json properly isolate the MCP directory from strict type checking

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "chore(deps): Upgrade to Zod v4" directly and accurately reflects the main change in the changeset, which is the upgrade of the zod dependency from v3.25.76 to v4.1.12 in package.json. The title is concise, follows conventional commit format, and is specific enough that a teammate reviewing the git history would immediately understand that this PR involves upgrading Zod to version 4. While the changeset also includes fixes for Zod v4 breaking changes across multiple files, the primary change from a dependency management perspective is the version upgrade itself, which the title appropriately captures.
Description Check ✅ Passed The PR description fully satisfies the repository's description template requirements. It includes a comprehensive summary of changes that explains the Zod upgrade, the breaking changes addressed, and the MCP SDK compatibility strategy. Additionally, the checklist section is complete with both required items marked as finished: "Run npm run test" and "Run npm run lint" are both checked off with verification that all 800 tests and lint checks passed. The description goes well beyond the minimal template requirements by providing detailed technical explanations, testing verification, and future work plans, making it easy for reviewers to understand the scope and impact of the changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the Zod library to its latest major version (v4.1.12), incorporating necessary code adjustments for breaking changes while ensuring continued compatibility with the Model Context Protocol (MCP) SDK by maintaining a dual-version strategy for Zod. The update improves schema validation and error handling across the main codebase, with a clear path for future unification once the MCP SDK supports Zod v4.

Highlights

  • Zod Upgrade: Upgraded the Zod library from v3.25.76 to v4.1.12, incorporating all necessary adjustments for breaking changes.
  • Breaking Change Handling: Addressed Zod v4 breaking changes, including updating ZodError.errors to ZodError.issues and modifying schema definitions to account for changes in nested .default({}) behavior.
  • MCP SDK Compatibility: Maintained compatibility with the Model Context Protocol (MCP) SDK, which still relies on Zod v3, by implementing a dual-version strategy using import { z } from 'zod/v3' for MCP-related files.
  • TypeScript Configuration: Introduced a dedicated src/mcp/tsconfig.json and applied @ts-nocheck comments to MCP files to manage type-level incompatibilities between Zod v3 and v4, improving the IDE experience.
  • Config Merging Logic: Implemented explicit merging logic for tokenCount and output.git in config loading, which was previously handled implicitly by Zod v3's default behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades Zod from v3.25.76 to v4.1.12 and addresses breaking changes in Zod v4 while maintaining backward compatibility for MCP SDK which requires Zod v3.

Key Changes

  • Updated Zod API usage: changed ZodError.errors to ZodError.issues throughout error handling
  • Modified config schema to remove outer .default({}) wrappers which now override inner field defaults in Zod v4
  • Implemented dual Zod version strategy using zod/v3 subpath imports for MCP files

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updated Zod dependency from ^3.25.76 to ^4.1.12
src/shared/errorHandle.ts Changed ZodError.errors to ZodError.issues for Zod v4 compatibility
src/config/configSchema.ts Removed outer .default({}) from nested objects to preserve inner field defaults
src/config/configLoad.ts Added explicit merging logic for git and tokenCount nested objects
tests/config/configSchema.test.ts Updated test to expect empty config to throw validation error
src/mcp/tsconfig.json Created separate TypeScript config for MCP files with relaxed compiler options
src/mcp/tools/*.ts Added @ts-nocheck, switched to zod/v3 imports, and added type assertions for MCP SDK compatibility
src/mcp/prompts/packRemoteRepositoryPrompts.ts Added @ts-nocheck and switched to zod/v3 import

@codecov
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

❌ Patch coverage is 89.18919% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.32%. Comparing base (876fe8a) to head (da90167).

Files with missing lines Patch % Lines
src/config/configLoad.ts 82.60% 4 Missing ⚠️
src/mcp/tools/packCodebaseTool.ts 57.14% 3 Missing ⚠️
src/mcp/tools/packRemoteRepositoryTool.ts 57.14% 3 Missing ⚠️
src/mcp/tools/attachPackedOutputTool.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #923      +/-   ##
==========================================
+ Coverage   74.60%   75.32%   +0.71%     
==========================================
  Files         111      111              
  Lines        7782     7793      +11     
  Branches     1450     1454       +4     
==========================================
+ Hits         5806     5870      +64     
+ Misses       1976     1923      -53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an excellent and thorough pull request for upgrading Zod to v4. The detailed summary of breaking changes and the dual-version strategy for maintaining compatibility with the MCP SDK is well-documented and clearly explained. The code changes are consistent with the plan, addressing schema updates, error handling, and configuration merging correctly. The addition of a separate tsconfig.json for the MCP directory is a smart solution for improving the developer experience during this transition period. I have one high-severity suggestion regarding a potential side-effect in the configuration merging logic, which could lead to hard-to-debug issues. Other than that, this is a high-quality contribution.

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

Pull Request Review: Zod v4 Upgrade

Summary

This PR successfully upgrades Zod from v3.25.76 to v4.1.12 while maintaining MCP SDK compatibility through a dual-version strategy. The approach is well-documented and the changes are thorough. All tests pass (800+) and the implementation addresses all Zod v4 breaking changes.

✅ Strengths

  1. Excellent documentation: The PR description is comprehensive and explains the rationale clearly
  2. Thorough testing: All 800 tests passing confirms no regressions
  3. Well-structured approach: The dual Zod version strategy is pragmatic given MCP SDK constraints
  4. Complete breaking change coverage: All three Zod v4 breaking changes are properly addressed

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

🔍 Code Quality Review - MCP SDK Compatibility Strategy

Files: src/mcp/tools/*.ts, src/mcp/tsconfig.json

Current Approach

  • Using import { z } from "zod/v3" in MCP files
  • Adding @ts-nocheck to bypass type-level incompatibilities
  • Creating src/mcp/tsconfig.json with relaxed settings
  • Using "as any" for schema shape assignments

⚠️ Major Concerns

  1. @ts-nocheck is too broad: Disables ALL type checking, potentially hiding real bugs in MCP tool implementations

  2. Runtime vs Type-level compatibility: The PR states "runtime compatibility" works but types don't, suggesting the zod/v3 subpath exports might not have proper TypeScript definitions

  3. as any casts: Lines like "inputSchema: packCodebaseInputSchema.shape as any" bypass type safety entirely

💡 Better Alternatives

Option 1: More targeted suppression
Instead of @ts-nocheck, use specific @ts-expect-error comments only where Zod types conflict

Option 2: Type adapter functions
Create a helper function to bridge Zod v3/v4 schema shape types. This documents the type bridge in one place and makes the pattern reusable.

Option 3: Compatibility layer
Create src/mcp/zod-compat.ts that exports { z } from "zod/v3" and have all MCP files import from this single compatibility layer.

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

🔍 Code Quality Review - TypeScript Configuration

File: src/mcp/tsconfig.json

⚠️ Critical Concern

The configuration disables strict and noImplicitAny, which is very permissive:

  • Implicit any types everywhere
  • No null/undefined checking
  • this can be any
  • No strict function types

This essentially turns off TypeScript's most valuable safety features for the entire src/mcp/ directory and could hide bugs that only manifest at runtime.

💡 Recommendation

Try a middle ground approach:

  • Keep "strict: true" for safety
  • Keep "skipLibCheck: true" to skip node_modules checking
  • Use targeted @ts-expect-error only where Zod types conflict

This maintains type safety while working around the specific Zod v3/v4 incompatibility.

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

🧪 Test Coverage & Security

Current Coverage: ✅ Excellent

  • 800+ tests passing
  • All lint checks passing
  • No regressions detected

🔒 Security Review: ✅ No concerns

  • Changes are purely dependency upgrade and configuration
  • Security checks (enableSecurityCheck) remain enabled by default
  • No new attack surface introduced

📋 Recommended Additional Tests

  1. Partial config merging - Test that nested defaults are preserved when file config only has partial properties
  2. Nested git config overrides - Test that CLI config properly overrides file config for nested git options
  3. Zod error message verification - Document expected error messages for invalid configs to catch if messages become unhelpful

🎯 Performance: ✅ No concerns

  • Zod v4 is generally faster than v3 due to internal optimizations
  • The dual-version approach has negligible runtime overhead
  • Config parsing happens once at startup

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

🎭 Premortem Analysis: Potential Failure Scenarios

Scenario 1: Config Loading Fails with Partial Configs

Risk: Medium
When: User provides config file with only partial nested objects

Mitigation:

  • ✅ Current code handles this via explicit merge in configLoad.ts:179-183
  • ⚠️ Add integration test to verify
  • 💡 Consider improving error messages with custom Zod error map

Scenario 2: MCP SDK Updates Breaking Runtime

Risk: Low (but high impact)
When: MCP SDK updates and changes behavior that zod/v3 subpath depends on

Mitigation:

  • ✅ Good documentation in PR about temporary nature
  • 💡 Add CI check that warns if MCP SDK version changes
  • 💡 Consider E2E tests for MCP tools specifically

Scenario 3: Type Errors Slip Through Due to @ts-nocheck

Risk: Medium - HIGHEST PRIORITY CONCERN
When: Developer modifies MCP tool code

Failure Mode:

  • TypeScript does not catch obvious errors in MCP files
  • Bugs only discovered at runtime or in production
  • Incorrect parameter types passed to functions

Mitigation:

  • 🚨 High Priority: Replace @ts-nocheck with targeted @ts-expect-error
  • 💡 Add runtime validation for critical MCP tool parameters
  • 💡 Add integration tests that actually call MCP tools

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

🎯 Recommendations Summary

High Priority 🔴

  1. Replace @ts-nocheck with targeted suppressions - This is the biggest risk. The current approach disables ALL type checking in MCP files, potentially hiding real bugs.

  2. Add integration tests for partial config merging - Ensure nested defaults work correctly when file configs have partial properties. Test scenarios like:

    • File config with only { output: { style: "markdown" } }
    • File config with nested git options
    • CLI overriding file config for nested objects
  3. Test MCP tools still function at runtime - Add E2E test for at least one tool to ensure the zod/v3 compatibility layer works as expected

Medium Priority 🟡

  1. Add tests for nested git config override scenarios
  2. Document why src/mcp/tsconfig.json disables strict mode
  3. Add smoke test for dual Zod version imports
  4. Consider type adapter functions instead of "as any" casts

Low Priority 🟢

  1. Improve Zod error messages with custom error map
  2. Add migration guide for users with custom schemas
  3. Document the MCP SDK limitation in README or CONTRIBUTING.md

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

✅ Final Verdict: APPROVE with suggestions ✨

This is a solid PR that handles a complex upgrade situation pragmatically. The dual Zod version strategy is a reasonable temporary solution given the MCP SDK constraint. The code changes correctly address all Zod v4 breaking changes, and the extensive test suite provides confidence.

Main Concerns (addressable with follow-up PRs):

  1. The overly broad @ts-nocheck usage potentially hiding bugs
  2. The very permissive TypeScript configuration in src/mcp/
  3. Need for additional integration tests around config merging

However, these do not block this upgrade. The current implementation is functional and well-documented.

What I really liked:

  • ✅ Excellent PR documentation explaining the rationale
  • ✅ All 800 tests passing
  • ✅ Complete handling of Zod v4 breaking changes
  • ✅ Clear future cleanup plan documented
  • ✅ Proper commit message format following Conventional Commits
  • ✅ PR template checklist completed

Great work on the thorough documentation and testing! 🎉

The upgrade path is well-thought-out, and once MCP SDK adds Zod v4 support, the cleanup will be straightforward. This unblocks the project to use Zod v4 features going forward.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (14)
src/mcp/tools/fileSystemReadDirectoryTool.ts (2)

1-1: Zod v3 bridge: keep @ts-nocheck temporary and track removal

The zod/v3 import and file-wide @ts-nocheck look fine for MCP SDK 1.20.x. Please add a TODO linking the SDK issue and plan to remove both once MCP supports Zod 4. Prefer narrower suppressions if feasible.

Also applies to: 6-6


32-35: Add toMcpSchema helper to centralize Zod v3 schema conversion.

The repeated .shape as any pattern occurs 14 times across the 7 modified tool files. Add this helper to src/mcp/tools/mcpToolRuntime.ts:

export const toMcpSchema = <T extends { shape: unknown }>(schema: T) => schema.shape as any;

Then replace all occurrences in:

  • attachPackedOutputTool.ts (lines 260, 262)
  • fileSystemReadDirectoryTool.ts (lines 33, 35)
  • fileSystemReadFileTool.ts (lines 34, 36)
  • grepRepomixOutputTool.ts (lines 89, 91)
  • packCodebaseTool.ts (lines 69, 71)
  • packRemoteRepositoryTool.ts (lines 73, 75)
  • readRepomixOutputTool.ts (lines 45, 47)

This removes 14 redundant biome-ignore comments, centralizes the Zod v3 compatibility concern, and improves maintainability. Since all affected files already import from mcpToolRuntime.ts, no new dependencies are introduced.

src/mcp/tools/fileSystemReadFileTool.ts (2)

1-1: Zod v3 compatibility acknowledged; add cleanup TODO

Same note as other MCP tools: keep a TODO to drop @ts-nocheck and zod/v3 when MCP SDK upgrades.

Also applies to: 6-6


33-36: Consolidate MCP schema casts; minor perf nit on double stat

  • Use a shared toMcpSchema helper instead of .shape as any to reduce duplication (see sibling comment).
  • You call fs.stat(filePath) twice (Lines 65 and 73). Cache the first result to get size and avoid the second call.
- const stats = await fs.stat(filePath);
+ const stats = await fs.stat(filePath);
  if (stats.isDirectory()) { /* ... */ }

- const fileStats = await fs.stat(filePath);
+ const fileStats = stats
src/mcp/tools/attachPackedOutputTool.ts (1)

259-262: Replace .shape as any with a helper

Apply the same toMcpSchema helper here for input/output schema wiring to de-duplicate casts and lint suppressions.

src/config/configSchema.ts (1)

120-125: Validate tokenCount.encoding against known encodings

Casting to TiktokenEncoding hides invalid values. Prefer a guarded schema:

const encodings = ['o200k_base','gpt2','cl100k_base','p50k_base','p50k_edit'] as const;
const encodingSchema = z.enum(encodings);
...
tokenCount: z.object({
  encoding: encodingSchema.default('o200k_base'),
})

Or use z.string().refine(isValidEncoding, 'Unsupported encoding').

src/mcp/tools/packCodebaseTool.ts (3)

1-1: Zod v3 + @ts-nocheck accepted for MCP area

Same guidance: keep a TODO to remove once MCP supports Zod 4; prefer scoped suppressions when possible.

Also applies to: 5-5


43-45: Deduplicate style enum across tools

The style enum is duplicated here and in packRemoteRepositoryTool. Export a shared const (no Zod dependency) to avoid zod v3/v4 mixing:

// src/config/outputStyles.ts
export const repomixOutputStyles = ['xml','markdown','json','plain'] as const;
export type RepomixOutputStyle = typeof repomixOutputStyles[number];

Then:

- style: z.enum(['xml','markdown','json','plain']).default('xml')
+ import { repomixOutputStyles } from '../../config/outputStyles.js';
+ style: z.enum(repomixOutputStyles).default('xml')

69-71: Use helper for MCP schema casts

Replace .shape as any with toMcpSchema(...) as suggested elsewhere.

src/mcp/tools/readRepomixOutputTool.ts (2)

1-1: MCP Zod v3 bridge noted; add cleanup TODO

Consistent with other tools; add TODO to remove @ts-nocheck/zod/v3 when MCP SDK upgrades.

Also applies to: 5-5


45-47: Schema cast helper; minor UX tweak for returned line numbers

  • Swap .shape as any for a toMcpSchema helper.
  • When clamping endLine to file length, the response currently returns the original endLine (possibly > totalLines). Prefer returning the actual applied range:
- startLine: startLine || actualStartLine,
- endLine: endLine || actualEndLine,
+ startLine: actualStartLine,
+ endLine: actualEndLine,

This reflects what was read.

src/mcp/tools/packRemoteRepositoryTool.ts (3)

1-1: OK to use zod/v3 here; keep removal path tracked

Same note: add TODO for deprecation of @ts-nocheck and zod/v3 when MCP updates.

Also applies to: 5-5


47-49: Share style enum with packCodebaseTool

Use a shared repomixOutputStyles const to avoid duplication and cross-version zod coupling (see earlier comment).


73-75: Apply MCP schema cast helper

Replace .shape as any with toMcpSchema(...) for consistency.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 876fe8a and 83d7957.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • package.json (1 hunks)
  • src/config/configLoad.ts (2 hunks)
  • src/config/configSchema.ts (2 hunks)
  • src/mcp/prompts/packRemoteRepositoryPrompts.ts (1 hunks)
  • src/mcp/tools/attachPackedOutputTool.ts (2 hunks)
  • src/mcp/tools/fileSystemReadDirectoryTool.ts (2 hunks)
  • src/mcp/tools/fileSystemReadFileTool.ts (2 hunks)
  • src/mcp/tools/grepRepomixOutputTool.ts (2 hunks)
  • src/mcp/tools/mcpToolRuntime.ts (1 hunks)
  • src/mcp/tools/packCodebaseTool.ts (4 hunks)
  • src/mcp/tools/packRemoteRepositoryTool.ts (4 hunks)
  • src/mcp/tools/readRepomixOutputTool.ts (2 hunks)
  • src/mcp/tsconfig.json (1 hunks)
  • src/shared/errorHandle.ts (1 hunks)
  • tests/config/configSchema.test.ts (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
tests/config/configSchema.test.ts (1)
src/config/configSchema.ts (1)
  • repomixConfigDefaultSchema (76-126)
src/mcp/tools/packCodebaseTool.ts (1)
src/config/configSchema.ts (1)
  • defaultFilePathMap (9-14)
src/mcp/tools/packRemoteRepositoryTool.ts (1)
src/config/configSchema.ts (1)
  • defaultFilePathMap (9-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Lint GitHub Actions
  • GitHub Check: Test with Bun (windows-latest, latest)
  • GitHub Check: Test (windows-latest, 20.x)
  • GitHub Check: Test (ubuntu-latest, 20.x)
  • GitHub Check: Test (windows-latest, 24.x)
  • GitHub Check: Test (windows-latest, 22.x)
  • GitHub Check: claude-review
🔇 Additional comments (16)
src/mcp/tools/mcpToolRuntime.ts (1)

1-1: Temporary compatibility layer noted.

The @ts-nocheck directive is part of the temporary Zod v3 compatibility strategy for MCP SDK. While this file doesn't directly import Zod, the directive may be needed for type consistency when imported by other MCP files.

As noted in the PR objectives, remember to remove this directive when the MCP SDK upgrades to Zod v4.

tests/config/configSchema.test.ts (1)

142-145: LGTM! Test correctly validates stricter schema.

The test now correctly expects repomixConfigDefaultSchema to reject an empty configuration object. This aligns with the schema changes that removed outer .default({}) wrappers, requiring explicit field definitions instead.

src/mcp/prompts/packRemoteRepositoryPrompts.ts (1)

1-3: LGTM! Correct implementation of Zod v3 compatibility.

The file correctly switches to zod/v3 import and adds @ts-nocheck to maintain compatibility with MCP SDK's Zod v3 requirement. This is part of the temporary compatibility layer until the MCP SDK upgrades.

tsconfig.json (1)

22-22: LGTM! Correctly excludes MCP directory.

Excluding src/mcp/** from the main TypeScript configuration is the correct approach, as the MCP directory has its own tsconfig.json with permissive settings for Zod v3 compatibility.

src/mcp/tsconfig.json (1)

1-12: Acceptable as temporary technical debt for MCP SDK compatibility.

This permissive TypeScript configuration (with strict: false and noImplicitAny: false) is necessary for the Zod v3 compatibility layer. However, it reduces type safety for the MCP directory.

As noted in the PR objectives, ensure this configuration is removed when the MCP SDK upgrades to Zod v4. Consider tracking this technical debt:

  • Remove this file when MCP SDK supports Zod v4
  • Remove @ts-nocheck directives from MCP files
  • Remove zod/v3 imports and switch back to zod
  • Re-enable strict type checking for the MCP directory

You may want to create a tracking issue for this cleanup work.

src/shared/errorHandle.ts (1)

111-118: LGTM! Correctly implements Zod v4 breaking change.

The change from error.errors to error.issues is required for Zod v4 compatibility. According to the Zod v4 documentation, the error property was renamed from errors to issues with new standardized issue formats.

Based on library documentation.

src/mcp/tools/grepRepomixOutputTool.ts (3)

1-1: LGTM! Part of Zod v3 compatibility layer.

The @ts-nocheck directive is correctly applied for Zod v3 compatibility with the MCP SDK.


5-5: LGTM! Correct use of Zod v3 import.

The import path zod/v3 correctly maintains compatibility with the MCP SDK's Zod v3 requirement while Zod v4 is installed.


88-91: LGTM! Necessary type coercion for MCP SDK compatibility.

Casting the schema shapes to any is required for compatibility between Zod v3 (used by MCP SDK) and the tool registration API. The biome-ignore comments clearly document this intentional type bypass.

The use of satisfies on lines 167 and 176 maintains internal type safety for the response objects.

package.json (1)

105-105: Zod version 4.1.12 is current and secure.

Verification confirms that 4.1.12 is the latest available version on npm. The only known security advisory for Zod affects versions ≤ 3.22.2 and is not applicable to 4.1.12. The major version upgrade is current and introduces no exposed vulnerabilities.

src/mcp/tools/attachPackedOutputTool.ts (1)

1-1: Consistent with MCP Zod v3 bridge; document removal path

Looks good. Please add a TODO pointing to the MCP SDK issue to remove @ts-nocheck and zod/v3 later.

Also applies to: 6-6

src/config/configSchema.ts (2)

157-165: defaultConfig via parse is solid

Parsing a shaped object to realize nested defaults is correct with Zod 4 and keeps types consistent. LGTM.


77-110: Verify intentional alignment difference between config and MCP tool schemas

The review comment's observation is verified as accurate. Configuration schema (src/config/configSchema.ts:96) defines topFilesLength with .min(0).default(5), while all three MCP tools define it with .min(1).default(10):

  • src/mcp/tools/packCodebaseTool.ts, packRemoteRepositoryTool.ts, attachPackedOutputTool.ts all declare .min(1).optional().default(10)

The difference in min constraints is meaningful: the main config treats 0 as "disable summary" (checked in src/cli/cliReport.ts:16), while MCP tools enforce a minimum of 1. The default discrepancy (5 vs 10) is also real but the design intent is unclear—whether this reflects intentional context-specific defaults or an oversight. Consider documenting the rationale or aligning both to a consistent default for user predictability.

src/config/configLoad.ts (1)

201-205: TokenCount merge looks correct

Merges base, file, and CLI in the expected precedence. LGTM.

src/mcp/tools/packCodebaseTool.ts (1)

91-91: Indexing defaultFilePathMap is safe with enum; good

style is constrained by enum; casting to the map’s key type is acceptable here. LGTM.

src/mcp/tools/packRemoteRepositoryTool.ts (1)

88-88: defaultFilePathMap index is fine

Enum-constrained style plus a type cast is acceptable; LGTM.

Addresses AI reviewer feedback on PR #923:

**Critical fixes:**
- Use structuredClone(defaultConfig) to prevent mutation of global defaults
- Move filePath assignment to merge-time instead of mutating baseConfig
- This prevents side effects in long-running processes and test suites

**Documentation improvements:**
- Add comment explaining Zod v4 nested object initialization pattern
- Expand @ts-nocheck comments in MCP files explaining type incompatibility
- Clarify that the issue extends beyond .shape to handler function signatures

**Test coverage:**
- Add test for nested git config merging (Zod v4 specific behavior)
- Add test to verify defaultConfig immutability
- Add test for tokenCount config merging

All 803 tests passing, all lint checks passing.

Fixes identified by @gemini-code-assist, @coderabbitai, and @claude.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 25, 2025

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: da90167
Status: ✅  Deploy successful!
Preview URL: https://9f64aa35.repomix.pages.dev
Branch Preview URL: https://chore-zod4.repomix.pages.dev

View logs

@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

Code Review: Zod v4 Upgrade

This is an excellent and well-executed upgrade to Zod v4! The PR demonstrates thorough understanding of the breaking changes and implements a pragmatic dual-version strategy for MCP SDK compatibility.


✅ Strengths

1. Excellent Breaking Change Handling

The PR correctly addresses all Zod v4 breaking changes:

  • ZodError.errors → ZodError.issues (src/shared/errorHandle.ts:113): Properly updated
  • Nested default behavior: Correctly removed outer .default({}) and added explicit merging
  • Config initialization (src/config/configSchema.ts:159-167): Properly passes empty nested objects

2. Critical Fix: Prevented defaultConfig Mutation

The use of structuredClone(defaultConfig) (src/config/configLoad.ts:158) is essential and prevents side effects in long-running processes (MCP server) and test suites. The corresponding test validates this behavior.

3. Pragmatic MCP SDK Compatibility Strategy

The dual Zod version approach is well-justified:

  • Main codebase uses Zod v4
  • MCP files use Zod v3 via zod/v3 subpath export
  • Clear migration path when MCP SDK supports Zod v4
  • @ts-nocheck comments are appropriately detailed

4. Comprehensive Test Coverage

All 803 tests passing with new tests for:

  • Nested git config merging (tests/config/configLoad.test.ts:242-256)
  • defaultConfig immutability (tests/config/configLoad.test.ts:258-268)
  • tokenCount config merging (tests/config/configLoad.test.ts:270-277)

⚠️ Potential Issues & Recommendations

1. MCP TypeScript Configuration Concerns (Medium Priority)

Issue: src/mcp/tsconfig.json weakens type safety significantly:

  • noImplicitAny: false allows implicit any types
  • strict: false removes many safety guarantees
  • These settings apply to ALL MCP code, not just Zod compatibility

Recommendation: Consider removing the MCP-specific tsconfig.json since files already use @ts-nocheck. This would:

  1. Make it clear that type checking is intentionally disabled for specific files
  2. Avoid creating a type safety hole for future MCP code
  3. Ensure new MCP files get proper type checking

Alternative: If keeping it, document why and add TODO for removal when MCP SDK supports Zod v4.

2. Config Merging Edge Case (Low Priority)

The IIFE for default filePath (src/config/configLoad.ts:174-179) could be extracted to a helper function for better readability and testability.

3. Documentation Gap (Low Priority)

Consider adding:

  • Comment in package.json explaining the Zod v4/v3 strategy for future maintainers
  • Migration checklist for when MCP SDK supports Zod v4

🔍 Premortem Analysis: Potential Failure Scenarios

Scenario 1: MCP SDK Breaking Changes

  • Risk: Future MCP SDK versions might break Zod v3 compatibility
  • Mitigation: Monitor MCP SDK releases, add dependency constraints if needed

Scenario 2: Runtime Issues from @ts-nocheck

  • Risk: Could hide type errors that become runtime issues
  • Mitigation: Current test coverage (803 tests) provides safety net

Scenario 3: defaultConfig Mutation Edge Cases

  • Risk: structuredClone might fail with non-cloneable objects
  • Mitigation: Current config is purely data (JSON-serializable)

Scenario 4: Long-Running Process Issues

  • Risk: Config behavior might differ in MCP server vs CLI
  • Mitigation: Add integration tests for MCP server config isolation

🎯 Performance & Security

Performance: Negligible impact

  • structuredClone overhead: Minimal (once per invocation)
  • Dual Zod versions: ~40KB bundle increase, acceptable

Security: ✅ No issues identified

  • Config validation still enforced
  • @ts-nocheck doesn't affect runtime
  • No new external dependencies
  • Security checks remain intact

📋 Pre-Merge Checklist

  • All tests passing (803 tests)
  • Lint checks passing
  • Breaking changes documented
  • Backward compatibility maintained
  • Consider: Address MCP tsconfig.json concern
  • Consider: Add package.json comment about Zod versions
  • Optional: Extract IIFE to helper function

🎉 Summary

This is a high-quality PR demonstrating:

  • Deep understanding of Zod v4 breaking changes
  • Pragmatic approach to dependency constraints
  • Excellent test coverage
  • Clear documentation of trade-offs

Recommendation: ✅ Approve with minor suggestions

The core implementation is solid. Main suggestion: reconsider the MCP tsconfig.json approach. Other suggestions are refinements that can be addressed in follow-up PRs.

Great work! 🚀

Replaced structuredClone with a more efficient immutable merge pattern
for config object merging. The new implementation:
- Removes unnecessary deep cloning of the entire defaultConfig
- Uses spread operators to create new objects at each level
- Wraps the output merge in an IIFE for clearer conditional logic
- Sets filePath conditionally on the merged output object

This improves performance by avoiding deep cloning overhead while
maintaining immutability. The mergedOutput is mutated locally within
the IIFE scope, which is safe as it's a newly created object.

All 803 tests pass and lint checks are clean.
Added a test to verify that Zod v4 provides helpful error messages when
required fields are missing from the config schema. The test ensures that
the error message includes "expected object" to help users understand what
went wrong.

This addresses the suggestion from Claude bot to improve test coverage
for error message quality and helps catch regressions in error messaging.
@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

PR Review: Zod v4 Upgrade

Summary

This is a well-executed upgrade to Zod v4 that carefully handles breaking changes while maintaining backward compatibility with the MCP SDK. The implementation demonstrates excellent attention to detail with comprehensive testing and documentation.

✅ Strengths

  1. Thorough Breaking Change Handling: All Zod v4 breaking changes are properly addressed
  2. Smart MCP Compatibility Strategy: The dual-version approach using zod/v3 is pragmatic
  3. Excellent Test Coverage: Critical tests added for nested config merging and immutability
  4. Code Quality Improvements: Clean IIFE pattern maintains immutability without overhead

🔍 Key Observations

MCP TypeScript Configuration

Location: src/mcp/tsconfig.json

The tsconfig with strict: false is pragmatic but relaxes type safety. Consider if @ts-nocheck comments alone would suffice once stable.

Impact: Low - Current approach is well-documented as temporary.

Schema Type Casting Pattern

Location: src/mcp/tools/

The "as any" casts for MCP SDK compatibility create a type safety gap. When migrating to Zod v4, add type tests to verify schema compatibility.

Impact: Low - Well-documented technical debt with clear resolution path.

Config Initialization Pattern

Location: src/config/configSchema.ts:157-167

The explicit nested object initialization is clear but requires manual maintenance. Consider adding tests to verify defaultConfig contains all expected fields.

Impact: Low - Nice-to-have for future maintainability.

🎯 Premortem Analysis

Potential Failure Scenarios

High Priority

Type Mismatches in MCP Tool Handlers

  • Risk: "as any" casts could hide schema incompatibilities
  • Mitigation: Runtime validation in place; consider integration tests

Missing Nested Config Defaults

  • Risk: New nested objects not in defaultConfig initialization
  • Mitigation: Add test verifying all required nested objects present

Medium Priority

MCP SDK Update Side Effects

  • Risk: Minor updates could change type requirements
  • Mitigation: Lock MCP SDK to exact version

Config Merge Order

  • Status: ✅ Already tested

Low Priority

Memory in Long-Running Processes

  • Risk: New objects created on each merge
  • Mitigation: Objects are small, typically created once

🔐 Security & Performance

Security: No concerns - changes are internal schema updates
Performance: Minimal/positive impact - removed structuredClone overhead

🎨 Code Quality

Strengths:

  • ✅ Conventional Commits format
  • ✅ Comprehensive documentation
  • ✅ Proper TypeScript/Zod patterns
  • ✅ Test coverage for new behavior
  • ✅ Immutable config handling
  • ✅ Follows project conventions

✨ Recommendations

Before Merge

  1. ✅ CI passes (per PR description)
  2. Manual test MCP tools with various inputs
  3. Consider integration test for MCP tools

Post-Merge

  1. Monitor for config issues
  2. Track MCP SDK Zod v4 support
  3. Document in CHANGELOG

Future Work

When MCP SDK supports Zod v4:

  • Remove zod/v3 imports
  • Remove @ts-nocheck comments
  • Restore strict tsconfig or remove mcp/tsconfig.json
  • Remove "as any" casts
  • Add type tests for schema compatibility

🎉 Final Verdict

LGTM with confidence! 🚀

This is a high-quality upgrade that:

  • ✅ Properly handles all breaking changes
  • ✅ Has excellent test coverage
  • ✅ Maintains backward compatibility
  • ✅ Is well-documented with clear migration path
  • ✅ Follows project conventions

Risk Level: Low
Confidence: High
Recommendation: Approve and merge

Great work! The iterative improvements based on AI reviewer feedback show excellent attention to detail. 👏

…ration

Replaced zod-to-json-schema with Zod v4's native toJSONSchema() method
for generating JSON Schema from Zod schemas. This eliminates the need
for an external dependency and leverages Zod v4's new built-in feature.

Changes:
- Updated generateSchema.ts to use z.toJSONSchema() with draft-7 target
- Removed direct dependency on zod-to-json-schema (still exists via MCP SDK)
- Simplified the schema generation process

The generated schema remains compatible with the existing format and
all tooling that depends on it.
@claude
Copy link
Contributor

claude bot commented Oct 25, 2025

Code Review: Zod v4 Upgrade

Summary

This is an excellent and well-executed upgrade that handles the Zod v3 to v4 migration thoughtfully. The PR demonstrates strong engineering practices with comprehensive testing, clear documentation, and a pragmatic approach to the MCP SDK compatibility challenge.

Strengths

  1. Thorough breaking change handling: All Zod v4 breaking changes are properly addressed
  2. Smart dual-version strategy: Using zod/v3 subpath for MCP SDK compatibility is pragmatic
  3. Excellent test coverage: Added specific tests for Zod v4 behavior changes
  4. Performance improvement: Using Zod v4 native toJSONSchema() eliminates dependency overhead
  5. Good documentation: Clear comments explain the why behind design decisions

Code Quality Observations

Positive Patterns

  • The IIFE pattern in configLoad.ts:167-186 is clean
  • New tests are well-targeted for Zod v4 specific behavior
  • Immutable merge pattern avoids deep cloning overhead

Potential Issues

  1. Type Safety Gap in MCP Files - Using @ts-nocheck suppresses ALL type checking. Risk: Could hide unrelated type errors. Recommendation: Add TODO comment linking to MCP SDK Zod v4 tracking issue.

  2. Default Config Initialization - If someone adds new nested objects, they must remember to add empty object initialization. Suggestion: Add warning comment in configSchema.ts:159

Security Analysis

No security concerns. No changes to security validation logic, and Zod v4 includes security patches.

Performance

Improvements: Native JSON Schema generation is faster, immutable merge pattern avoids overhead.
Neutral: Dual Zod version adds ~100KB to bundle, but unavoidable.

Premortem Analysis: Potential Failure Scenarios

Scenario 1: MCP SDK Releases Zod v4 Support
Risk: High probability. Impact: Medium. Mitigation: Add GitHub issue tracking MCP SDK Zod v4 support, add TODO in src/mcp/tsconfig.json

Scenario 2: Nested Object Schema Growth
Risk: Medium. Impact: Medium. Mitigation: Test coverage exists, add comment warning

Scenario 3: Type Errors Hidden by @ts-nocheck
Risk: Medium. Impact: Medium. Mitigation: Runtime tests exist, consider ESLint rules

Scenario 4: Zod v4 Breaking Changes
Risk: Low (Zod follows semver). Mitigation: 803 tests, consider exact version pinning

Scenario 5: Complex Nested Config Overrides
Risk: Low. Current State: Handled correctly

Recommendations

Critical (Before Merge): None - the PR is ready to merge

Important (Post-Merge):

  1. Track MCP SDK Zod v4 support: Create GitHub issue and reference in src/mcp/tsconfig.json
  2. Add warning comment in configSchema.ts:159 about nested object initialization

Nice to Have:
3. Consider exact version pinning until Zod v4 matures
4. Automated MCP SDK check script
5. ESLint rules for MCP files

Test Coverage

Excellent - 803 tests passing with specific tests for Zod v4 behavior changes, immutability, and error messages.

Final Verdict

APPROVE

This PR demonstrates exceptional engineering quality with thorough analysis, pragmatic workarounds, comprehensive testing, clear documentation, and performance improvements. The identified issues are minor and mostly relate to future maintenance. The code is production-ready.

Great work on this migration!

@yamadashy yamadashy merged commit 16eb2e6 into main Oct 25, 2025
48 checks passed
@yamadashy yamadashy deleted the chore/zod4 branch October 25, 2025 14:49
yamadashy added a commit that referenced this pull request Dec 3, 2025
MCP SDK 1.24.0 now fully supports Zod v4, allowing us to remove the
compatibility workarounds that were introduced in #923.

Changes:
- Update @modelcontextprotocol/sdk from ^1.22.0 to ^1.24.0
- Remove @ts-nocheck comments from all MCP tool and prompt files
- Change imports from 'zod/v3' to 'zod'
- Remove .shape as any casts and biome-ignore comments
- Pass Zod schemas directly to registerTool() instead of .shape
yamadashy added a commit that referenced this pull request Dec 4, 2025
MCP SDK 1.24.0 now fully supports Zod v4, allowing us to remove the
compatibility workarounds that were introduced in #923.

Changes:
- Update @modelcontextprotocol/sdk from ^1.22.0 to ^1.24.0
- Remove @ts-nocheck comments from all MCP tool and prompt files
- Change imports from 'zod/v3' to 'zod'
- Remove .shape as any casts and biome-ignore comments
- Pass Zod schemas directly to registerTool() instead of .shape
- Remove src/mcp/tsconfig.json (no longer needed without Zod v3)
yamadashy added a commit that referenced this pull request Dec 4, 2025
MCP SDK 1.24.0 now fully supports Zod v4, allowing us to remove the
compatibility workarounds that were introduced in #923.

Changes:
- Update @modelcontextprotocol/sdk from ^1.22.0 to ^1.24.0
- Remove @ts-nocheck comments from all MCP tool and prompt files
- Change imports from 'zod/v3' to 'zod'
- Remove .shape as any casts and biome-ignore comments
- Pass Zod schemas directly to registerTool() instead of .shape
- Remove src/mcp/tsconfig.json (no longer needed without Zod v3)
yamadashy added a commit that referenced this pull request Dec 4, 2025
MCP SDK 1.24.0 now fully supports Zod v4, allowing us to remove the
compatibility workarounds that were introduced in #923.

Changes:
- Update @modelcontextprotocol/sdk from ^1.22.0 to ^1.24.0
- Remove @ts-nocheck comments from all MCP tool and prompt files
- Change imports from 'zod/v3' to 'zod'
- Remove .shape as any casts and biome-ignore comments
- Pass Zod schemas directly to registerTool() instead of .shape
- Remove src/mcp/tsconfig.json (no longer needed without Zod v3)
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