fix: temporary fix, revert zod schema definitions for mcp tools to zod v3#1323
fix: temporary fix, revert zod schema definitions for mcp tools to zod v3#1323Crunchyman-ralph merged 3 commits intonextfrom
Conversation
…d v3 - because of an issue with the mcp spec we had to use zod v3 for mcp tool parameters
🦋 Changeset detectedLatest commit: 7605810 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughSwitches MCP tool imports from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Changes are high-volume but homogeneous (mostly identical import path updates and added explanatory comments), plus two documentation and one small configuration change. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review, Also make sure the config is correct so that you're reviewing every single PR created, no matter the branch the PR is merging into |
🧩 Analysis chain@Crunchyman-ralph: I'll review this PR and check the configuration to ensure all PRs are reviewed regardless of target branch. Let me first fetch the current configuration to verify the settings: I'll also trigger the review: Once I receive the configuration information, I'll confirm whether any changes are needed to ensure all PRs are reviewed regardless of their target branch. 🛠 Debug Information Gathered @Crunchyman-ralph: Good news! Your CodeRabbit configuration is already set up correctly to review every PR regardless of the target branch. Looking at your current configuration: reviews:
auto_review:
enabled: true
base_branches:
- .*The I'll proceed with reviewing this PR now. ✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (5)
mcp-server/src/tools/initialize-project.js (1)
1-1: LGTM: Import migration is correct.The migration to
zod/v3is necessary and correctly applied. Consider creating a tracking issue to revert this workaround once the MCP spec/FastMCP supports Draft 2020-12 JSON Schema from zod v4.Would you like me to help draft a tracking issue for reverting this temporary workaround in the future?
mcp-server/src/tools/copy-tag.js (1)
6-6: Import path updated consistently; track as technical debt.This change is part of the temporary workaround. Consider creating a tracking issue to revert to standard 'zod' imports once FastMCP supports zod v4 schemas or the underlying compatibility issue is resolved.
apps/mcp/src/tools/README-ZOD-V3.md (1)
36-36: Consider formatting the URL as a markdown link.While the bare URL is functional, markdown best practices suggest wrapping it in a link for better formatting.
Apply this diff:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: [FastMCP issue #189](https://github.com/punkpeye/fastmcp/issues/189)mcp-server/src/tools/README-ZOD-V3.md (2)
67-67: Consider adding a cross-reference to the apps/mcp README.The corresponding README at
apps/mcp/src/tools/README-ZOD-V3.mdincludes a "See Also" reference. Adding a reciprocal reference here would improve discoverability.Apply this diff:
**Last Updated:** 2025-01-18 **Affects:** All files in `mcp-server/src/tools/` +**See Also:** `apps/mcp/src/tools/README-ZOD-V3.md` (same workaround)
36-36: Consider formatting the URL as a markdown link.While the bare URL is functional, markdown best practices suggest wrapping it in a link for better formatting.
Apply this diff:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: [FastMCP issue #189](https://github.com/punkpeye/fastmcp/issues/189)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (49)
.changeset/kind-lines-melt.md(1 hunks).coderabbit.yaml(1 hunks)apps/mcp/src/tools/README-ZOD-V3.md(1 hunks)apps/mcp/src/tools/autopilot/abort.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/commit.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/complete.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/finalize.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/next.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/resume.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/start.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/status.tool.ts(1 hunks)mcp-server/src/tools/README-ZOD-V3.md(1 hunks)mcp-server/src/tools/add-dependency.js(1 hunks)mcp-server/src/tools/add-subtask.js(1 hunks)mcp-server/src/tools/add-tag.js(1 hunks)mcp-server/src/tools/add-task.js(1 hunks)mcp-server/src/tools/analyze.js(1 hunks)mcp-server/src/tools/clear-subtasks.js(1 hunks)mcp-server/src/tools/complexity-report.js(1 hunks)mcp-server/src/tools/copy-tag.js(1 hunks)mcp-server/src/tools/delete-tag.js(1 hunks)mcp-server/src/tools/expand-all.js(1 hunks)mcp-server/src/tools/expand-task.js(1 hunks)mcp-server/src/tools/fix-dependencies.js(1 hunks)mcp-server/src/tools/generate.js(1 hunks)mcp-server/src/tools/get-operation-status.js(1 hunks)mcp-server/src/tools/get-task.js(1 hunks)mcp-server/src/tools/get-tasks.js(1 hunks)mcp-server/src/tools/initialize-project.js(1 hunks)mcp-server/src/tools/list-tags.js(1 hunks)mcp-server/src/tools/models.js(1 hunks)mcp-server/src/tools/move-task.js(1 hunks)mcp-server/src/tools/next-task.js(1 hunks)mcp-server/src/tools/parse-prd.js(1 hunks)mcp-server/src/tools/remove-dependency.js(1 hunks)mcp-server/src/tools/remove-subtask.js(1 hunks)mcp-server/src/tools/remove-task.js(1 hunks)mcp-server/src/tools/rename-tag.js(1 hunks)mcp-server/src/tools/research.js(1 hunks)mcp-server/src/tools/response-language.js(1 hunks)mcp-server/src/tools/rules.js(1 hunks)mcp-server/src/tools/scope-down.js(1 hunks)mcp-server/src/tools/scope-up.js(1 hunks)mcp-server/src/tools/set-task-status.js(1 hunks)mcp-server/src/tools/update-subtask.js(1 hunks)mcp-server/src/tools/update-task.js(1 hunks)mcp-server/src/tools/update.js(1 hunks)mcp-server/src/tools/use-tag.js(1 hunks)mcp-server/src/tools/validate-dependencies.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
mcp-server/src/tools/*.js
📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)
MCP server tools in mcp-server/src/tools/*.js must have their execute methods wrapped with the withNormalizedProjectRoot higher-order function from tools/utils.js to ensure consistent path handling.
mcp-server/src/tools/*.js: MCP tools must follow a specific structure: use server.addTool with snake_case tool names, define parameters using Zod, and implement the execute function as an async function.
All MCP tool execute methods that require access to the project root MUST be wrapped with the withNormalizedProjectRoot Higher-Order Function (HOF) from mcp-server/src/tools/utils.js.
MCP tools should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.
Use camelCase with Tool suffix for tool registration functions in mcp-server/src/tools/.
Use snake_case for tool names exposed to MCP clients in server.addTool definitions.
Log the start of execution with arguments (sanitized if sensitive), log successful completion with result summary, log all error conditions with appropriate log levels, and include the cache status in result logs in MCP tool files.
Do not log entire large data structures or sensitive information in MCP tool files.
Use handleApiResult to format and return the response from MCP tools.
mcp-server/src/tools/*.js: Create tool definitions in 'mcp-server/src/tools/', use Zod for parameter validation, include optional tag parameter for multi-context support, and follow established naming conventions.
For long-running operations that should not block the client, use the AsyncOperationManager in MCP tools and implement progress reporting.
Files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/update-subtask.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/get-tasks.jsmcp-server/src/tools/get-operation-status.jsmcp-server/src/tools/get-task.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/next-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/remove-subtask.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/complexity-report.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/analyze.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/parse-prd.js
mcp-server/src/{tools,core/direct-functions}/*.js
📄 CodeRabbit inference engine (.cursor/rules/mcp.mdc)
mcp-server/src/{tools,core/direct-functions}/*.js: Use kebab-case for all file names in mcp-server/src/tools/ and mcp-server/src/core/direct-functions/.
Use helpers from mcp-server/src/tools/utils.js, mcp-server/src/core/utils/path-utils.js, and mcp-server/src/core/utils/ai-client-utils.js for centralized utilities.
Files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/update-subtask.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/get-tasks.jsmcp-server/src/tools/get-operation-status.jsmcp-server/src/tools/get-task.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/next-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/remove-subtask.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/complexity-report.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/analyze.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/parse-prd.js
mcp-server/src/tools/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/telemetry.mdc)
MCP tool files in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result to handleApiResult(result, log) from mcp-server/src/tools/utils.js, ensuring telemetryData is included in the final MCP response.
Files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/update-subtask.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/get-tasks.jsmcp-server/src/tools/get-operation-status.jsmcp-server/src/tools/get-task.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/next-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/remove-subtask.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/complexity-report.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/analyze.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/parse-prd.js
**/*.js
📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)
**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.
Files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/update-subtask.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/get-tasks.jsmcp-server/src/tools/get-operation-status.jsmcp-server/src/tools/get-task.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/next-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/remove-subtask.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/complexity-report.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/analyze.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/parse-prd.js
mcp-server/src/{core/utils,tools}/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within
mcp-server/src/(e.g., path/core logic helpers inmcp-server/src/core/utils/, tool execution/response helpers inmcp-server/src/tools/utils.js).
Files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/update-subtask.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/get-tasks.jsmcp-server/src/tools/get-operation-status.jsmcp-server/src/tools/get-task.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/next-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/remove-subtask.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/complexity-report.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/analyze.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/parse-prd.js
.changeset/*.md
📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)
.changeset/*.md: When runningnpm run changesetornpx changeset add, provide a concise summary of the changes for theCHANGELOG.mdin imperative mood, typically a single line, and not a detailed Git commit message.
The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.
Do not use your detailed Git commit message body as the changeset summary.
Files:
.changeset/kind-lines-melt.md
.changeset/*
📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)
Create appropriate changesets for new features, use semantic versioning, include tagged system information in release notes, and document breaking changes if any.
Files:
.changeset/kind-lines-melt.md
.changeset/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Changeset entries should be user-facing, describing the end-user impact rather than code specifics
Files:
.changeset/kind-lines-melt.md
🧠 Learnings (11)
📚 Learning: 2025-07-18T17:12:57.903Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to mcp-server/src/tools/*.js : Create tool definitions in 'mcp-server/src/tools/', use Zod for parameter validation, include optional tag parameter for multi-context support, and follow established naming conventions.
Applied to files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/README-ZOD-V3.mdmcp-server/src/tools/delete-tag.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/use-tag.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/generate.jsmcp-server/src/tools/fix-dependencies.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/update.jsmcp-server/src/tools/models.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/response-language.jsmcp-server/src/tools/copy-tag.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : MCP tools must follow a specific structure: use server.addTool with snake_case tool names, define parameters using Zod, and implement the execute function as an async function.
Applied to files:
mcp-server/src/tools/expand-all.jsmcp-server/src/tools/README-ZOD-V3.mdmcp-server/src/tools/add-task.jsmcp-server/src/tools/update-task.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/validate-dependencies.jsmcp-server/src/tools/set-task-status.jsmcp-server/src/tools/add-dependency.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/remove-task.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Follow the provided structure for adding subtasks, including required options and detailed error handling.
Applied to files:
mcp-server/src/tools/add-subtask.js
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Follow the provided structure for adding subtasks, including required and optional options, parameter validation, and detailed error handling.
Applied to files:
mcp-server/src/tools/add-subtask.js
📚 Learning: 2025-10-01T19:53:34.261Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1262
File: scripts/modules/task-manager/update-tasks.js:216-233
Timestamp: 2025-10-01T19:53:34.261Z
Learning: For scripts/modules/task-manager/*.js: Use generateObjectService with Zod schemas for structured AI responses rather than generateTextService + manual JSON parsing, as modern AI providers increasingly support the tool use and generateObject paradigm with improved reliability.
Applied to files:
mcp-server/src/tools/add-task.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Follow the provided structure for removing subtasks, including required options, conversion option, and detailed error handling.
Applied to files:
mcp-server/src/tools/remove-subtask.js
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Follow the provided structure for removing subtasks, including options for conversion, file path, and regeneration, with detailed error handling.
Applied to files:
mcp-server/src/tools/remove-subtask.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/{tools,core/direct-functions}/*.js : Use helpers from mcp-server/src/tools/utils.js, mcp-server/src/core/utils/path-utils.js, and mcp-server/src/core/utils/ai-client-utils.js for centralized utilities.
Applied to files:
mcp-server/src/tools/rules.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : Use snake_case for tool names exposed to MCP clients in server.addTool definitions.
Applied to files:
mcp-server/src/tools/rules.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : Use camelCase with Tool suffix for tool registration functions in mcp-server/src/tools/.
Applied to files:
mcp-server/src/tools/rules.jsmcp-server/src/tools/rename-tag.js
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Extract tasks from PRD documents using AI, create them in the current tag context (defaulting to 'master'), provide clear prompts to guide AI task generation, and validate/clean up AI-generated tasks.
Applied to files:
mcp-server/src/tools/parse-prd.js
🪛 markdownlint-cli2 (0.18.1)
mcp-server/src/tools/README-ZOD-V3.md
36-36: Bare URL used
(MD034, no-bare-urls)
apps/mcp/src/tools/README-ZOD-V3.md
36-36: Bare URL used
(MD034, no-bare-urls)
⏰ 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). (1)
- GitHub Check: Test
🔇 Additional comments (40)
mcp-server/src/tools/delete-tag.js (1)
6-6: Approve import change—zod/v3 export is supported and permanent.Zod 3 continues to be exported from the package root ("zod") as well as a new subpath "zod/v3", and these subpaths will remain available forever. Starting in v3.25.0, the package contains copies of both Zod 3 and Zod 4 at their respective subpaths, so the import will work correctly with zod@^4.1.11 installed. The basic schema API used in this file is compatible between v3 and v4, making this change safe and correct for addressing Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema converter.
mcp-server/src/tools/complexity-report.js (1)
6-6: Now I need to examine the complete file to verify it follows all coding guidelines and confirm the import change is the only modification:The import change from 'zod' to 'zod/v3' is valid and addresses the FastMCP compatibility issue.
Starting in zod v3.25.0, the package contains copies of both Zod 3 and Zod 4 at their respective subpaths, making it easy to support both versions simultaneously. The
zod/v3subpath is an officially documented import mechanism and these are like "permalinks" to their respective Zod versions.FastMCP-TS doesn't yet support Zod v4, which generates JSON Schema 2020-12 that causes validation errors — using the v3 subpath resolves this by generating Draft-07 compatible schemas. This is a recognized temporary workaround while the ecosystem updates to support Zod v4 or Standard Schema.
mcp-server/src/tools/rename-tag.js (1)
6-6: ****The import syntax
import { z } from 'zod/v3'is correct and consistent across the codebase. Zod v4 is published with subpath exports (e.g., "zod/v4", "zod/v3"), and Zod v3 is available at the explicit "zod/v3" subpath. All MCP tools inmcp-server/src/tools/systematically use this import pattern—there is no runtime error, and no changes are needed. The named import syntax{ z }is the supported way to access Zod v3 APIs from the Zod v4 package.Likely an incorrect or invalid review comment.
apps/mcp/src/tools/autopilot/complete.tool.ts (1)
6-6: LGTM: Import migration is correct.The
zod/v3import maintains full compatibility with the existing schema definitions in this tool.apps/mcp/src/tools/autopilot/abort.tool.ts (1)
6-6: LGTM: Import change is consistent.The migration to
zod/v3is applied correctly.mcp-server/src/tools/models.js (1)
6-6: LGTM: Import migration is correct.The schema definitions in this file use only v3-compatible zod APIs.
mcp-server/src/tools/research.js (1)
6-6: LGTM: Import change is correct.mcp-server/src/tools/expand-all.js (1)
6-6: LGTM: Import migration is correct.mcp-server/src/tools/analyze.js (1)
6-6: LGTM: Import migration is correct.The
zod/v3import maintains compatibility with all schema features used in this file, including.coercefor type conversion.mcp-server/src/tools/rules.js (1)
6-6: Import change is verified and correct.Zod v4 supports zod/v3 subpath exports for compatibility, allowing v3 and v4 to coexist in one package. The migration to
zod/v3in this file is appropriate for ensuring Draft-07 JSON Schema compatibility. All zod usage (.object(),.enum(),.array(),.string(),.boolean()) is fully compatible with v3 APIs.apps/mcp/src/tools/autopilot/finalize.tool.ts (1)
6-6: Import path updated consistently.The change aligns with the PR-wide migration to 'zod/v3' for Draft-07 compatibility. The schema definitions remain unchanged, preserving existing validation behavior.
mcp-server/src/tools/move-task.js (1)
6-6: Import path updated consistently.mcp-server/src/tools/add-dependency.js (1)
6-6: Import path updated consistently.mcp-server/src/tools/set-task-status.js (1)
6-6: Import path updated consistently.mcp-server/src/tools/parse-prd.js (1)
6-6: Import path updated consistently.mcp-server/src/tools/get-operation-status.js (1)
2-2: Import path updated consistently.mcp-server/src/tools/update-task.js (1)
6-6: No issues found. The 'zod/v3' import path is valid and supported.Zod 3 will continue to be exported from the package root ("zod") as well as a new subpath "zod/v3", and all other subpaths have not changed and will remain available forever. This subpath is available in zod ^4.1.11, which the project uses, and is the recommended approach for libraries to reference both Zod 3 and Zod 4 in their implementation.
mcp-server/src/tools/add-subtask.js (1)
6-6: LGTM - Consistent with zod/v3 migration.Import path correctly updated for Draft-07 JSON Schema compatibility. All parameter validations (lines 24-64) remain functionally identical.
apps/mcp/src/tools/autopilot/start.tool.ts (1)
6-6: LGTM - TypeScript types remain fully compatible.The zod/v3 import maintains complete TypeScript type inference compatibility. The
z.infer<typeof StartWorkflowSchema>usage at line 37 and all schema definitions (lines 16-35) work identically.mcp-server/src/tools/add-tag.js (1)
6-6: LGTM - Import path correctly updated.Consistent with the repository-wide migration to zod/v3 for Draft-07 JSON Schema compatibility.
mcp-server/src/tools/update.js (1)
6-6: LGTM - Import path correctly updated.Consistent with the repository-wide migration to zod/v3 for Draft-07 JSON Schema compatibility.
mcp-server/src/tools/list-tags.js (1)
6-6: LGTM - Import path correctly updated.Consistent with the repository-wide migration to zod/v3 for Draft-07 JSON Schema compatibility.
mcp-server/src/tools/scope-down.js (1)
6-6: LGTM - Import path correctly updated.Consistent with the repository-wide migration to zod/v3 for Draft-07 JSON Schema compatibility.
mcp-server/src/tools/get-task.js (1)
6-6: LGTM - Import path correctly updated.Consistent with the repository-wide migration to zod/v3 for Draft-07 JSON Schema compatibility.
mcp-server/src/tools/clear-subtasks.js (1)
6-6: Verification confirms the zod/v3 import change is working correctly.The codebase search found no schema validation failures or runtime errors related to the zod/v3 import. The single match discovered was normal zod error handling in an unrelated validator, not a failure caused by this change. The import path update maintains Draft-07 compatibility as intended, and all schema definitions continue to work unchanged.
apps/mcp/src/tools/autopilot/resume.tool.ts (1)
6-6: Import path is valid and fully supported.Zod 4.x supports importing from 'zod/v3' subpath for backwards compatibility. The file uses only stable, core Zod APIs (
z.object(),z.string(),z.describe(),z.infer<>), which are unchanged between Zod 3 and 4. No action required.apps/mcp/src/tools/autopilot/status.tool.ts (1)
6-6: Import path correctly updated to zod/v3.The change maintains consistency with the broader migration across MCP tools. The TypeScript types and zod schema remain unchanged, ensuring no impact on type safety or validation logic.
mcp-server/src/tools/generate.js (1)
6-6: Import path correctly updated to zod/v3.The change is consistent with the PR's compatibility objective. No functional changes to the schema validation.
mcp-server/src/tools/remove-dependency.js (1)
6-6: Import path correctly updated to zod/v3.The change maintains consistency with the repository-wide migration. No impact on validation logic or tool functionality.
mcp-server/src/tools/add-task.js (1)
6-6: Import path correctly updated to zod/v3.The change is properly implemented with no impact on the tool's parameter validation or execution logic.
mcp-server/src/tools/validate-dependencies.js (1)
6-6: Import path correctly updated to zod/v3.The change aligns with the PR's compatibility requirements. No functional changes to validation logic.
mcp-server/src/tools/update-subtask.js (1)
6-6: Import path correctly updated to zod/v3.The change is consistent with the broader migration. Tool functionality and validation logic remain unchanged.
mcp-server/src/tools/next-task.js (1)
6-6: Import path correctly updated to zod/v3.The change is properly implemented and consistent with the repository-wide migration to address MCP spec compatibility issues.
mcp-server/src/tools/get-tasks.js (1)
6-6: Import path updated correctly for zod/v3 compatibility.The change from
'zod'to'zod/v3'is implemented correctly and has been consistently applied across all MCP tool files. Verification confirms:
- All 37 MCP tool files requiring zod validation now use
'zod/v3'- No conflicting plain
'zod'or'zod/v4'imports remain in the tools directory- Three infrastructure files (index.js, tool-registry.js, utils.js) correctly have no zod imports
- The zod API usage remains unchanged, ensuring no impact on validation logic
apps/mcp/src/tools/README-ZOD-V3.md (1)
1-70: Excellent documentation of the temporary workaround.The README clearly explains the problem, solution, rationale, and maintenance guidance. The code examples showing correct vs incorrect usage are particularly helpful for developers adding new MCP tools.
mcp-server/src/tools/response-language.js (1)
1-1: LGTM! Import change aligns with the documented workaround.The change from
zodtozod/v3is correct and consistent with the temporary workaround documented in the README files. This ensures Draft-07 JSON Schema compatibility for MCP clients..changeset/kind-lines-melt.md (1)
1-21: Well-documented changelog entry.The changeset clearly describes the compatibility issue, solution, and temporary nature of the workaround. The reference to issue #1284 provides good traceability. The summary is appropriately user-facing per coding guidelines.
Note: The changelog mentions "Fixed logger to use stderr instead of stdout" but this change isn't visible in the files under review. This is expected if that change was in a different part of the PR.
mcp-server/src/tools/use-tag.js (1)
6-6: LGTM! Import change aligns with the documented workaround.The change from
zodtozod/v3is correct and consistent with the temporary workaround documented in the README files. This ensures Draft-07 JSON Schema compatibility for MCP clients.mcp-server/src/tools/README-ZOD-V3.md (1)
1-67: Excellent documentation of the temporary workaround.The README clearly explains the problem, solution, rationale, and maintenance guidance. The code examples showing correct vs incorrect usage are particularly helpful for developers adding new MCP server tools.
.coderabbit.yaml (1)
4-7: Configuration correctly enables automatic reviews for all branches.The
auto_reviewconfiguration withbase_branches: [".*"]will enable CodeRabbit to review all PRs regardless of their target branch, which aligns with the request in the PR comments. The regex pattern.*correctly matches all branch names.Based on learnings and as per the CodeRabbit configuration schema.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
mcp-server/src/tools/add-task.js (1)
6-8: Same 'zod/v3' import verification needed (duplicate concern).This file uses the same import pattern as move-task.js. The verification script provided in the move-task.js review will confirm whether the 'zod/v3' subpath is valid for the installed zod 4.1.11 package.
The temporary comments and TODO are consistent and properly document the workaround.
🧹 Nitpick comments (14)
apps/mcp/src/tools/autopilot/complete.tool.ts (1)
17-154: LGTM! Schema definitions and tool logic remain unchanged.The schema definitions and tool implementation are correctly preserved. The import change is isolated and doesn't affect runtime behavior or the public API.
However, consider creating a dedicated tracking issue for reverting these temporary changes once the MCP spec issue is resolved. The TODO comment references PR #1323, but a separate issue would make it easier to track when the revert should happen and ensure this temporary fix doesn't become permanent.
Would you like me to open a tracking issue for the revert, or do you prefer to handle this through the existing issue #1284?
mcp-server/src/tools/research.js (1)
6-8: Same 'zod/v3' concern as other tools.Please verify subpath resolution or switch to an alias as suggested in rules.js to avoid runtime/type failures. Good call on truncating logged query for privacy.
mcp-server/src/tools/add-subtask.js (3)
6-8: Verify 'zod/v3' import works in this package.Adopt the alias approach or pin Zod v3 locally if needed, to ensure Draft‑07 generation without brittle imports.
73-73: Avoid logging entire args; log selected fields.Full JSON of args can be noisy and leak paths. Log a concise summary (id, taskId, file) and truncate long strings.
Apply:
- log.info(`Adding subtask with args: ${JSON.stringify(args)}`); + const { id, taskId, file } = args; + log.info(`Adding subtask (id=${id}, taskId=${taskId ?? 'new'}, file=${file ?? 'default'})`);As per coding guidelines.
45-47: Constrain known enums in schema.If subtask status has fixed values, prefer an enum to prevent invalid states.
Example:
- status: z - .string() + status: z + .enum(['pending','in_progress','blocked','done']) .optional()Also applies to: 63-66
mcp-server/src/tools/scope-up.js (2)
6-8: Verify 'zod/v3' subpath import.Same guidance as other files—confirm resolution or use an npm alias for Zod v3 to avoid brittle subpaths.
57-57: Reduce PII/noise in logs.Avoid
JSON.stringify(args). Log selected fields (ids, strength, file) and truncate any user-provided text.- log.info(`Starting scope-up with args: ${JSON.stringify(args)}`); + const { id, strength, file } = args; + log.info(`Starting scope-up (ids=${id}, strength=${strength ?? 'regular'}, file=${file ?? 'default'})`);As per coding guidelines.
mcp-server/src/tools/delete-tag.js (3)
6-8: Confirm 'zod/v3' availability.Please verify this subpath resolves in all environments or switch to an explicit alias (
zod-v3).
27-31: Prefer schema default over runtime default.You can encode the default for
yesdirectly in Zod and simplify execute logic.- yes: z - .boolean() - .optional() - .describe('Skip confirmation prompts (default: true for MCP)'), + yes: z + .boolean() + .optional() + .default(true) + .describe('Skip confirmation prompts (default: true for MCP)'),Then drop the ternary when calling
deleteTagDirect.
41-41: Avoid logging full args payload.Log only the tag name (and maybe file) to reduce noise/PII.
- log.info(`Starting delete-tag with args: ${JSON.stringify(args)}`); + log.info(`Starting delete-tag (name=${args.name}, file=${args.file ?? 'default'})`);As per coding guidelines.
mcp-server/src/tools/remove-dependency.js (2)
6-8: Verify 'zod/v3' path works here too.Align with alias/pinning approach to ensure stable builds.
47-48: Trim logged args.Don’t serialize the whole args object; log task IDs only.
- log.info( - `Removing dependency for task ${args.id} from ${args.dependsOn} with args: ${JSON.stringify(args)}` - ); + log.info(`Removing dependency: task ${args.id} -X-> ${args.dependsOn}`);As per coding guidelines.
apps/mcp/src/tools/README-ZOD-V3.md (1)
36-36: Consider formatting the bare URL as a markdown link.While functional, markdown best practices suggest wrapping URLs in angle brackets or using proper link syntax for better rendering and accessibility.
Apply this diff:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: <https://github.com/punkpeye/fastmcp/issues/189>Or alternatively:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: [fastmcp#189](https://github.com/punkpeye/fastmcp/issues/189)mcp-server/src/tools/README-ZOD-V3.md (1)
36-36: Consider formatting the bare URL as a markdown link.For consistency with markdown best practices and improved rendering, wrap the URL in angle brackets or use proper link syntax.
Apply this diff:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: <https://github.com/punkpeye/fastmcp/issues/189>Or alternatively:
- - Tracking: https://github.com/punkpeye/fastmcp/issues/189 + - Tracking: [fastmcp#189](https://github.com/punkpeye/fastmcp/issues/189)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (47)
apps/mcp/src/tools/README-ZOD-V3.md(1 hunks)apps/mcp/src/tools/autopilot/abort.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/commit.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/complete.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/finalize.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/next.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/resume.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/start.tool.ts(1 hunks)apps/mcp/src/tools/autopilot/status.tool.ts(1 hunks)mcp-server/src/tools/README-ZOD-V3.md(1 hunks)mcp-server/src/tools/add-dependency.js(1 hunks)mcp-server/src/tools/add-subtask.js(1 hunks)mcp-server/src/tools/add-tag.js(1 hunks)mcp-server/src/tools/add-task.js(1 hunks)mcp-server/src/tools/analyze.js(1 hunks)mcp-server/src/tools/clear-subtasks.js(1 hunks)mcp-server/src/tools/complexity-report.js(1 hunks)mcp-server/src/tools/copy-tag.js(1 hunks)mcp-server/src/tools/delete-tag.js(1 hunks)mcp-server/src/tools/expand-all.js(1 hunks)mcp-server/src/tools/expand-task.js(1 hunks)mcp-server/src/tools/fix-dependencies.js(1 hunks)mcp-server/src/tools/generate.js(1 hunks)mcp-server/src/tools/get-operation-status.js(1 hunks)mcp-server/src/tools/get-task.js(1 hunks)mcp-server/src/tools/get-tasks.js(1 hunks)mcp-server/src/tools/initialize-project.js(1 hunks)mcp-server/src/tools/list-tags.js(1 hunks)mcp-server/src/tools/models.js(1 hunks)mcp-server/src/tools/move-task.js(1 hunks)mcp-server/src/tools/next-task.js(1 hunks)mcp-server/src/tools/parse-prd.js(1 hunks)mcp-server/src/tools/remove-dependency.js(1 hunks)mcp-server/src/tools/remove-subtask.js(1 hunks)mcp-server/src/tools/remove-task.js(1 hunks)mcp-server/src/tools/rename-tag.js(1 hunks)mcp-server/src/tools/research.js(1 hunks)mcp-server/src/tools/response-language.js(1 hunks)mcp-server/src/tools/rules.js(1 hunks)mcp-server/src/tools/scope-down.js(1 hunks)mcp-server/src/tools/scope-up.js(1 hunks)mcp-server/src/tools/set-task-status.js(1 hunks)mcp-server/src/tools/update-subtask.js(1 hunks)mcp-server/src/tools/update-task.js(1 hunks)mcp-server/src/tools/update.js(1 hunks)mcp-server/src/tools/use-tag.js(1 hunks)mcp-server/src/tools/validate-dependencies.js(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- mcp-server/src/tools/update.js
🚧 Files skipped from review as they are similar to previous changes (23)
- mcp-server/src/tools/update-task.js
- mcp-server/src/tools/remove-task.js
- mcp-server/src/tools/next-task.js
- mcp-server/src/tools/remove-subtask.js
- mcp-server/src/tools/set-task-status.js
- apps/mcp/src/tools/autopilot/resume.tool.ts
- mcp-server/src/tools/expand-all.js
- apps/mcp/src/tools/autopilot/status.tool.ts
- mcp-server/src/tools/response-language.js
- mcp-server/src/tools/get-operation-status.js
- mcp-server/src/tools/generate.js
- mcp-server/src/tools/use-tag.js
- mcp-server/src/tools/add-dependency.js
- mcp-server/src/tools/parse-prd.js
- mcp-server/src/tools/update-subtask.js
- mcp-server/src/tools/complexity-report.js
- mcp-server/src/tools/get-task.js
- mcp-server/src/tools/analyze.js
- mcp-server/src/tools/fix-dependencies.js
- apps/mcp/src/tools/autopilot/finalize.tool.ts
- mcp-server/src/tools/get-tasks.js
- apps/mcp/src/tools/autopilot/next.tool.ts
- mcp-server/src/tools/validate-dependencies.js
🧰 Additional context used
📓 Path-based instructions (5)
mcp-server/src/tools/*.js
📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)
MCP server tools in mcp-server/src/tools/*.js must have their execute methods wrapped with the withNormalizedProjectRoot higher-order function from tools/utils.js to ensure consistent path handling.
mcp-server/src/tools/*.js: MCP tools must follow a specific structure: use server.addTool with snake_case tool names, define parameters using Zod, and implement the execute function as an async function.
All MCP tool execute methods that require access to the project root MUST be wrapped with the withNormalizedProjectRoot Higher-Order Function (HOF) from mcp-server/src/tools/utils.js.
MCP tools should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.
Use camelCase with Tool suffix for tool registration functions in mcp-server/src/tools/.
Use snake_case for tool names exposed to MCP clients in server.addTool definitions.
Log the start of execution with arguments (sanitized if sensitive), log successful completion with result summary, log all error conditions with appropriate log levels, and include the cache status in result logs in MCP tool files.
Do not log entire large data structures or sensitive information in MCP tool files.
Use handleApiResult to format and return the response from MCP tools.
mcp-server/src/tools/*.js: Create tool definitions in 'mcp-server/src/tools/', use Zod for parameter validation, include optional tag parameter for multi-context support, and follow established naming conventions.
For long-running operations that should not block the client, use the AsyncOperationManager in MCP tools and implement progress reporting.
Files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.js
mcp-server/src/{tools,core/direct-functions}/*.js
📄 CodeRabbit inference engine (.cursor/rules/mcp.mdc)
mcp-server/src/{tools,core/direct-functions}/*.js: Use kebab-case for all file names in mcp-server/src/tools/ and mcp-server/src/core/direct-functions/.
Use helpers from mcp-server/src/tools/utils.js, mcp-server/src/core/utils/path-utils.js, and mcp-server/src/core/utils/ai-client-utils.js for centralized utilities.
Files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.js
mcp-server/src/tools/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/telemetry.mdc)
MCP tool files in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result to handleApiResult(result, log) from mcp-server/src/tools/utils.js, ensuring telemetryData is included in the final MCP response.
Files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.js
**/*.js
📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)
**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.
Files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.js
mcp-server/src/{core/utils,tools}/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within
mcp-server/src/(e.g., path/core logic helpers inmcp-server/src/core/utils/, tool execution/response helpers inmcp-server/src/tools/utils.js).
Files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/research.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/scope-down.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/add-subtask.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/move-task.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.js
🧠 Learnings (7)
📚 Learning: 2025-07-18T17:12:57.903Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to mcp-server/src/tools/*.js : Create tool definitions in 'mcp-server/src/tools/', use Zod for parameter validation, include optional tag parameter for multi-context support, and follow established naming conventions.
Applied to files:
mcp-server/src/tools/delete-tag.jsmcp-server/src/tools/add-task.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/copy-tag.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/expand-task.jsmcp-server/src/tools/initialize-project.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/list-tags.jsmcp-server/src/tools/remove-dependency.jsmcp-server/src/tools/add-tag.jsmcp-server/src/tools/README-ZOD-V3.md
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : MCP tools must follow a specific structure: use server.addTool with snake_case tool names, define parameters using Zod, and implement the execute function as an async function.
Applied to files:
mcp-server/src/tools/add-task.jsmcp-server/src/tools/clear-subtasks.jsmcp-server/src/tools/scope-up.jsmcp-server/src/tools/rename-tag.jsmcp-server/src/tools/rules.jsmcp-server/src/tools/models.jsmcp-server/src/tools/README-ZOD-V3.md
📚 Learning: 2025-10-01T19:53:34.261Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1262
File: scripts/modules/task-manager/update-tasks.js:216-233
Timestamp: 2025-10-01T19:53:34.261Z
Learning: For scripts/modules/task-manager/*.js: Use generateObjectService with Zod schemas for structured AI responses rather than generateTextService + manual JSON parsing, as modern AI providers increasingly support the tool use and generateObject paradigm with improved reliability.
Applied to files:
mcp-server/src/tools/add-task.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Follow the provided structure for adding subtasks, including required options and detailed error handling.
Applied to files:
mcp-server/src/tools/add-subtask.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : Use camelCase with Tool suffix for tool registration functions in mcp-server/src/tools/.
Applied to files:
mcp-server/src/tools/rename-tag.jsmcp-server/src/tools/rules.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/{tools,core/direct-functions}/*.js : Use helpers from mcp-server/src/tools/utils.js, mcp-server/src/core/utils/path-utils.js, and mcp-server/src/core/utils/ai-client-utils.js for centralized utilities.
Applied to files:
mcp-server/src/tools/rules.js
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/tools/*.js : Use snake_case for tool names exposed to MCP clients in server.addTool definitions.
Applied to files:
mcp-server/src/tools/rules.js
🪛 markdownlint-cli2 (0.18.1)
apps/mcp/src/tools/README-ZOD-V3.md
36-36: Bare URL used
(MD034, no-bare-urls)
mcp-server/src/tools/README-ZOD-V3.md
36-36: Bare URL used
(MD034, no-bare-urls)
⏰ 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). (1)
- GitHub Check: Test
🔇 Additional comments (21)
apps/mcp/src/tools/autopilot/abort.tool.ts (1)
6-8: Approved. Thezod/v3subpath import is officially supported.Zod 3 is exported from the package root ("zod") as well as a new subpath "zod/v3", and this approach is available in your installed version (^4.1.11). The import change correctly uses Zod's documented strategy for maintaining Draft-07 JSON Schema compatibility. Libraries can reference both Zod 3 and Zod 4 in their implementation via these subpath imports, making this the appropriate solution for the MCP spec issue.
The comments clearly document the temporary nature and link to the tracking PR. No runtime validation behavior changes are expected—only the JSON Schema generation format shifts from Draft 2020-12 to Draft-07, which resolves issue #1284.
apps/mcp/src/tools/autopilot/complete.tool.ts (1)
6-8: All verification passed. The implementation is correct and consistent.The web search confirms that zod 4.1.11 officially supports the
zod/v3subpath, and the script output shows all 8 MCP autopilot tools (status, start, resume, finalize, next, complete, commit, abort) consistently use the same import pattern. Zod provides a "zod/v3" subpath so consumers can import the v3 build alongside v4, and the temporary nature of this change is clearly documented with TODO comments referencing PR #1323 for tracking the eventual revert.mcp-server/src/tools/expand-task.js (1)
6-8: Verified: zod/v3 subpath is valid; update TODO to reference issue instead of PR.Zod 3 is exported from the package root ("zod") as well as a new subpath "zod/v3", and all subpaths remain available forever. The import path is correct for zod v4.1.11 and will reliably provide Draft-07 JSON Schema output.
However, the TODO comment should reference issue #1284 rather than PR #1323 (this PR) for clarity to future developers:
-// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323) +// TODO: Revert to 'zod' when MCP spec issue #1284 is resolvedThe approach is sound—no code changes needed beyond this comment improvement.
mcp-server/src/tools/move-task.js (1)
6-8: The 'zod/v3' import is valid and will not fail at runtime.Zod 3 is exported from the package root ("zod") as well as a new subpath "zod/v3", and starting in v3.25.0, the package contains copies of both Zod 3 and Zod 4 at their respective subpaths. Since your project uses zod ^4.1.11, this version fully supports the
zod/v3import. All subpaths have not changed and will remain available forever, so this temporary workaround is safe. The TODO comment correctly documents the intention to revert once the MCP spec issue is resolved.mcp-server/src/tools/rename-tag.js (1)
6-8: Import path verified; all concerns resolved.The zod package provides v3 as an import path via subpath exports ("zod/v3"), alongside v4. The changes at lines 6-8 are correct:
- The explanatory comments documenting the temporary v3 import and reference to PR #1323 address the previous review comment
- The
import { z } from 'zod/v3';statement is valid in zod 4.1.11- The rest of the tool follows all coding guidelines (camelCase Tool suffix, snake_case tool name, Zod parameters, async execute with withNormalizedProjectRoot, handleApiResult usage)
mcp-server/src/tools/copy-tag.js (2)
6-8: No issues found—import pattern is consistently applied across all MCP tools.Verification confirms all 37 MCP tool files in
mcp-server/src/tools/uniformly useimport { z } from 'zod/v3';, with zero instances of direct 'zod' imports. The temporary workaround and TODO comment in copy-tag.js align with the codebase-wide pattern, ensuring Draft-07 JSON Schema compatibility without version mixing.
6-8: The 'zod/v3' import path is valid and correct.Zod v4 supports versioned subpaths, with "zod/v3" as a permanent "permalink" included since zod@3.25.0. The original review comment incorrectly assumed this import path doesn't exist in Zod 4.x.
The codebase intentionally and consistently uses this pattern across all MCP tools (37 files), not just copy-tag.js. This approach provides Draft-07 JSON Schema compatibility, which libraries should use for stable cross-version compatibility—exactly matching the rationale in the code comments and PR #1323.
The TEMPORARY/TODO comments and reference to PR #1323 are appropriate documentation of the planned revert. No action is required; the code is correct as written.
Likely an incorrect or invalid review comment.
mcp-server/src/tools/initialize-project.js (3)
17-58: LGTM! Well-structured parameter schema.The Zod schema definition is comprehensive and follows best practices:
- Clear descriptions for all parameters
- Appropriate defaults for optional parameters
- Required
projectRootparameter with explicit guidance- Type-safe enum validation for
rulesparameterThe schema structure remains unchanged; only the import source was modified.
59-82: LGTM! Execute implementation follows MCP tool guidelines.The execute function correctly:
- Wraps with
withNormalizedProjectRootHOF for consistent path handling- Calls the direct function
initializeProjectDirect(notexecuteTaskMasterCommand)- Uses
handleApiResultto format and return the response- Includes comprehensive logging and error handling
As per coding guidelines.
1-3: ✓ Thezod/v3import is valid and correctly addresses the FastMCP JSON Schema compatibility issue.Starting in v3.25.0, the zod package contains copies of both Zod 3 and Zod 4 at their respective subpaths, allowing
import * as z from "zod/v3". This import approach is the documented solution for accessing Zod 3's API while running on zod 4.x. Using zod/v3 with zod-to-json-schema generates Draft-07 JSON schemas by default, which resolves the FastMCP compatibility issue where newer Zod versions default to Draft 2020-12.The temporary comment and PR reference (#1323) are appropriate. The file correctly follows all MCP tool guidelines: it uses
withNormalizedProjectRootHOF, calls the direct functioninitializeProjectDirect, and properly useshandleApiResultwith appropriate logging.apps/mcp/src/tools/autopilot/commit.tool.ts (1)
6-8: Type-safety is ensured:zod/v3subpath is officially supported with full TypeScript definitions.Zod v4 officially exports v3 types via the
zod/v3subpath with separate .d.ts files, making the current import approach correct and type-safe. The concern about missing type definitions does not apply here. The code requires no changes—this is the recommended pattern for version-specific imports in zod v4.mcp-server/src/tools/remove-dependency.js (1)
64-73: The review comment is incorrect; no issues found.
removeDependencyDirectis defined with signature(args, log)only—it does not accept a context parameter. The function does not reference session internally. This calling pattern is correct and consistent with other simple CRUD operations in the codebase (e.g.,removeSubtaskDirect,generateTaskFilesDirect,fixDependenciesDirect). Only direct functions performing AI-driven operations (e.g.,updateTasksDirect,expandTaskDirect,parseParDDirect) accept and use a context parameter for session management.Likely an incorrect or invalid review comment.
mcp-server/src/tools/rules.js (1)
6-8: The review comment is based on incorrect assumptions about zod/v3 subpath availability.Zod v4 officially exports the zod/v3 subpath for backward compatibility, making this a documented and intentional pattern. The codebase confirms this: README-ZOD-V3.md explicitly documents that "Zod v4 ships with v3 compatibility at
zod/v3" and explains this is required for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema. This pattern is used consistently across 40+ tool files in mcp-server/src/tools/ and apps/mcp/src/tools/. The installed zod version (^4.1.11) natively supports this subpath, so no alias is needed or desirable.Likely an incorrect or invalid review comment.
mcp-server/src/tools/add-tag.js (1)
6-8: LGTM! Import change correctly addresses Draft-07 compatibility.The temporary switch to
zod/v3is the appropriate workaround for the MCP client compatibility issue described in #1284. The comments clearly explain the rationale and include a TODO for reverting once the upstream issue is resolved.mcp-server/src/tools/list-tags.js (1)
6-8: LGTM! Consistent with the temporary compatibility workaround.The import change and comments match the pattern established across MCP tools for Draft-07 JSON Schema compatibility.
apps/mcp/src/tools/autopilot/start.tool.ts (1)
6-8: LGTM! TypeScript tool correctly adopts the zod/v3 workaround.The import change is consistent with the compatibility fix across both JavaScript and TypeScript MCP tools.
mcp-server/src/tools/clear-subtasks.js (1)
6-8: LGTM! Import change aligns with the compatibility workaround.The change is consistent with the temporary fix for MCP client Draft-07 compatibility.
mcp-server/src/tools/models.js (1)
6-8: LGTM! Import change follows the established pattern.The temporary switch to
zod/v3is correctly applied to the models tool.mcp-server/src/tools/scope-down.js (1)
6-8: LGTM! Import change correctly implements the compatibility fix.The change is consistent with the temporary Draft-07 compatibility workaround applied across all MCP tools.
apps/mcp/src/tools/README-ZOD-V3.md (1)
1-70: LGTM! Clear documentation of the temporary workaround.The README effectively explains the problem, solution, and maintenance guidance for the zod/v3 compatibility workaround. The rationale is clear and will help future maintainers understand when and why to revert this change.
mcp-server/src/tools/README-ZOD-V3.md (1)
1-67: LGTM! Comprehensive documentation for MCP server tools.The README clearly documents the temporary zod/v3 workaround with appropriate context, examples, and maintenance guidance for the MCP server tooling.
This PR was automatically generated to update documentation based on recent changes. Original commit: fix: temporary fix, revert zod schema definitions for mcp tools to zod v3 (#1323)\n\n\n Co-authored-by: Claude <claude-assistant@anthropic.com>
What type of PR is this?
Description
Related Issues
How to Test This
# Example commands or stepsExpected result:
Contributor Checklist
npm run changesetnpm testnpm run format-check(ornpm run formatto fix)Changelog Entry
For Maintainers
Summary by CodeRabbit
New Features
Bug Fixes
Documentation