Skip to content

feat: add configurable MCP tool loading to reduce LLM context usage#1181

Merged
Crunchyman-ralph merged 25 commits into
eyaltoledano:nextfrom
karol-f:feat-selective-mcp-tools-loading
Oct 14, 2025
Merged

feat: add configurable MCP tool loading to reduce LLM context usage#1181
Crunchyman-ralph merged 25 commits into
eyaltoledano:nextfrom
karol-f:feat-selective-mcp-tools-loading

Conversation

@karol-f

@karol-f karol-f commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Summary

Introduces the TASK_MASTER_TOOLS environment variable to control which MCP tools are loaded, reducing LLM context
window usage by up to 76% for typical workflows.

Problem

  • MCP server previously loaded all 36 tools by default, consuming ~21,000 tokens
  • Most developers only use 7-10 core tools in their daily workflow
  • Excessive context usage limited space available for actual code work

Solution

Users can now configure tool loading via the TASK_MASTER_TOOLS environment variable with three preset modes or
custom tool selection:

Mode Tools Token Usage Reduction
core 7 essential tools ~5,000 76%
standard 15 common tools ~10,000 52%
all 36 all tools ~21,000 0% (default)
Custom User-defined Variable Variable

Key Changes

  • ✅ Configurable tool loading via TASK_MASTER_TOOLS environment variable
  • ✅ Backward compatible - defaults to loading all tools
  • ✅ Three preset configurations: core, standard, all
  • ✅ Custom tool selection via comma-separated list
  • ✅ Comprehensive unit tests (26 test cases)
  • ✅ Updated documentation across README, configuration guides, and .env.example

Usage

Core Mode (7 tools, ~5,000 tokens)

TASK_MASTER_TOOLS="core" npx task-master-ai

Standard Mode (15 tools, ~10,000 tokens)

TASK_MASTER_TOOLS="standard" npx task-master-ai

Custom Selection

TASK_MASTER_TOOLS="get_tasks,next_task,set_task_status" npx task-master-ai

MCP Integration Examples

Claude Code:

  claude mcp add task-master-ai --scope user \
    --env TASK_MASTER_TOOLS="core" \
    -- npx -y task-master-ai@latest

Cursor/Windsurf:

  {
    "mcpServers": {
      "task-master-ai": {
        "command": "npx",
        "args": ["-y", "task-master-ai@latest"],
        "env": {
          "TASK_MASTER_TOOLS": "standard"
        }
      }
    }
  }

Testing

  • All 26 unit tests passing
  • Verified backward compatibility with existing installations
  • Tested all configuration modes (core, standard, all, custom)
  • Validated token reduction in real Claude Code sessions

Documentation

  • Updated README with platform-agnostic configuration instructions
  • Enhanced configuration.md with complete tool listings
  • Added TASK_MASTER_TOOLS to .env.example with detailed comments
  • Maintained backward compatibility in all examples

Breaking Changes

None - fully backward compatible. Existing installations continue to work without any changes.

How to Test This

npm run test tool-registration.test.js

or add MCP to the MCP Host while setting a new variable

Expected result:

Only selected tools are used in MCP Host

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • New Features

    • Configurable MCP tool loading via TASK_MASTER_TOOLS (modes: all, standard, core/lean, or custom). Startup logs selected mode, registered tools, and any failures.
  • Documentation

    • Added Tool Loading Configuration content with examples for editor/CLI setups, environment variable usage, recommendations, and verification notes.
  • Tests

    • Added comprehensive tests and helpers validating modes, edge cases, counts, categories, and registration behavior.

@changeset-bot

changeset-bot Bot commented Sep 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73e5fef

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

@coderabbitai

coderabbitai Bot commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Introduces configurable MCP tool loading: a centralized tool registry, getToolsConfiguration, and a registry-driven registerTaskMasterTools(server, toolMode) flow with logging and per-tool error handling. Adds docs, examples, tests, and helpers for validating tool counts and categories.

Changes

Cohort / File(s) Summary
MCP server init
mcp-server/src/index.js
Replaces unconditional tool registration with a config-driven flow: calls getToolsConfiguration() then registerTaskMasterTools(server, mode); adds startup and registration logging; removes dotenv.config() from init; returns this after init.
Tool registry & registration
mcp-server/src/tools/index.js, mcp-server/src/tools/tool-registry.js
Adds a centralized toolRegistry (36 tools), coreTools and standardTools lists, and helpers (getAvailableTools, getToolRegistration, isValidTool, etc.). Introduces getToolsConfiguration() and changes registerTaskMasterTools(server, toolMode='all') to support modes (all, core/lean, standard) and custom lists with normalization, alias resolution, per-tool error handling, and fallbacks; re-exports registry utilities.
Tests & helpers
tests/unit/mcp/tools/tool-registration.test.js, tests/helpers/tool-counts.js
Adds comprehensive unit tests covering TASK_MASTER_TOOLS modes, custom lists, edge cases, concurrency, and timing; introduces helper utilities to validate expected tool counts, categories, and structure.
Docs, examples, changeset, env
.changeset/light-owls-stay.md, README.md, docs/configuration.md, apps/docs/capabilities/mcp.mdx, apps/docs/getting-started/quick-start/configuration-quick.mdx, .env.example
Documentation for TASK_MASTER_TOOLS modes (all, standard, core/lean, custom), examples for MCP config/CLI/env, verification notes, and a changeset entry. .env.example contains no functional change (no-op replacement).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Editor/CLI
  participant Server as MCP Server
  participant Tools as Tools Module
  participant Registry as Tool Registry

  Note over Client,Server: Startup
  Client->>Server: Start MCP server
  Server->>Tools: getToolsConfiguration()
  Tools-->>Server: normalizedToolMode

  Note over Server,Registry: Registration
  Server->>Tools: registerTaskMasterTools(server, normalizedToolMode)
  Tools->>Registry: Resolve mode/list → tool names
  Registry-->>Tools: Registration functions
  loop For each tool
    Tools->>Server: server.addTool(tool)
    alt Registration fails
      Tools-->>Server: Record failed tool
    else Success
      Tools-->>Server: Record registered tool
    end
  end
  Tools-->>Server: {normalizedMode, registered[], failed[]}
  Server-->>Client: Log mode, registered count, failures
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly states the main feature added—configurable MCP tool loading to reduce LLM context usage—matching the PR’s primary change and is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 20

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
.changeset/light-owls-stay.md (1)

5-6: Use a concise, user-facing changeset summary and remove stray character.

Changeset summaries should be one-line, imperative, and user-facing (no commit prefixes). Also, Line 6 contains an orphaned "6".

Apply:

-feat(mcp) add configurable MCP tool loading to reduce LLM context usage
-6
+Add configurable MCP tool loading via TASK_MASTER_TOOLS with core/standard/all presets to reduce LLM context usage
package.json (1)

13-27: Add standardized test scripts per repository guidelines.

Project guidelines call for test:unit, test:integration, and test:ci. Add aliases consistent with existing Jest invocation.

   "scripts": {
     "test": "node --experimental-vm-modules node_modules/.bin/jest",
     "test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",
     "test:watch": "node --experimental-vm-modules node_modules/.bin/jest --watch",
     "test:coverage": "node --experimental-vm-modules node_modules/.bin/jest --coverage",
+    "test:unit": "node --experimental-vm-modules node_modules/.bin/jest tests/unit",
+    "test:integration": "node --experimental-vm-modules node_modules/.bin/jest tests/integration",
+    "test:ci": "node --experimental-vm-modules node_modules/.bin/jest --ci --coverage",
     "test:e2e": "./tests/e2e/run_e2e.sh",
     "test:e2e-report": "./tests/e2e/run_e2e.sh --analyze-log",
README.md (1)

100-122: Use jsonc fences for commented JSON examples.

These blocks include // comments but are fenced as json, which is invalid JSON and may confuse copy/paste. Prefer jsonc so comments are explicitly allowed.

-```json
+```jsonc
  {
    "mcpServers": {
      "task-master-ai": {
...
-``` 
+```
-```json
+```jsonc
  {
    "servers": {
      "task-master-ai": {
...
-```
+```

Also applies to: 130-153

mcp-server/src/index.js (1)

129-136: Fix null-dereference when session is falsy.

The else-branch logs via session.server, but session is falsy here, causing a runtime error.

-    } else {
-      session.server.sendLoggingMessage({
-        data: {
-          context: session.context,
-          message: `No MCP sessions available, providers not registered`
-        },
-        level: 'warn'
-      });
-    }
+    } else {
+      this.logger?.warn(`No MCP sessions available, providers not registered`);
+    }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4cae299 and b0802d1.

📒 Files selected for processing (10)
  • .changeset/light-owls-stay.md (1 hunks)
  • .env.example (1 hunks)
  • README.md (4 hunks)
  • apps/extension/package.json (3 hunks)
  • docs/configuration.md (6 hunks)
  • mcp-server/src/index.js (1 hunks)
  • mcp-server/src/tools/index.js (1 hunks)
  • mcp-server/src/tools/tool-registry.js (1 hunks)
  • package.json (1 hunks)
  • tests/unit/mcp/tools/tool-registration.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in 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/light-owls-stay.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/light-owls-stay.md
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/mcp/tools/tool-registration.test.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:

  • tests/unit/mcp/tools/tool-registration.test.js
  • mcp-server/src/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
docs/**/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Add feature documentation to '/docs' folder, include tagged system usage examples, update command reference documentation, and provide migration notes if relevant.

Files:

  • docs/configuration.md
package.json

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Files:

  • package.json
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/tool-registry.js
  • mcp-server/src/tools/index.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/tool-registry.js
  • mcp-server/src/tools/index.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/tool-registry.js
  • mcp-server/src/tools/index.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 in mcp-server/src/core/utils/, tool execution/response helpers in mcp-server/src/tools/utils.js).

Files:

  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
.env.example

📄 CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

Add the new PROVIDER_API_KEY to .env.example.

Files:

  • .env.example
🧠 Learnings (64)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information (taskmaster.mdc).
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for integrating new features into the Task Master CLI with tagged system considerations (new_features.mdc).
📚 Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for integrating new features into the Task Master CLI with tagged system considerations (new_features.mdc).

Applied to files:

  • .changeset/light-owls-stay.md
  • README.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information (taskmaster.mdc).

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
  • mcp-server/src/tools/index.js
  • README.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.mcp.json : Configure the Task Master MCP server in .mcp.json with the provided mcpServers.task-master-ai block and environment keys

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
  • .env.example
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
  • README.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,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:

  • .changeset/light-owls-stay.md
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and interacting with the Task Master MCP Server (mcp.mdc).

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
  • README.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 should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.

Applied to files:

  • .changeset/light-owls-stay.md
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.

Applied to files:

  • .changeset/light-owls-stay.md
  • docs/configuration.md
  • .env.example
  • README.md
📚 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 scripts/modules/**/*.test.js : Test CLI and MCP interfaces with real task data, verify end-to-end workflows across tag contexts, and test error scenarios and recovery in integration tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
  • package.json
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.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:

  • tests/unit/mcp/tools/tool-registration.test.js
  • mcp-server/src/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 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:

  • tests/unit/mcp/tools/tool-registration.test.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and maintaining tests for Task Master CLI (tests.mdc).

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 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 scripts/modules/**/*.test.js : Test core logic independently with both data formats, mock file system operations, test tag resolution behavior, and verify migration compatibility in unit tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.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:

  • tests/unit/mcp/tools/tool-registration.test.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Verify modifications on the in-memory task objects passed to writeJSON.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock the action handlers for CLI commands and verify they're called with correct arguments.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Do not import real AI service clients in tests; create fully mocked versions that return predictable responses.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Set mock environment variables in test setup and restore them after each test.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{integration,e2e}/**/*.test.js : Properly mock session objects when required by functions, and reset environment variables between tests if modified.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Applied to files:

  • docs/configuration.md
  • .env.example
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and endpoint URLs for Taskmaster in a `.env` file (for CLI usage) or in the `env` section of `.cursor/mcp.json` (for MCP/Cursor integration). Do not store non-API key settings in these files.

Applied to files:

  • docs/configuration.md
  • .env.example
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • docs/configuration.md
  • mcp-server/src/index.js
  • .env.example
  • README.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to .taskmasterconfig : Use `.taskmasterconfig` (JSON) in the project root for storing Taskmaster configuration (excluding API keys), and manage it via the `task-master models --setup` CLI command or the `models` MCP tool.

Applied to files:

  • docs/configuration.md
  • README.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {.env,.cursor/mcp.json} : Store API keys only in `.env` (for CLI, loaded by `dotenv` in `scripts/dev.js`) or `.cursor/mcp.json` (for MCP, accessed via `session.env`).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the `.taskmaster/config.json` file located in the project root directory. Do not configure non-API key settings via environment variables.

Applied to files:

  • docs/configuration.md
  • README.md
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Ensure `.taskmasterconfig` exists and has valid provider/model IDs for the roles you intend to use (manage via `task-master models --setup`).

Applied to files:

  • docs/configuration.md
  • README.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: When assigning a model to a role using the MCP tool or CLI, do not include the provider: prefix in the model ID; use only the model ID itself.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Do not manually edit `.taskmaster/config.json` unless you are certain of the changes; use the `task-master models` command or `models` MCP tool for configuration.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: Applies to .cursor/mcp.json.example : Add the new PROVIDER_API_KEY with its placeholder to the env section for taskmaster-ai in .cursor/mcp.json.example.

Applied to files:

  • docs/configuration.md
  • .env.example
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to {.env,.cursor/mcp.json} : Set API keys for AI providers (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) in your .env file in the project root (for CLI use) or within the env section of your .cursor/mcp.json file (for MCP/Cursor integration).

Applied to files:

  • docs/configuration.md
  • .env.example
  • README.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.env : Enable research mode by setting a research model API key (e.g., PERPLEXITY_API_KEY) in .env when using --research

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Applies to package.json : Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Applied to files:

  • package.json
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Do not modify real task files (tasks.json) during tests.

Applied to files:

  • package.json
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/{core/utils,tools}/**/*.js : Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/` (e.g., path/core logic helpers in `mcp-server/src/core/utils/`, tool execution/response helpers in `mcp-server/src/tools/utils.js`).

Applied to files:

  • package.json
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/index.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/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.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 : Do not log entire large data structures or sensitive information in MCP tool files.

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Export all utility functions explicitly, group related functions logically, and include new tagged system utilities.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `handleApiResult`, `createContentResponse`, `createErrorResponse`, `getCachedOrExecute`, and `processMCPResponseData` in `mcp-server/src/tools/utils.js` to standardize MCP tool responses and caching.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Keep utilities relevant to their location, export all utility functions in a single statement per file, group related exports together, export configuration constants, do not use default exports, and do not create circular dependencies.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.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 kebab-case for all file names in mcp-server/src/tools/ and mcp-server/src/core/direct-functions/.

Applied to files:

  • mcp-server/src/tools/tool-registry.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 : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.

Applied to files:

  • apps/extension/package.json
📚 Learning: 2025-07-31T20:49:04.638Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#997
File: apps/extension/package.publish.json:2-8
Timestamp: 2025-07-31T20:49:04.638Z
Learning: In the eyaltoledano/claude-task-master repository, the VS Code extension uses a 3-file packaging system where package.json (with name "extension") is for development within the monorepo, while package.publish.json (with name "task-master-hamster") contains the clean manifest for VS Code marketplace publishing. The different names are intentional and serve distinct purposes in the build and publishing workflow.

Applied to files:

  • apps/extension/package.json
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.

Applied to files:

  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-08-11T12:30:23.843Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-11T12:30:23.843Z
Learning: Import Task Master's development workflow commands and guidelines; treat the contents of ./.taskmaster/CLAUDE.md as if included in the main CLAUDE.md

Applied to files:

  • README.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/.claude/settings.json : Add the recommended allowedTools list to .claude/settings.json (e.g., Bash(task-master *), mcp__task_master_ai__*)

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For CLI usage, install Taskmaster globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:19:27.365Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Use `task-master add-task` to add a new task to tasks.json using AI.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:19:27.365Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Use the global `task-master` CLI command instead of directly invoking `node scripts/dev.js` for all task management operations.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, tag management) in `.taskmaster/config.json` in the project root. Do not configure these via environment variables.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/docs/*.txt : Place Product Requirements Documents (PRDs) for features or initiatives in `.taskmaster/docs/` with descriptive filenames (e.g., `.taskmaster/docs/feature-xyz-prd.txt`).

Applied to files:

  • README.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: After initializing a project with Taskmaster, you must parse a PRD in order to generate tasks. There will be no tasks files until then.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:19:27.365Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Start new projects by running `task-master init` or `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate the initial tasks.json.

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For PRD-driven feature development, create a dedicated tag, draft a PRD in `.taskmaster/docs/`, parse it into tasks, and add a high-level reference in the master tag.

Applied to files:

  • README.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/.taskmaster/docs/*.{txt,md} : Keep PRDs in .taskmaster/docs as .txt or .md for `task-master parse-prd` (use --append to merge new info)

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:19:27.365Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Use `task-master init` to initialize a new project with Task Master structure.

Applied to files:

  • README.md
📚 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:

  • README.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guide for using Task Master to manage task-driven development workflows with tagged task lists support (dev_workflow.mdc).

Applied to files:

  • README.md
📚 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: Always prefer using the MCP tools (e.g., get_tasks, add_task) when interacting programmatically or via an integrated tool; use the CLI as a fallback or for direct user interaction.

Applied to files:

  • README.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: If an MCP tool fails with unclear errors (like JSON parsing failures), run the equivalent task-master CLI command in the terminal to get more detailed error messages.

Applied to files:

  • README.md
🧬 Code graph analysis (3)
tests/unit/mcp/tools/tool-registration.test.js (2)
mcp-server/src/tools/index.js (1)
  • registerTaskMasterTools (38-135)
mcp-server/src/tools/tool-registry.js (6)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
mcp-server/src/tools/tool-registry.js (1)
tests/unit/mcp/tools/tool-registration.test.js (3)
  • toolRegistry (20-20)
  • coreTools (21-21)
  • standardTools (22-22)
mcp-server/src/tools/index.js (1)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • getToolRegistration (129-131)
🪛 LanguageTool
.changeset/light-owls-stay.md

[grammar] ~5-~5: There might be a mistake here.
Context: --- "task-master-ai": minor --- feat(mcp) add configurable MCP tool loading to re...

(QB_NEW_EN_OTHER)


[grammar] ~5-~5: There might be a mistake here.
Context: ...tool loading to reduce LLM context usage

(QB_NEW_EN_OTHER)

docs/configuration.md

[grammar] ~62-~62: Use correct spacing
Context: ...ture. ## MCP Tool Loading Configuration ### TASK_MASTER_TOOLS Environment Variable ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64: Use correct spacing
Context: ...# TASK_MASTER_TOOLS Environment Variable The TASK_MASTER_TOOLS environment vari...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66: Use correct spacing
Context: ...oken usage based on your workflow needs. #### Configuration Options - all (defa...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~68-~68: Use correct spacing
Context: ...kflow needs. #### Configuration Options - all (default): Loads all 36 available tools...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~70-~70: There might be a mistake here.
Context: ... all 36 available tools (~21,000 tokens) - Best for: Users who need the complete fe...

(QB_NEW_EN_OTHER)


[grammar] ~73-~73: There might be a problem here.
Context: ...ompatibility with existing installations - standard: Loads 15 commonly used tools (~10,000 t...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~75-~75: There might be a mistake here.
Context: ...ed tools (~10,000 tokens, 50% reduction) - Best for: Regular task management workfl...

(QB_NEW_EN_OTHER)


[grammar] ~78-~78: There might be a problem here.
Context: ...set of features with reduced token usage - core: Loads 7 essential tools (~5,000 tokens,...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~80-~80: There might be a mistake here.
Context: ...ial tools (~5,000 tokens, 70% reduction) - Best for: Daily development with minimal...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...e contexts where token usage is critical - Custom list: Comma-separated list of s...

(QB_NEW_EN_OTHER)


[grammar] ~85-~85: There might be a mistake here.
Context: ...ma-separated list of specific tool names - Best for: Specialized workflows requirin...

(QB_NEW_EN)


[grammar] ~86-~86: There might be a mistake here.
Context: ...lized workflows requiring specific tools - Example: `"get_tasks,next_task,set_task_...

(QB_NEW_EN)


[grammar] ~87-~87: There might be a mistake here.
Context: ...s requiring specific tools - Example: "get_tasks,next_task,set_task_status" - Use when: You know exactly which tools y...

(QB_NEW_EN)


[grammar] ~88-~88: Use correct spacing
Context: ...n: You know exactly which tools you need #### How to Configure 1. **In MCP configurat...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~90-~90: Use correct spacing
Context: ...ch tools you need #### How to Configure 1. In MCP configuration files (`.cursor/m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~92-~92: Use correct spacing
Context: ...or/mcp.json, .vscode/mcp.json`, etc.): json { "mcpServers": { "task-master-ai": { "env": { "TASK_MASTER_TOOLS": "standard", // Add this line // ... API keys } } } } 2. Via Claude Code CLI: ```bash cla...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~106-~106: Use correct spacing
Context: ... } 2. **Via Claude Code CLI**: bash claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest ``` 3. In environment variables (for developm...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~113-~113: Use correct spacing
Context: ...t variables** (for development/testing): bash export TASK_MASTER_TOOLS="standard" node mcp-server/server.js #### Tool Loading Behavior - If `TASK_MASTER...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~119-~119: Use correct spacing
Context: ...er.js ``` #### Tool Loading Behavior - If TASK_MASTER_TOOLS is not set or is ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~121-~121: Use the right pronoun
Context: ...ASK_MASTER_TOOLSis not set or is empty, defaults to"all"` - Invalid tool name...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~121-~121: Use correct spacing
Context: ...LSis not set or is empty, defaults to"all"` - Invalid tool names in custom lists are i...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~122-~122: There might be a mistake here.
Context: ...n custom lists are ignored with warnings - If all tools in a custom list are invali...

(QB_NEW_EN_OTHER)


[grammar] ~123-~123: Use the right pronoun
Context: ...f all tools in a custom list are invalid, falls back to "all" - Configuration i...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~123-~123: Use correct spacing
Context: ... custom list are invalid, falls back to "all" - Configuration is case-insensitive (`"COR...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~124-~124: There might be a mistake here.
Context: ... ("CORE", "core", "Core" all work) ## Environment Variables (.env file or MC...

(QB_NEW_EN_OTHER)

README.md

[grammar] ~186-~186: There might be a mistake here.
Context: ...e your PRD at .taskmaster/docs/prd.txt For existing projects: You can use `...

(QB_NEW_EN_OTHER)


[grammar] ~272-~272: Use correct spacing
Context: ...scode ``` ## Tool Loading Configuration ### Optimizing MCP Tool Loading Task Master...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~274-~274: Use correct spacing
Context: ...uration ### Optimizing MCP Tool Loading Task Master's MCP server supports select...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~276-~276: Use correct spacing
Context: ...mpatibility with existing installations. You can optimize performance by configur...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~278-~278: Use correct spacing
Context: ...TASK_MASTER_TOOLS` environment variable: ### Available Modes | Mode | Tools | Contex...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~280-~280: Use correct spacing
Context: ...vironment variable: ### Available Modes | Mode | Tools | Context Usage | Use Cas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~282-~282: There might be a mistake here.
Context: ...ode | Tools | Context Usage | Use Case | |------|-------|--------------|---------...

(QB_NEW_EN)


[grammar] ~283-~283: There might be a mistake here.
Context: ...-----|-------|--------------|----------| | all (default) | 36 | ~21,000 tokens ...

(QB_NEW_EN)


[typographical] ~284-~284: To join two clauses or set off examples, consider using an em dash.
Context: ... 36 | ~21,000 tokens | Complete feature set - all tools available | | standard | 15 | ~...

(QB_NEW_EN_DASH_RULE_EM)


[grammar] ~284-~284: There might be a mistake here.
Context: ...lete feature set - all tools available | | standard | 15 | ~10,000 tokens | Com...

(QB_NEW_EN)


[grammar] ~285-~285: There might be a mistake here.
Context: ...ns | Common task management operations | | core | 7 | ~5,000 tokens | Essential...

(QB_NEW_EN)


[grammar] ~286-~286: There might be a mistake here.
Context: ...| Essential daily development workflow | | custom | Variable | Variable | Comma...

(QB_NEW_EN)


[grammar] ~287-~287: Use correct spacing
Context: ...Comma-separated list of specific tools | ### Configuration Methods #### Method 1: En...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~289-~289: Use correct spacing
Context: ...cific tools | ### Configuration Methods #### Method 1: Environment Variable in MCP Co...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~291-~291: Use correct spacing
Context: ...nvironment Variable in MCP Configuration Add TASK_MASTER_TOOLS to your MCP conf...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~293-~293: Use correct spacing
Context: ... MCP configuration file's env section: json { "mcpServers": { // or "servers" for VS Code "task-master-ai": { "command": "npx", "args": ["-y", "--package=task-master-ai", "task-master-ai"], "env": { "TASK_MASTER_TOOLS": "standard", // Options: "all", "standard", "core", or comma-separated list "ANTHROPIC_API_KEY": "your-key-here", // ... other API keys } } } } #### Method 2: Claude Code CLI (One-Time Setu...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~311-~311: Use correct spacing
Context: ...thod 2: Claude Code CLI (One-Time Setup) For Claude Code users, you can set the m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~313-~313: Use correct spacing
Context: ...ou can set the mode during installation: bash # Core mode example (~70% token reduction) claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest # Custom tools example claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="get_tasks,next_task,set_task_status" \ -- npx -y task-master-ai@latest ### Tool Sets Details Core Tools (7): `...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~327-~327: Use correct spacing
Context: ...ter-ai@latest ``` ### Tool Sets Details Core Tools (7): get_tasks, `next_tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~329-~329: Use correct spacing
Context: ...status, update_subtask, parse_prd, expand_task` Standard Tools (15): All core tools pl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~331-~331: Use correct spacing
Context: ... remove_task, generate, add_task, complexity_report All Tools (36): Complete set including...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~333-~333: Use correct spacing
Context: ..., dependencies, tags, research, and more ### Recommendations - New users: Start ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~335-~335: Use correct spacing
Context: ... research, and more ### Recommendations - New users: Start with "standard" mod...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~337-~337: There might be a mistake here.
Context: ...ith "standard" mode for a good balance - Large projects: Use "core" mode to m...

(QB_NEW_EN_OTHER)


[grammar] ~340-~340: There might be a mistake here.
Context: ... not specified, defaults to "all" mode ## Claude Code Support Task Master now sup...

(QB_NEW_EN_OTHER)

🪛 markdownlint-cli2 (0.17.2)
.changeset/light-owls-stay.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

README.md

107-107: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


287-287: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


335-335: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🪛 dotenv-linter (3.3.0)
.env.example

[warning] 27-27: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

Comment thread .env.example Outdated
Comment thread docs/configuration.md
Comment thread mcp-server/src/index.js Outdated
Comment thread mcp-server/src/index.js Outdated
Comment thread mcp-server/src/tools/index.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js Outdated
Comment thread tests/unit/mcp/tools/tool-registration.test.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js
@Crunchyman-ralph Crunchyman-ralph changed the base branch from main to next September 4, 2025 18:43
@Crunchyman-ralph

Copy link
Copy Markdown
Collaborator

@karol-f can't see the changes much, mind:

  • rebasing with next (we use the next branch to merge on)
  • addressing coderabbit's comment on your PR
  • fixing the CI if failing ?

Thanks a lot for your contribution, feel free to ping me when thats done so that I can review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/configuration.md (1)

356-419: Use jsonc in Azure examples; fix small typos.

  • Code blocks contain comments, so switch to jsonc.
  • Later in this section: “Ensure youre not getting…” → “you’re”.
-   ```json
+   ```jsonc
    // In .taskmaster/config.json
    {
…
-   ```json
+   ```jsonc
    // In .taskmaster/config.json
    {
…
-   ```bash
+   ```bash
    # In .env file
    AZURE_OPENAI_API_KEY=your-azure-openai-api-key-here

And at Line 441:

-   - Ensure youre not getting rate limited by `maxTokens` maintain appropriate Tokens per Minute Rate Limit (TPM) in your deployment.
+   - Ensure you’re not getting rate limited by `maxTokens`; maintain appropriate Tokens per Minute (TPM) limits in your deployment.
♻️ Duplicate comments (1)
docs/configuration.md (1)

62-89: Align numbers and add a clear .env vs MCP env note.

  • The reduction percentages don’t match the PR summary: standard is ~52% (not 50%), core is ~76% (not 70%). Either update to the measured values or mark them as approximate consistently.
  • Add an explicit note that TASK_MASTER_TOOLS should be set in MCP env (or CI) rather than .env to avoid policy drift. This was requested previously.

Apply:

 ## MCP Tool Loading Configuration

 ### TASK_MASTER_TOOLS Environment Variable

 The `TASK_MASTER_TOOLS` environment variable controls which tools are loaded by the Task Master MCP server. This allows you to optimize token usage based on your workflow needs.
+
+> Note
+> Prefer setting `TASK_MASTER_TOOLS` in your MCP client's `env` block (e.g., `.cursor/mcp.json`) or in CI/deployment env. The `.env` file is reserved for API keys/endpoints; avoid persisting non-secret settings there.

 #### Configuration Options

-- **`all`** (default): Loads all 36 available tools (~21,000 tokens)
+- **`all`** (default): Loads all 36 available tools (~21,000 tokens)
   - Best for: Users who need the complete feature set
   - Use when: Working with complex projects requiring all Task Master features
   - Backward compatibility: This is the default to maintain compatibility with existing installations

-- **`standard`**: Loads 15 commonly used tools (~10,000 tokens, 50% reduction)
+- **`standard`**: Loads 15 commonly used tools (~10,000 tokens, ~52% reduction)
   - Best for: Regular task management workflows
   - Tools included: All core tools plus project initialization, complexity analysis, task generation, and more
   - Use when: You need a balanced set of features with reduced token usage

-- **`core`**: Loads 7 essential tools (~5,000 tokens, 70% reduction)
+- **`core`**: Loads 7 essential tools (~5,000 tokens, ~76% reduction)
   - Best for: Daily development with minimal token overhead
   - Tools included: `get_tasks`, `next_task`, `get_task`, `set_task_status`, `update_subtask`, `parse_prd`, `expand_task`
   - Use when: Working in large contexts where token usage is critical
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 000a5b8 and d21d404.

📒 Files selected for processing (1)
  • docs/configuration.md (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Add feature documentation to '/docs' folder, include tagged system usage examples, update command reference documentation, and provide migration notes if relevant.

Files:

  • docs/configuration.md
🧠 Learnings (23)
📓 Common learnings
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.
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information (taskmaster.mdc).

Applied to files:

  • docs/configuration.md
📚 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:

  • docs/configuration.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:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: Applies to .cursor/mcp.json.example : Add the new PROVIDER_API_KEY with its placeholder to the env section for taskmaster-ai in .cursor/mcp.json.example.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and endpoint URLs for Taskmaster in a `.env` file (for CLI usage) or in the `env` section of `.cursor/mcp.json` (for MCP/Cursor integration). Do not store non-API key settings in these files.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and specific endpoint URLs in the `.env` file in the project root for CLI usage, or in the `env` section of `.cursor/mcp.json` for MCP/Cursor integration. Do not store non-API key settings in these files.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {.env,.cursor/mcp.json} : Store API keys only in `.env` (for CLI, loaded by `dotenv` in `scripts/dev.js`) or `.cursor/mcp.json` (for MCP, accessed via `session.env`).

Applied to files:

  • docs/configuration.md
📚 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: Always prefer using the MCP tools (e.g., get_tasks, add_task) when interacting programmatically or via an integrated tool; use the CLI as a fallback or for direct user interaction.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.mcp.json : Configure the Task Master MCP server in .mcp.json with the provided mcpServers.task-master-ai block and environment keys

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to .taskmasterconfig : Use `.taskmasterconfig` (JSON) in the project root for storing Taskmaster configuration (excluding API keys), and manage it via the `task-master models --setup` CLI command or the `models` MCP tool.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the `.taskmaster/config.json` file located in the project root directory. Do not configure non-API key settings via environment variables.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Ensure `.taskmasterconfig` exists and has valid provider/model IDs for the roles you intend to use (manage via `task-master models --setup`).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: When assigning a model to a role using the MCP tool or CLI, do not include the provider: prefix in the model ID; use only the model ID itself.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Do not manually edit `.taskmaster/config.json` unless you are certain of the changes; use the `task-master models` command or `models` MCP tool for configuration.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and interacting with the Task Master MCP Server (mcp.mdc).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to {.env,.cursor/mcp.json} : Set API keys for AI providers (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) in your .env file in the project root (for CLI use) or within the env section of your .cursor/mcp.json file (for MCP/Cursor integration).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.env : Enable research mode by setting a research model API key (e.g., PERPLEXITY_API_KEY) in .env when using --research

Applied to files:

  • docs/configuration.md
🪛 LanguageTool
docs/configuration.md

[grammar] ~62-~62: Use correct spacing
Context: ...ture. ## MCP Tool Loading Configuration ### TASK_MASTER_TOOLS Environment Variable ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64: Use correct spacing
Context: ...# TASK_MASTER_TOOLS Environment Variable The TASK_MASTER_TOOLS environment vari...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66: Use correct spacing
Context: ...oken usage based on your workflow needs. #### Configuration Options - all (defa...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~68-~68: Use correct spacing
Context: ...kflow needs. #### Configuration Options - all (default): Loads all 36 available tools...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~70-~70: There might be a mistake here.
Context: ... all 36 available tools (~21,000 tokens) - Best for: Users who need the complete fe...

(QB_NEW_EN_OTHER)


[grammar] ~73-~73: There might be a problem here.
Context: ...ompatibility with existing installations - standard: Loads 15 commonly used tools (~10,000 t...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~75-~75: There might be a mistake here.
Context: ...ed tools (~10,000 tokens, 50% reduction) - Best for: Regular task management workfl...

(QB_NEW_EN_OTHER)


[grammar] ~78-~78: There might be a problem here.
Context: ...set of features with reduced token usage - core: Loads 7 essential tools (~5,000 tokens,...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~80-~80: There might be a mistake here.
Context: ...ial tools (~5,000 tokens, 70% reduction) - Best for: Daily development with minimal...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...e contexts where token usage is critical - Custom list: Comma-separated list of s...

(QB_NEW_EN_OTHER)


[grammar] ~85-~85: There might be a mistake here.
Context: ...ma-separated list of specific tool names - Best for: Specialized workflows requirin...

(QB_NEW_EN)


[grammar] ~86-~86: There might be a mistake here.
Context: ...lized workflows requiring specific tools - Example: `"get_tasks,next_task,set_task_...

(QB_NEW_EN)


[grammar] ~87-~87: There might be a mistake here.
Context: ...s requiring specific tools - Example: "get_tasks,next_task,set_task_status" - Use when: You know exactly which tools y...

(QB_NEW_EN)


[grammar] ~88-~88: There might be a mistake here.
Context: ...n: You know exactly which tools you need #### How to Configure 1. **In MCP configurat...

(QB_NEW_EN_OTHER)


[grammar] ~90-~90: Use correct spacing
Context: ...ch tools you need #### How to Configure 1. In MCP configuration files (`.cursor/m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~92-~92: Use correct spacing
Context: ...code/mcp.json`, etc.) - Recommended: json { "mcpServers": { "task-master-ai": { "env": { "TASK_MASTER_TOOLS": "standard", // Set tool loading mode // API keys can still use .env for security } } } } 2. Via Claude Code CLI: ```bash cla...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~106-~106: Use correct spacing
Context: ... } 2. **Via Claude Code CLI**: bash claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest ``` 3. In CI/deployment environment variables...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~113-~113: Use correct spacing
Context: ...n CI/deployment environment variables**: bash export TASK_MASTER_TOOLS="standard" node mcp-server/server.js #### Tool Loading Behavior - If `TASK_MASTER...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~119-~119: Use correct spacing
Context: ...er.js ``` #### Tool Loading Behavior - If TASK_MASTER_TOOLS is not set or is ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~121-~121: Use the right pronoun
Context: ...ASK_MASTER_TOOLSis not set or is empty, defaults to"all"` - Invalid tool name...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~122-~122: There might be a mistake here.
Context: ...n custom lists are ignored with warnings - If all tools in a custom list are invali...

(QB_NEW_EN_OTHER)


[grammar] ~123-~123: Use the right pronoun
Context: ...f all tools in a custom list are invalid, falls back to "all" - Configuration i...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~124-~124: Insert the missing word
Context: ... is case-insensitive ("CORE", "core", "Core" all work) ## Environment Vari...

(QB_NEW_EN_OTHER_ERROR_IDS_32)


[grammar] ~124-~124: There might be a mistake here.
Context: ... ("CORE", "core", "Core" all work) ## Environment Variables (.env file or MC...

(QB_NEW_EN_OTHER)

🪛 markdownlint-cli2 (0.17.2)
docs/configuration.md

93-93: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


107-107: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


114-114: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🔇 Additional comments (3)
docs/configuration.md (3)

62-124: Ignore de-duplication suggestion for “MCP Tool Loading Configuration”
This heading only appears once in docs/configuration.md, so there’s no duplicate to remove.

Likely an incorrect or invalid review comment.


80-84: Core tool names and count in docs match registry


113-118: Use package CLI instead of direct server path.
Replace:

node mcp-server/server.js

With:

npx task-master-mcp
⛔ Skipped due to learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Use the global `task-master` CLI command instead of directly invoking `node scripts/dev.js` for all task management operations.
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 should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.
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/core/direct-functions/*.js : Use path.join() instead of string concatenation for file paths, and follow established file naming conventions (e.g., 'task_001.txt') in direct functions.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For CLI usage, install Taskmaster globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Always prefer using the MCP tools (e.g., get_tasks, add_task) when interacting programmatically or via an integrated tool; use the CLI as a fallback or for direct user interaction.
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.
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.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.mcp.json : Configure the Task Master MCP server in .mcp.json with the provided mcpServers.task-master-ai block and environment keys
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-07-18T17:19:27.365Z
Learning: Start new projects by running `task-master init` or `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate the initial tasks.json.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: If an MCP tool fails with unclear errors (like JSON parsing failures), run the equivalent task-master CLI command in the terminal to get more detailed error messages.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and endpoint URLs for Taskmaster in a `.env` file (for CLI usage) or in the `env` section of `.cursor/mcp.json` (for MCP/Cursor integration). Do not store non-API key settings in these files.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and interacting with the Task Master MCP Server (mcp.mdc).

Comment thread docs/configuration.md
Comment thread docs/configuration.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mcp-server/src/index.js (1)

136-143: Bug: dereferencing session when it’s null/undefined.

In the else branch you still access session.server and session.context, which will throw.

Apply:

-    } else {
-      session.server.sendLoggingMessage({
-        data: {
-          context: session.context,
-          message: `No MCP sessions available, providers not registered`
-        },
-        level: 'warn'
-      });
-    }
+    } else {
+      this.logger.warn('No MCP sessions available, providers not registered');
+    }
♻️ Duplicate comments (3)
mcp-server/src/index.js (1)

54-55: Nice: fixed call signature to tool registration.

Passing only (this.server, normalizedToolMode) resolves the stale second-arg issue noted earlier.

mcp-server/src/tools/index.js (2)

96-110: Use registry helper and guard duplicate-registration errors.

Prefer getToolRegistration(toolName) and avoid direct map access; this also centralizes duplicate handling.

Apply:

-    toolsToRegister.forEach((toolName) => {
+    const seen = new Set();
+    toolsToRegister.forEach((toolName) => {
       try {
-        if (toolRegistry[toolName]) {
-          toolRegistry[toolName](server);
+        if (seen.has(toolName)) return; // guard, should be deduped earlier
+        const registerFn = getToolRegistration(toolName);
+        if (registerFn) {
+          registerFn(server);
+          seen.add(toolName);
           logger.debug(`Registered tool: ${toolName}`);
           registeredTools.push(toolName);
         } else {
           logger.warn(`Tool ${toolName} not found in registry`);
           failedTools.push(toolName);
         }
       } catch (error) {
         logger.error(`Failed to register tool ${toolName}: ${error.message}`);
         failedTools.push(toolName);
       }
     });

65-89: Normalize, alias, and dedupe custom tool names.

Handle case-insensitivity, hyphen/underscore variants, and duplicates to prevent false “unknown tool” warnings and duplicate registrations.

Apply:

-        const requestedTools = enabledTools
-          .split(',')
-          .map((t) => t.trim())
-          .filter((t) => t.length > 0);
-
-        toolsToRegister = requestedTools.filter((toolName) => {
-          if (toolRegistry[toolName]) {
-            return true;
-          } else {
-            logger.warn(`Unknown tool specified: "${toolName}"`);
-            return false;
-          }
-        });
+        const requestedTools = enabledTools
+          .split(',')
+          .map((t) => t.trim().toLowerCase())
+          .filter((t) => t.length > 0);
+
+        const unique = new Set();
+        for (const name of requestedTools) {
+          let resolved = name;
+          if (!toolRegistry[resolved]) {
+            const altHyphen = name.replace(/_/g, '-');
+            const altUnderscore = name.replace(/-/g, '_');
+            resolved = toolRegistry[altHyphen] ? altHyphen
+                    : toolRegistry[altUnderscore] ? altUnderscore
+                    : null;
+          }
+          if (resolved) unique.add(resolved);
+          else logger.warn(`Unknown tool specified: "${name}"`);
+        }
+        toolsToRegister = Array.from(unique);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d21d404 and 77df58e.

📒 Files selected for processing (2)
  • mcp-server/src/index.js (1 hunks)
  • mcp-server/src/tools/index.js (1 hunks)
🧰 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/index.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/index.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/index.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/index.js
  • mcp-server/src/index.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 in mcp-server/src/core/utils/, tool execution/response helpers in mcp-server/src/tools/utils.js).

Files:

  • mcp-server/src/tools/index.js
🧠 Learnings (22)
📓 Common learnings
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.
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/.
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.
📚 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/index.js
  • mcp-server/src/index.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/index.js
  • mcp-server/src/index.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/index.js
  • mcp-server/src/index.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/index.js
  • mcp-server/src/index.js
📚 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/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/{core/utils,tools}/**/*.js : Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/` (e.g., path/core logic helpers in `mcp-server/src/core/utils/`, tool execution/response helpers in `mcp-server/src/tools/utils.js`).

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Export all utility functions explicitly, group related functions logically, and include new tagged system utilities.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `handleApiResult`, `createContentResponse`, `createErrorResponse`, `getCachedOrExecute`, and `processMCPResponseData` in `mcp-server/src/tools/utils.js` to standardize MCP tool responses and caching.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Keep utilities relevant to their location, export all utility functions in a single statement per file, group related exports together, export configuration constants, do not use default exports, and do not create circular dependencies.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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 : Do not log entire large data structures or sensitive information in MCP tool files.

Applied to files:

  • mcp-server/src/tools/index.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 should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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 : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `normalizeProjectRoot(rawPath, log)`, `getRawProjectRootFromSession(session, log)`, and `withNormalizedProjectRoot(executeFn)` in `mcp-server/src/tools/utils.js` to ensure project root paths are normalized for MCP tools.

Applied to files:

  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:14:54.131Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-07-18T17:14:54.131Z
Learning: Applies to mcp-server/src/tools/**/*.js : 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.

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Applies to scripts/modules/task-manager/*.js : Do not initialize AI clients (Anthropic, Perplexity, etc.) directly within core logic (`task-manager/`) or MCP direct functions.

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: API keys for providers must be set in the correct location: in the env section of .cursor/mcp.json for MCP/Cursor, or in a .env file in the project root for CLI.

Applied to files:

  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Support both `.env` files and MCP session environment for environment variable resolution, provide fallbacks for missing values, and handle API key resolution correctly.

Applied to files:

  • mcp-server/src/index.js
🧬 Code graph analysis (2)
mcp-server/src/tools/index.js (2)
tests/unit/mcp/tools/tool-registration.test.js (4)
  • registerTaskMasterTools (19-19)
  • toolRegistry (20-20)
  • coreTools (21-21)
  • standardTools (22-22)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • getToolRegistration (129-131)
mcp-server/src/index.js (1)
mcp-server/src/tools/index.js (1)
  • registerTaskMasterTools (40-154)
🔇 Additional comments (3)
mcp-server/src/index.js (2)

47-55: Env-driven tool mode handling looks correct.

Reading TASK_MASTER_TOOLS, trimming, logging, and passing the normalized value into registration is sound.


63-65: Good failure visibility.

Explicitly logging failed tool names aids diagnostics.

mcp-server/src/tools/index.js (1)

112-123: Return shape and logging are solid.

Returning { registeredTools, failedTools, normalizedMode } and summarizing counts is appropriate.

Comment thread mcp-server/src/index.js Outdated
Comment thread mcp-server/src/tools/index.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (19)
docs/configuration.md (4)

95-107: Fix fenced code language and add required blank lines (MD031) + JSON-with-comments.

Use jsonc (comments present) and surround fences with blank lines.

-1. **In MCP configuration files** (`.cursor/mcp.json`, `.vscode/mcp.json`, etc.) - **Recommended**:
-   ```json
+1. **In MCP configuration files** (`.cursor/mcp.json`, `.vscode/mcp.json`, etc.) - **Recommended**:
+
+   ```jsonc
    {
      "mcpServers": {
        "task-master-ai": {
          "env": {
            "TASK_MASTER_TOOLS": "standard",  // Set tool loading mode
            // API keys can still use .env for security
          }
        }
      }
    }
    ```
+

109-115: Add blank lines around the bash fence (MD031).

-2. **Via Claude Code CLI**:
-   ```bash
+2. **Via Claude Code CLI**:
+
+   ```bash
    claude mcp add task-master-ai --scope user \
      --env TASK_MASTER_TOOLS="core" \
      -- npx -y task-master-ai@latest
    ```
+

116-121: Add blank lines around the CI example; keeps markdownlint green.

-3. **In CI/deployment environment variables**:
-   ```bash
+3. **In CI/deployment environment variables**:
+
+   ```bash
    export TASK_MASTER_TOOLS="standard"
    node mcp-server/server.js
    ```
+

124-127: Tighten wording for fallback/case-insensitivity; match implementation.

- - If `TASK_MASTER_TOOLS` is not set or is empty, defaults to `"all"`
- - Invalid tool names in custom lists are ignored with warnings
- - If all tools in a custom list are invalid, falls back to `"all"`
- - Configuration is case-insensitive (`"CORE"`, `"core"`, `"Core"` all work)
+ - If `TASK_MASTER_TOOLS` is unset or empty, defaults to `"all"`.
+ - Invalid tool names in custom lists are ignored with a warning.
+ - If every name in a custom list is invalid, the loader falls back to the `"all"` mode.
+ - Matching is case-insensitive (e.g., `"CORE"`, `"core"`, `"Core"`).
tests/unit/mcp/tools/tool-registration.test.js (13)

58-60: Remove unnecessary jest.resetModules() in teardown.

-		jest.clearAllMocks();
-		jest.resetModules();
+		jest.clearAllMocks();

70-75: Avoid magic numbers; use derived counts.

-			expect(Object.keys(toolRegistry).length).toBe(36);
-			expect(coreTools.length).toBe(7);
-			expect(standardTools.length).toBe(15);
+			expect(Object.keys(toolRegistry).length).toBe(ALL_COUNT);
+			expect(coreTools.length).toBe(CORE_COUNT);
+			expect(standardTools.length).toBe(STANDARD_COUNT);

114-129: Use derived counts in mode tests; env-var cases shouldn’t pass explicit mode.

-	it('should register all tools (36) when TASK_MASTER_TOOLS is not set (default behavior)', () => {
+	it('should register all tools (ALL_COUNT) when TASK_MASTER_TOOLS is not set (default behavior)', () => {
@@
-			expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+			expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);
 	});
@@
-	it('should register all tools (36) when TASK_MASTER_TOOLS=all', () => {
+	it('should register all tools (ALL_COUNT) when TASK_MASTER_TOOLS=all', () => {
 		process.env.TASK_MASTER_TOOLS = 'all';
 
-		registerTaskMasterTools(mockServer);
+		registerTaskMasterTools(mockServer); // let implementation read env
 
-		expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+		expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);
 	});

131-162: Replace 7/15/7 literals with CORE_COUNT/STANDARD_COUNT; keep one explicit-override test.

-	expect(mockServer.addTool).toHaveBeenCalledTimes(7);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(CORE_COUNT);
@@
-	expect(mockServer.addTool).toHaveBeenCalledTimes(15);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(STANDARD_COUNT);
@@
-	expect(mockServer.addTool).toHaveBeenCalledTimes(7);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(CORE_COUNT);
@@
-	expect(mockServer.addTool).toHaveBeenCalledTimes(7);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(CORE_COUNT);

182-197: Fallback-to-all should assert ALL_COUNT, not 36.

-	expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);
@@
-	expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

214-221: Empty custom list fallback: use ALL_COUNT.

-	expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

231-271: Rename the “100% coverage” test and use a mode matrix with derived counts.

-	it('should provide 100% code coverage for environment control logic', () => {
+	it('should cover environment modes matrix', () => {
@@
-				{ env: '', expectedCount: 36, description: 'empty string (all)' },
-				{ env: 'all', expectedCount: 36, description: 'all mode' },
-				{ env: 'core', expectedCount: 7, description: 'core mode' },
-				{ env: 'lean', expectedCount: 7, description: 'lean mode (alias)' },
-				{ env: 'standard', expectedCount: 15, description: 'standard mode' },
+				{ env: '', expectedCount: ALL_COUNT, description: 'empty string (all)' },
+				{ env: 'all', expectedCount: ALL_COUNT, description: 'all mode' },
+				{ env: 'core', expectedCount: CORE_COUNT, description: 'core mode' },
+				{ env: 'lean', expectedCount: CORE_COUNT, description: 'lean mode (alias)' },
+				{ env: 'standard', expectedCount: STANDARD_COUNT, description: 'standard mode' },
@@
-					expectedCount: 36,
+					expectedCount: ALL_COUNT,

273-285: Remove wall-clock assertion; it’s flaky in CI.

-	const startTime = Date.now();
@@
-	registerTaskMasterTools(mockServer);
-
-	const endTime = Date.now();
-	const executionTime = endTime - startTime;
-
-	expect(executionTime).toBeLessThan(100);
-	expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+	registerTaskMasterTools(mockServer);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

287-305: Don’t equate tool count with token reduction; assert relative sizes only.

-	it('should validate token reduction claims', () => {
+	it('should validate relative sizes of tool sets', () => {
@@
-			expect(coreTools.length).toBe(7);
-			expect(standardTools.length).toBe(15);
-			expect(Object.keys(toolRegistry).length).toBe(36);
+			expect(coreTools.length).toBe(CORE_COUNT);
+			expect(standardTools.length).toBe(STANDARD_COUNT);
+			expect(Object.keys(toolRegistry).length).toBe(ALL_COUNT);
@@
-			const coreReduction =
-				((allToolsCount - coreTools.length) / allToolsCount) * 100;
-			const standardReduction =
-				((allToolsCount - standardTools.length) / allToolsCount) * 100;
-
-			expect(coreReduction).toBeGreaterThan(80);
-			expect(standardReduction).toBeGreaterThan(50);
+			// Token usage != tool count; relative ordering is asserted above.

355-375: Use ALL_COUNT for problematic-input fallbacks.

-		expect(mockServer.addTool).toHaveBeenCalledTimes(36);
+		expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

114-129: Replace hardcoded tool counts in registration tests
tests/unit/mcp/tools/tool-registration.test.js still uses repeated numeric literals (36, 7, 15) for total, core, and standard tool counts. Replace these magic numbers with the corresponding derived constants or values (e.g. TOTAL_TOOLS_COUNT, CORE_TOOLS_COUNT, STANDARD_TOOLS_COUNT or toolRegistry.length, coreTools.length, standardTools.length) so tests remain correct when counts change.


24-49: Make beforeEach synchronous and remove dynamic imports.

-beforeEach(async () => {
+beforeEach(() => {
   originalEnv = process.env.TASK_MASTER_TOOLS;
@@
-  jest.resetModules();
-  const indexModule = await import(
-    '../../../../mcp-server/src/tools/index.js'
-  );
-  const registryModule = await import(
-    '../../../../mcp-server/src/tools/tool-registry.js'
-  );
-
-  registerTaskMasterTools = indexModule.registerTaskMasterTools;
-  toolRegistry = registryModule.toolRegistry;
-  coreTools = registryModule.coreTools;
-  standardTools = registryModule.standardTools;
 });

321-329: Clarify intent or make registration idempotent.

Either rename this to “accumulates registrations across repeated invocations” or change implementation to dedupe per server and update the expected count.

-it('should handle concurrent registration attempts', () => {
+it('should accumulate registrations across repeated invocations', () => {
@@
-	expect(mockServer.addTool).toHaveBeenCalledTimes(21);
+	expect(mockServer.addTool).toHaveBeenCalledTimes(CORE_COUNT * 3);

If you adopt idempotency, expect CORE_COUNT instead.

mcp-server/src/tools/index.js (2)

136-145: Use getToolRegistration consistently; avoid direct registry indexing.

-		toolsToRegister.forEach((toolName) => {
+		toolsToRegister.forEach((toolName) => {
 			try {
-				if (toolRegistry[toolName]) {
-					toolRegistry[toolName](server);
+				const registerFn = getToolRegistration(toolName);
+				if (registerFn) {
+					registerFn(server);
 					logger.debug(`Registered tool: ${toolName}`);
 					registeredTools.push(toolName);
 				} else {
 					logger.warn(`Tool ${toolName} not found in registry`);
 					failedTools.push(toolName);
 				}

40-41: Wire env var reader: function currently ignores TASK_MASTER_TOOLS.

Docs/tests expect env-driven behavior; default should read from process.env via getToolsConfiguration().

-export function registerTaskMasterTools(server, toolMode = 'all') {
+export function registerTaskMasterTools(server, toolMode = getToolsConfiguration()) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 77df58e and cf7ede7.

📒 Files selected for processing (3)
  • docs/configuration.md (6 hunks)
  • mcp-server/src/tools/index.js (1 hunks)
  • tests/unit/mcp/tools/tool-registration.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
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/index.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/index.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/index.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/index.js
  • tests/unit/mcp/tools/tool-registration.test.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 in mcp-server/src/core/utils/, tool execution/response helpers in mcp-server/src/tools/utils.js).

Files:

  • mcp-server/src/tools/index.js
docs/**/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Add feature documentation to '/docs' folder, include tagged system usage examples, update command reference documentation, and provide migration notes if relevant.

Files:

  • docs/configuration.md
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧠 Learnings (66)
📓 Common learnings
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.
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.
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/.
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.
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.
📚 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/index.js
  • tests/unit/mcp/tools/tool-registration.test.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/index.js
  • tests/unit/mcp/tools/tool-registration.test.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/index.js
  • tests/unit/mcp/tools/tool-registration.test.js
📚 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/index.js
  • tests/unit/mcp/tools/tool-registration.test.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/index.js
  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/{core/utils,tools}/**/*.js : Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/` (e.g., path/core logic helpers in `mcp-server/src/core/utils/`, tool execution/response helpers in `mcp-server/src/tools/utils.js`).

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Export all utility functions explicitly, group related functions logically, and include new tagged system utilities.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Keep utilities relevant to their location, export all utility functions in a single statement per file, group related exports together, export configuration constants, do not use default exports, and do not create circular dependencies.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `handleApiResult`, `createContentResponse`, `createErrorResponse`, `getCachedOrExecute`, and `processMCPResponseData` in `mcp-server/src/tools/utils.js` to standardize MCP tool responses and caching.

Applied to files:

  • mcp-server/src/tools/index.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 : Do not log entire large data structures or sensitive information in MCP tool files.

Applied to files:

  • mcp-server/src/tools/index.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 should always call *Direct wrappers instead of executeTaskMasterCommand, except as a fallback if a direct function is not yet implemented.

Applied to files:

  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `normalizeProjectRoot(rawPath, log)`, `getRawProjectRootFromSession(session, log)`, and `withNormalizedProjectRoot(executeFn)` in `mcp-server/src/tools/utils.js` to ensure project root paths are normalized for MCP tools.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information (taskmaster.mdc).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Do not manually edit `.taskmaster/config.json` unless you are certain of the changes; use the `task-master models` command or `models` MCP tool for configuration.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.mcp.json : Configure the Task Master MCP server in .mcp.json with the provided mcpServers.task-master-ai block and environment keys

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for integrating new features into the Task Master CLI with tagged system considerations (new_features.mdc).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and endpoint URLs for Taskmaster in a `.env` file (for CLI usage) or in the `env` section of `.cursor/mcp.json` (for MCP/Cursor integration). Do not store non-API key settings in these files.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and specific endpoint URLs in the `.env` file in the project root for CLI usage, or in the `env` section of `.cursor/mcp.json` for MCP/Cursor integration. Do not store non-API key settings in these files.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: Applies to .cursor/mcp.json.example : Add the new PROVIDER_API_KEY with its placeholder to the env section for taskmaster-ai in .cursor/mcp.json.example.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {.env,.cursor/mcp.json} : Store API keys only in `.env` (for CLI, loaded by `dotenv` in `scripts/dev.js`) or `.cursor/mcp.json` (for MCP, accessed via `session.env`).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Ensure API keys are correctly configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-08-06T21:13:05.240Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: assets/claude/agents/task-orchestrator.md:69-78
Timestamp: 2025-08-06T21:13:05.240Z
Learning: For Claude agent instruction files in .claude/agents/ and assets/claude/agents/ directories, ignore markdownlint issues (like MD031 blanks-around-fences, MD040 fenced-code-language, MD041 missing top-level heading) as these files follow Claude's specific agent format requirements rather than standard markdown documentation conventions.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-08-06T21:11:37.259Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: .claude/agents/task-orchestrator.md:0-0
Timestamp: 2025-08-06T21:11:37.259Z
Learning: For files in .claude/agents/ and assets/claude/agents/ directories, ignore markdownlint issues like MD041 (missing top-level heading) as these are Claude Code agent instruction files that follow a specific format with YAML frontmatter and don't need to conform to standard markdown documentation conventions.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:09:28.215Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/cursor_rules.mdc:0-0
Timestamp: 2025-07-18T17:09:28.215Z
Learning: Applies to .cursor/rules/*.mdc : When including code examples in Cursor rule files, use language-specific code blocks and clearly mark DO and DON'T examples.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-08-06T21:11:57.597Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: .claude/agents/task-executor.md:1-6
Timestamp: 2025-08-06T21:11:57.597Z
Learning: For Claude agent instruction files located in .claude/agents or assets/claude/agents directories, Crunchyman-ralph wants to ignore MarkdownLint issues since these files follow Claude's specific format requirements rather than standard markdown documentation conventions.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-08-06T21:11:28.852Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: .claude/agents/task-executor.md:0-0
Timestamp: 2025-08-06T21:11:28.852Z
Learning: For files in .claude/agents/ or assets/claude/agents/ directories, ignore markdownlint issues as these are Claude agent instruction files where formatting flexibility is preferred over strict markdown compliance.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to .taskmasterconfig : Use `.taskmasterconfig` (JSON) in the project root for storing Taskmaster configuration (excluding API keys), and manage it via the `task-master models --setup` CLI command or the `models` MCP tool.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the `.taskmaster/config.json` file located in the project root directory. Do not configure non-API key settings via environment variables.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Ensure `.taskmasterconfig` exists and has valid provider/model IDs for the roles you intend to use (manage via `task-master models --setup`).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: When assigning a model to a role using the MCP tool or CLI, do not include the provider: prefix in the model ID; use only the model ID itself.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and interacting with the Task Master MCP Server (mcp.mdc).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to {.env,.cursor/mcp.json} : Set API keys for AI providers (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) in your .env file in the project root (for CLI use) or within the env section of your .cursor/mcp.json file (for MCP/Cursor integration).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/**/.env : Enable research mode by setting a research model API key (e.g., PERPLEXITY_API_KEY) in .env when using --research

Applied to files:

  • docs/configuration.md
📚 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 scripts/modules/**/*.test.js : Test CLI and MCP interfaces with real task data, verify end-to-end workflows across tag contexts, and test error scenarios and recovery in integration tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and maintaining tests for Task Master CLI (tests.mdc).

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 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 scripts/modules/**/*.test.js : Test core logic independently with both data formats, mock file system operations, test tag resolution behavior, and verify migration compatibility in unit tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Verify modifications on the in-memory task objects passed to writeJSON.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.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: Write unit tests for the direct function wrapper and integration tests for the MCP tool.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Do not import real AI service clients in tests; create fully mocked versions that return predictable responses.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Module dependencies should be mocked before importing the test module, following Jest's hoisting behavior.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Always declare mocks before importing the modules being tested in Jest test files.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 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 scripts/modules/**/*.test.js : Follow the mock-first-then-import pattern and use jest.spyOn() for testing in Jest, clearing mocks between tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Isolate tests by properly mocking shared resources and resetting state in beforeEach and afterEach hooks.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Clear mocks between tests with jest.clearAllMocks() in beforeEach.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Create self-contained test implementations rather than using real implementations when testing modules with initialization issues.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Be careful with how you mock or stub functions that depend on module state; use factory functions in mocks to ensure proper initialization order.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Applies to {src/utils/**,src/middleware/**} : Test coverage for all code should meet or exceed 80% lines/functions and 70% branches globally; critical code (utils, middleware) should meet higher thresholds (90% utils, 85% middleware)

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Aim for 80%+ code coverage, with critical paths at 100%.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Run npm run test:coverage before commits to ensure all tests pass with sufficient coverage

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock the action handlers for CLI commands and verify they're called with correct arguments.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Set mock environment variables in test setup and restore them after each test.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{integration,e2e}/**/*.test.js : Properly mock session objects when required by functions, and reset environment variables between tests if modified.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧬 Code graph analysis (2)
mcp-server/src/tools/index.js (1)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • getToolRegistration (129-131)
tests/unit/mcp/tools/tool-registration.test.js (2)
mcp-server/src/tools/index.js (1)
  • registerTaskMasterTools (40-194)
mcp-server/src/tools/tool-registry.js (6)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
🪛 LanguageTool
docs/configuration.md

[grammar] ~62-~62: Use correct spacing
Context: ...ture. ## MCP Tool Loading Configuration ### TASK_MASTER_TOOLS Environment Variable ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64: Use correct spacing
Context: ...# TASK_MASTER_TOOLS Environment Variable The TASK_MASTER_TOOLS environment vari...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66: There might be a problem here.
Context: ...oken usage based on your workflow needs. > Note > Prefer setting TASK_MASTER_TOOLS in ...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~69-~69: Use correct spacing
Context: ...id persisting non-secret settings there. #### Configuration Options - all (defa...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~71-~71: Use correct spacing
Context: ...tings there. #### Configuration Options - all (default): Loads all 36 available tools...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~73-~73: There might be a mistake here.
Context: ... all 36 available tools (~21,000 tokens) - Best for: Users who need the complete fe...

(QB_NEW_EN_OTHER)


[grammar] ~76-~76: There might be a problem here.
Context: ...ompatibility with existing installations - standard: Loads 15 commonly used tools (~10,000 t...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~78-~78: There might be a mistake here.
Context: ...ed tools (~10,000 tokens, 50% reduction) - Best for: Regular task management workfl...

(QB_NEW_EN_OTHER)


[grammar] ~81-~81: There might be a problem here.
Context: ...set of features with reduced token usage - core: Loads 7 essential tools (~5,000 tokens,...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~83-~83: There might be a mistake here.
Context: ...ial tools (~5,000 tokens, 70% reduction) - Best for: Daily development with minimal...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: There might be a mistake here.
Context: ...e contexts where token usage is critical - Custom list: Comma-separated list of s...

(QB_NEW_EN_OTHER)


[grammar] ~88-~88: There might be a mistake here.
Context: ...ma-separated list of specific tool names - Best for: Specialized workflows requirin...

(QB_NEW_EN)


[grammar] ~89-~89: There might be a mistake here.
Context: ...lized workflows requiring specific tools - Example: `"get_tasks,next_task,set_task_...

(QB_NEW_EN)


[grammar] ~90-~90: There might be a mistake here.
Context: ...s requiring specific tools - Example: "get_tasks,next_task,set_task_status" - Use when: You know exactly which tools y...

(QB_NEW_EN)


[grammar] ~91-~91: There might be a mistake here.
Context: ...n: You know exactly which tools you need #### How to Configure 1. **In MCP configurat...

(QB_NEW_EN_OTHER)


[grammar] ~93-~93: Use correct spacing
Context: ...ch tools you need #### How to Configure 1. In MCP configuration files (`.cursor/m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~95-~95: Use correct spacing
Context: ...code/mcp.json`, etc.) - Recommended: json { "mcpServers": { "task-master-ai": { "env": { "TASK_MASTER_TOOLS": "standard", // Set tool loading mode // API keys can still use .env for security } } } } 2. Via Claude Code CLI: ```bash cla...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~109-~109: Use correct spacing
Context: ... } 2. **Via Claude Code CLI**: bash claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest ``` 3. In CI/deployment environment variables...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~116-~116: Use correct spacing
Context: ...n CI/deployment environment variables**: bash export TASK_MASTER_TOOLS="standard" node mcp-server/server.js #### Tool Loading Behavior - If `TASK_MASTER...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~122-~122: Use correct spacing
Context: ...er.js ``` #### Tool Loading Behavior - If TASK_MASTER_TOOLS is not set or is ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~124-~124: Use the right pronoun
Context: ...ASK_MASTER_TOOLSis not set or is empty, defaults to"all"` - Invalid tool name...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~124-~124: Use correct spacing
Context: ...LSis not set or is empty, defaults to"all"` - Invalid tool names in custom lists are i...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~125-~125: There might be a mistake here.
Context: ...n custom lists are ignored with warnings - If all tools in a custom list are invali...

(QB_NEW_EN_OTHER)


[grammar] ~126-~126: Use the right pronoun
Context: ...f all tools in a custom list are invalid, falls back to "all" - Configuration i...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~126-~126: Use correct spacing
Context: ... custom list are invalid, falls back to "all" - Configuration is case-insensitive (`"COR...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~127-~127: There might be a mistake here.
Context: ... ("CORE", "core", "Core" all work) ## Environment Variables (.env file or MC...

(QB_NEW_EN_OTHER)

🪛 markdownlint-cli2 (0.17.2)
docs/configuration.md

96-96: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


110-110: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


117-117: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🔇 Additional comments (2)
docs/configuration.md (1)

68-70: Good guidance on where to set TASK_MASTER_TOOLS.

Clear note aligning with repo policy (.env for secrets; MCP env/CI for settings).

mcp-server/src/tools/index.js (1)

20-31: Optional: export getToolsConfiguration for reuse in callers/tests.

Expose it to allow upstream code to log/display the resolved mode and simplify tests.

-function getToolsConfiguration() {
+export function getToolsConfiguration() {

Likely an incorrect or invalid review comment.

Comment thread docs/configuration.md Outdated
Comment thread mcp-server/src/tools/index.js
Comment thread mcp-server/src/tools/index.js
Comment thread mcp-server/src/tools/index.js
Comment thread mcp-server/src/tools/index.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js
@karol-f karol-f force-pushed the feat-selective-mcp-tools-loading branch from 3024d99 to cd45de7 Compare September 5, 2025 19:33
@karol-f

karol-f commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

@Crunchyman-ralph I did:

  • rebased with the next branch
  • added CodeRabbit reviewed changes

Please take a look if you have time.

@ChrisGVE

Copy link
Copy Markdown

Why not make the tools discoverable and dynamically switchable, like the GitHub official mcp?

@karol-f

karol-f commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

Why not make the tools discoverable and dynamically switchable, like the GitHub official mcp?

I thought that GitHub MCP is the biggest offender when it comes to context widow cluttering.

EDIT
Confirmed it - adding it to CC taken over 20% of my context! Definately not a good MCP.

screenshot_4978

@ChrisGVE

ChrisGVE commented Sep 12, 2025 via email

Copy link
Copy Markdown

@ChrisGVE

Copy link
Copy Markdown

I'm sorry, but I didn't have access to my computer when I answered the first time. Here is the configuration as documented in the GitHub mcp server repo (https://github.com/github/github-mcp-server). You can click on the image to jump to the documentation section:
image
This allows me to save a lot of context tokens.

@karol-f

karol-f commented Sep 12, 2025

Copy link
Copy Markdown
Contributor Author

Dynamic Tool Discovery seems like a good idea. They say it's still in beta and might not work everywhere. So I assume there are some technical tricks with that approach.

I can also see that they also allow for similar approach that this PR introduces:
screenshot_4988

@Crunchyman-ralph

Copy link
Copy Markdown
Collaborator

next on my list, you can see we made a bunch of improvements to the next branch, but this doesn't seem to be in conflict with anything which is great.

Going to take it over, its on my list, but I gotta merge a couple of PR before I get to this, but not to worry, I'll be taking it over, polishing and merging!

@karol-f

karol-f commented Sep 25, 2025

Copy link
Copy Markdown
Contributor Author

Don't worry, take your time. If you will implement something different instead and not go with this PR it's also ok.

@Crunchyman-ralph Crunchyman-ralph force-pushed the feat-selective-mcp-tools-loading branch from d831485 to 5436da2 Compare October 14, 2025 15:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf7ede7 and 5436da2.

📒 Files selected for processing (8)
  • .changeset/light-owls-stay.md (1 hunks)
  • .env.example (1 hunks)
  • README.md (4 hunks)
  • docs/configuration.md (6 hunks)
  • mcp-server/src/index.js (2 hunks)
  • mcp-server/src/tools/index.js (1 hunks)
  • mcp-server/src/tools/tool-registry.js (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
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/index.js
  • mcp-server/src/tools/tool-registry.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/index.js
  • mcp-server/src/tools/tool-registry.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/index.js
  • mcp-server/src/tools/tool-registry.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/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/index.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 in mcp-server/src/core/utils/, tool execution/response helpers in mcp-server/src/tools/utils.js).

Files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/tools/tool-registry.js
package.json

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Files:

  • package.json
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in 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/light-owls-stay.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/light-owls-stay.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/light-owls-stay.md
.env.example

📄 CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

Add the new PROVIDER_API_KEY to .env.example.

Files:

  • .env.example
docs/**/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Add feature documentation to '/docs' folder, include tagged system usage examples, update command reference documentation, and provide migration notes if relevant.

Files:

  • docs/configuration.md
🧠 Learnings (39)
📓 Common learnings
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.
📚 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/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/index.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/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/index.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 kebab-case for all file names in mcp-server/src/tools/ and mcp-server/src/core/direct-functions/.

Applied to files:

  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `normalizeProjectRoot(rawPath, log)`, `getRawProjectRootFromSession(session, log)`, and `withNormalizedProjectRoot(executeFn)` in `mcp-server/src/tools/utils.js` to ensure project root paths are normalized for MCP tools.

Applied to files:

  • mcp-server/src/tools/index.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 : Do not log entire large data structures or sensitive information in MCP tool files.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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/index.js
  • package.json
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/index.js
📚 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/index.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For CLI usage, install Taskmaster globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.

Applied to files:

  • README.md
📚 Learning: 2025-09-24T15:12:58.855Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/**/.mcp.json : Configure the Task Master MCP server in .mcp.json under mcpServers.task-master-ai using npx task-master-ai and provide required API key env vars

Applied to files:

  • README.md
  • .changeset/light-owls-stay.md
  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/docs/*.txt : Place Product Requirements Documents (PRDs) for features or initiatives in `.taskmaster/docs/` with descriptive filenames (e.g., `.taskmaster/docs/feature-xyz-prd.txt`).

Applied to files:

  • README.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: After initializing a project with Taskmaster, you must parse a PRD in order to generate tasks. There will be no tasks files until then.

Applied to files:

  • README.md
📚 Learning: 2025-09-24T15:12:12.658Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: Start new projects with task-master init or parse a PRD via task-master parse-prd --input=<file> to generate an initial tasks.json

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For PRD-driven feature development, create a dedicated tag, draft a PRD in `.taskmaster/docs/`, parse it into tasks, and add a high-level reference in the master tag.

Applied to files:

  • README.md
📚 Learning: 2025-09-24T15:12:58.855Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.taskmaster/docs/*.{txt,md} : Keep PRDs as .txt or .md under .taskmaster/docs and parse them with task-master parse-prd (use --append for incremental updates)

Applied to files:

  • README.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information (taskmaster.mdc).

Applied to files:

  • README.md
  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • README.md
  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • README.md
  • docs/configuration.md
📚 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: Always prefer using the MCP tools (e.g., get_tasks, add_task) when interacting programmatically or via an integrated tool; use the CLI as a fallback or for direct user interaction.

Applied to files:

  • README.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.

Applied to files:

  • README.md
  • docs/configuration.md
📚 Learning: 2025-09-24T15:12:58.855Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/settings.json : Include the recommended tool allowlist in .claude/settings.json (Edit, Bash(task-master *), Bash(git commit:*), Bash(git add:*), Bash(npm run *), mcp__task_master_ai__*)

Applied to files:

  • README.md
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Applies to package.json : Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Applied to files:

  • package.json
📚 Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • .changeset/light-owls-stay.md
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and endpoint URLs for Taskmaster in a `.env` file (for CLI usage) or in the `env` section of `.cursor/mcp.json` (for MCP/Cursor integration). Do not store non-API key settings in these files.

Applied to files:

  • .env.example
  • docs/configuration.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to {.env,.cursor/mcp.json} : Store sensitive API keys and specific endpoint URLs in the `.env` file in the project root for CLI usage, or in the `env` section of `.cursor/mcp.json` for MCP/Cursor integration. Do not store non-API key settings in these files.

Applied to files:

  • .env.example
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {.env,.cursor/mcp.json} : Store API keys only in `.env` (for CLI, loaded by `dotenv` in `scripts/dev.js`) or `.cursor/mcp.json` (for MCP, accessed via `session.env`).

Applied to files:

  • .env.example
  • docs/configuration.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,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/tool-registry.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/{core/utils,tools}/**/*.js : Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/` (e.g., path/core logic helpers in `mcp-server/src/core/utils/`, tool execution/response helpers in `mcp-server/src/tools/utils.js`).

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Export all utility functions explicitly, group related functions logically, and include new tagged system utilities.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `handleApiResult`, `createContentResponse`, `createErrorResponse`, `getCachedOrExecute`, and `processMCPResponseData` in `mcp-server/src/tools/utils.js` to standardize MCP tool responses and caching.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-08-06T21:13:05.240Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: assets/claude/agents/task-orchestrator.md:69-78
Timestamp: 2025-08-06T21:13:05.240Z
Learning: For Claude agent instruction files in .claude/agents/ and assets/claude/agents/ directories, ignore markdownlint issues (like MD031 blanks-around-fences, MD040 fenced-code-language, MD041 missing top-level heading) as these files follow Claude's specific agent format requirements rather than standard markdown documentation conventions.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-10-14T14:30:14.696Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1289
File: mcp-server/server.js:10-12
Timestamp: 2025-10-14T14:30:14.696Z
Learning: In MCP server implementations using stdio transport (like mcp-server/server.js), the TASK_MASTER_MCP environment variable must be forced to 'true' unconditionally to silence console output from tm-core, as any console.log/warn/error would corrupt the JSON-RPC protocol stream. This is not a user preference but a technical requirement for stdio-based MCP servers.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to .taskmasterconfig : Use `.taskmasterconfig` (JSON) in the project root for storing Taskmaster configuration (excluding API keys), and manage it via the `task-master models --setup` CLI command or the `models` MCP tool.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Ensure `.taskmasterconfig` exists and has valid provider/model IDs for the roles you intend to use (manage via `task-master models --setup`).

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-18T17:06:04.909Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-07-18T17:06:04.909Z
Learning: When assigning a model to a role using the MCP tool or CLI, do not include the provider: prefix in the model ID; use only the model ID itself.

Applied to files:

  • docs/configuration.md
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to {.env,.cursor/mcp.json} : Set API keys for AI providers (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) in your .env file in the project root (for CLI use) or within the env section of your .cursor/mcp.json file (for MCP/Cursor integration).

Applied to files:

  • docs/configuration.md
🧬 Code graph analysis (2)
mcp-server/src/tools/index.js (1)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • getToolRegistration (155-157)
mcp-server/src/index.js (1)
mcp-server/src/tools/index.js (2)
  • getToolsConfiguration (20-31)
  • registerTaskMasterTools (40-221)
🪛 dotenv-linter (3.3.0)
.env.example

[warning] 17-17: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)


[warning] 17-17: [UnorderedKey] The GOOGLE_APPLICATION_CREDENTIALS key should go before the VERTEX_LOCATION key

(UnorderedKey)

🪛 LanguageTool
README.md

[grammar] ~287-~287: Use correct spacing
Context: ...scode ``` ## Tool Loading Configuration ### Optimizing MCP Tool Loading Task Master...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~289-~289: Use correct spacing
Context: ...uration ### Optimizing MCP Tool Loading Task Master's MCP server supports select...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~291-~291: Use correct spacing
Context: ...mpatibility with existing installations. You can optimize performance by configur...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~293-~293: Use correct spacing
Context: ...TASK_MASTER_TOOLS` environment variable: ### Available Modes | Mode | Tools | Contex...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~295-~295: Use correct spacing
Context: ...vironment variable: ### Available Modes | Mode | Tools | Context Usage | Use Cas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~297-~297: There might be a mistake here.
Context: ...ode | Tools | Context Usage | Use Case | |------|-------|--------------|---------...

(QB_NEW_EN)


[grammar] ~298-~298: There might be a mistake here.
Context: ...-----|-------|--------------|----------| | all (default) | 36 | ~21,000 tokens ...

(QB_NEW_EN)


[typographical] ~299-~299: To join two clauses or set off examples, consider using an em dash.
Context: ... 36 | ~21,000 tokens | Complete feature set - all tools available | | standard | 15 | ~...

(QB_NEW_EN_DASH_RULE_EM)


[grammar] ~299-~299: There might be a mistake here.
Context: ...lete feature set - all tools available | | standard | 15 | ~10,000 tokens | Com...

(QB_NEW_EN)


[grammar] ~300-~300: There might be a mistake here.
Context: ...ns | Common task management operations | | core (or lean) | 7 | ~5,000 tokens...

(QB_NEW_EN)


[grammar] ~301-~301: There might be a mistake here.
Context: ...| Essential daily development workflow | | custom | Variable | Variable | Comma...

(QB_NEW_EN)


[grammar] ~302-~302: Use correct spacing
Context: ...Comma-separated list of specific tools | ### Configuration Methods #### Method 1: En...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~304-~304: Use correct spacing
Context: ...cific tools | ### Configuration Methods #### Method 1: Environment Variable in MCP Co...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~306-~306: Use correct spacing
Context: ...nvironment Variable in MCP Configuration Add TASK_MASTER_TOOLS to your MCP conf...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~308-~308: Use correct spacing
Context: ... MCP configuration file's env section: jsonc { "mcpServers": { // or "servers" for VS Code "task-master-ai": { "command": "npx", "args": ["-y", "--package=task-master-ai", "task-master-ai"], "env": { "TASK_MASTER_TOOLS": "standard", // Options: "all", "standard", "core", "lean", or comma-separated list "ANTHROPIC_API_KEY": "your-key-here", // ... other API keys } } } } #### Method 2: Claude Code CLI (One-Time Setu...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~326-~326: Use correct spacing
Context: ...thod 2: Claude Code CLI (One-Time Setup) For Claude Code users, you can set the m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~328-~328: Use correct spacing
Context: ...ou can set the mode during installation: bash # Core mode example (~70% token reduction) claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest # Custom tools example claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="get_tasks,next_task,set_task_status" \ -- npx -y task-master-ai@latest ### Tool Sets Details Core Tools (7): `...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~342-~342: Use correct spacing
Context: ...ter-ai@latest ``` ### Tool Sets Details Core Tools (7): get_tasks, `next_tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~344-~344: Use correct spacing
Context: ...status, update_subtask, parse_prd, expand_task` Standard Tools (15): All core tools pl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~346-~346: Use correct spacing
Context: ... remove_task, generate, add_task, complexity_report All Tools (36): Complete set including...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~348-~348: Use correct spacing
Context: ..., dependencies, tags, research, and more ### Recommendations - New users: Start ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~350-~350: Use correct spacing
Context: ... research, and more ### Recommendations - New users: Start with "standard" mod...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~352-~352: There might be a mistake here.
Context: ...ith "standard" mode for a good balance - Large projects: Use "core" mode to m...

(QB_NEW_EN_OTHER)


[grammar] ~355-~355: There might be a mistake here.
Context: ... not specified, defaults to "all" mode ## Claude Code Support Task Master now sup...

(QB_NEW_EN_OTHER)

.changeset/light-owls-stay.md

[grammar] ~5-~5: There might be a mistake here.
Context: --- "task-master-ai": minor --- feat(mcp) add configurable MCP tool loading to re...

(QB_NEW_EN_OTHER)


[grammar] ~5-~5: There might be a mistake here.
Context: ...tool loading to reduce LLM context usage

(QB_NEW_EN_OTHER)

docs/configuration.md

[grammar] ~62-~62: Use correct spacing
Context: ...ture. ## MCP Tool Loading Configuration ### TASK_MASTER_TOOLS Environment Variable ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64: Use correct spacing
Context: ...# TASK_MASTER_TOOLS Environment Variable The TASK_MASTER_TOOLS environment vari...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66: There might be a problem here.
Context: ...oken usage based on your workflow needs. > Note > Prefer setting TASK_MASTER_TOOLS in ...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~69-~69: Use correct spacing
Context: ...id persisting non-secret settings there. #### Configuration Options - all (defa...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~71-~71: Use correct spacing
Context: ...tings there. #### Configuration Options - all (default): Loads all 36 available tools...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~73-~73: There might be a mistake here.
Context: ... all 36 available tools (~21,000 tokens) - Best for: Users who need the complete fe...

(QB_NEW_EN_OTHER)


[grammar] ~76-~76: There might be a problem here.
Context: ...ompatibility with existing installations - standard: Loads 15 commonly used tools (~10,000 t...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~78-~78: There might be a mistake here.
Context: ...ed tools (~10,000 tokens, 50% reduction) - Best for: Regular task management workfl...

(QB_NEW_EN_OTHER)


[grammar] ~81-~81: There might be a problem here.
Context: ...set of features with reduced token usage - core (or lean): Loads 7 essential tools (~5...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~83-~83: There might be a mistake here.
Context: ...ial tools (~5,000 tokens, 70% reduction) - Best for: Daily development with minimal...

(QB_NEW_EN_OTHER)


[grammar] ~87-~87: There might be a mistake here.
Context: ... an alias for "core" (same tools, token estimate and recommended use). You can refer to ...

(QB_NEW_EN_OTHER)


[grammar] ~87-~87: There might be a problem here.
Context: ...ither "core" or "lean" when configuring. - Custom list: Comma-separated list of specifi...

(QB_NEW_EN_MERGED_MATCH)


[grammar] ~89-~89: There might be a mistake here.
Context: ...ma-separated list of specific tool names - Best for: Specialized workflows requirin...

(QB_NEW_EN)


[grammar] ~90-~90: There might be a mistake here.
Context: ...lized workflows requiring specific tools - Example: `"get_tasks,next_task,set_task_...

(QB_NEW_EN)


[grammar] ~91-~91: There might be a mistake here.
Context: ...s requiring specific tools - Example: "get_tasks,next_task,set_task_status" - Use when: You know exactly which tools y...

(QB_NEW_EN)


[grammar] ~92-~92: There might be a mistake here.
Context: ...n: You know exactly which tools you need #### How to Configure 1. **In MCP configurat...

(QB_NEW_EN_OTHER)


[grammar] ~94-~94: Use correct spacing
Context: ...ch tools you need #### How to Configure 1. In MCP configuration files (`.cursor/m...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~96-~96: Use correct spacing
Context: ...code/mcp.json`, etc.) - Recommended: jsonc { "mcpServers": { "task-master-ai": { "env": { "TASK_MASTER_TOOLS": "standard", // Set tool loading mode // API keys can still use .env for security } } } } 2. Via Claude Code CLI: ```bash cl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~111-~111: Use correct spacing
Context: ... } 2. **Via Claude Code CLI**: bash claude mcp add task-master-ai --scope user \ --env TASK_MASTER_TOOLS="core" \ -- npx -y task-master-ai@latest ``` 3. In CI/deployment environment variables...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~119-~119: Use correct spacing
Context: ...n CI/deployment environment variables**: bash export TASK_MASTER_TOOLS="standard" node mcp-server/server.js #### Tool Loading Behavior - When `TASK_MAST...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~125-~125: Use correct spacing
Context: ...er.js ``` #### Tool Loading Behavior - When TASK_MASTER_TOOLS is unset or emp...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~127-~127: There might be a mistake here.
Context: ... unset or empty, the system defaults to "all" - Invalid tool names in a user-specified l...

(QB_NEW_EN)


[grammar] ~128-~128: There might be a mistake here.
Context: ... ignored (a warning is emitted for each) - If every tool name in a custom list is i...

(QB_NEW_EN_OTHER)


[grammar] ~129-~129: There might be a mistake here.
Context: ...st is invalid, the system falls back to "all" - Tool names are case-insensitive (e.g., `...

(QB_NEW_EN)


[grammar] ~130-~130: There might be a mistake here.
Context: ..., and "Core" are treated identically) ## Environment Variables (.env` file or MC...

(QB_NEW_EN_OTHER)

🪛 markdownlint-cli2 (0.18.1)
.changeset/light-owls-stay.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

docs/configuration.md

120-120: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🔇 Additional comments (11)
.env.example (1)

17-17: LGTM: No-op change confirmed.

The line replacement is functionally identical, as noted in the AI summary. The broader concerns about TASK_MASTER_TOOLS guidance and the missing trailing newline were already addressed in prior review comments.

.changeset/light-owls-stay.md (1)

1-5: LGTM: Changeset follows conventions.

The changeset correctly identifies the package (task-master-ai) and release type (minor), and provides a concise, user-facing summary in imperative mood describing the new MCP tool loading feature.

README.md (2)

122-122: LGTM: Clear inline configuration example.

The commented TASK_MASTER_TOOLS line provides helpful inline guidance for users configuring the MCP server.


287-356: Excellent documentation of the tool loading feature.

The Tool Loading Configuration section is comprehensive, well-organized, and user-friendly:

  • Clearly explains the token usage trade-offs for each mode
  • Documents the "lean" alias for "core" mode
  • Provides concrete configuration examples for multiple environments
  • Includes appropriate recommendations for different use cases

The tool counts (7 core, 15 standard, 36 total) match the code implementation as verified in past reviews.

mcp-server/src/tools/index.js (2)

20-31: LGTM: Clean environment variable helper.

The getToolsConfiguration() helper safely reads TASK_MASTER_TOOLS with appropriate defaults and debug logging. The trim() guards against whitespace-only values.


40-220: Excellent implementation of configurable tool loading.

The registerTaskMasterTools function is well-designed:

  • Case-insensitive mode handling (all/core/lean/standard/custom)
  • Robust custom tool name resolution with alias support and hyphen/underscore normalization
  • Graceful handling of invalid tools with warnings
  • Fallback to "all" mode on empty custom lists or parsing errors
  • Duplicate registration detection via error message inspection
  • Comprehensive result reporting (registered, failed, normalizedMode)

The implementation matches the documented behavior and handles edge cases appropriately.

mcp-server/src/index.js (1)

44-60: LGTM: Clean server initialization with tool mode support.

The init flow correctly:

  • Retrieves normalized tool mode via getToolsConfiguration()
  • Passes toolMode to registerTaskMasterTools
  • Logs startup info, normalized mode, and registration results
  • Uses debug level for the detailed tool list (avoiding stdio noise)
  • Warns about failed tools if any

All past review recommendations have been addressed.

docs/configuration.md (1)

62-131: Excellent MCP Tool Loading Configuration documentation.

The section is comprehensive and well-structured:

  • Clear explanation of all modes (all, standard, core/lean, custom) with token estimates
  • Documents the "lean" alias for "core" mode as requested in past reviews
  • Provides concrete configuration examples for multiple environments (MCP config, Claude Code CLI, CI/deployment)
  • Clearly states tool loading behavior (defaults, fallbacks, case-insensitivity)
  • Properly notes that .env is for API keys and TASK_MASTER_TOOLS should be set in MCP env block

The documentation matches the implementation and addresses all past review concerns.

mcp-server/src/tools/tool-registry.js (3)

47-84: LGTM: Well-organized centralized tool registry.

The toolRegistry object provides a clean, centralized mapping of all 36 tools to their registration functions. The structure is clear and maintainable. Static imports are appropriate for this Node.js server context, as noted in the past review discussion.


90-114: LGTM: Tool set definitions match documentation.

The coreTools (7 tools) and standardTools (15 tools) arrays are clearly defined and match the counts documented in README.md and docs/configuration.md. The use of spread syntax to include core tools in standard tools ensures consistency.


120-166: LGTM: Comprehensive helper functions for tool introspection.

The helper functions provide a clean public API for:

  • Listing all available tools
  • Getting tool counts by category
  • Retrieving tool categories with filtering
  • Looking up specific tool registrations
  • Validating tool names

The implementation is straightforward and well-documented.

Comment thread package.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mcp-server/src/index.js (1)

145-151: Bug: dereferencing session when it is falsy

In the else branch, session is falsy but you call session.server.sendLoggingMessage, which will throw. Use the server logger instead.

-    } else {
-      session.server.sendLoggingMessage({
-        data: {
-          context: session.context,
-          message: `No MCP sessions available, providers not registered`
-        },
-        level: 'warn'
-      });
-    }
+    } else {
+      this.logger.warn('No MCP sessions available, providers not registered');
+    }
♻️ Duplicate comments (7)
tests/unit/mcp/tools/tool-registration.test.js (4)

309-321: Remove wall-clock timing assertion; it’s flaky across CI environments

Keep only functional assertions.

-  const startTime = Date.now();
-  process.env.TASK_MASTER_TOOLS = 'all';
-  registerTaskMasterTools(mockServer);
-  const endTime = Date.now();
-  const executionTime = endTime - startTime;
-  expect(executionTime).toBeLessThan(100);
+  process.env.TASK_MASTER_TOOLS = 'all';
+  registerTaskMasterTools(mockServer);
   expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

323-341: Avoid tying tool counts to token-reduction percentages; assert relative sizes only

Rename and drop fixed thresholds.

-it('should validate token reduction claims', () => {
+it('should validate relative sizes of tool sets', () => {
@@
-  const allToolsCount = Object.keys(toolRegistry).length;
-  const coreReduction =
-    ((allToolsCount - coreTools.length) / allToolsCount) * 100;
-  const standardReduction =
-    ((allToolsCount - standardTools.length) / allToolsCount) * 100;
-
-  expect(coreReduction).toBeGreaterThan(80);
-  expect(standardReduction).toBeGreaterThan(50);
+  // No fixed % thresholds; token usage != tool count. Relative ordering asserted above.

357-365: Rename: this is repeated registration, not concurrent

Clarify intent to avoid implying concurrency semantics.

-it('should handle concurrent registration attempts', () => {
+it('should handle repeated registration attempts', () => {

256-256: Rename test to avoid “100% coverage” claim

Use a neutral name, e.g., “should cover environment modes matrix”.

-it('should provide 100% code coverage for environment control logic', () => {
+it('should cover environment modes matrix', () => {
mcp-server/src/tools/index.js (3)

148-150: Include normalized mode in the registration log

Aids debugging when input case varies.

-logger.info(
-  `Registering ${toolsToRegister.length} MCP tools (mode: ${enabledTools})`
-);
+logger.info(
+  `Registering ${toolsToRegister.length} MCP tools (mode: ${enabledTools}, normalized: ${lowerCaseConfig})`
+);

40-41: Optional: default to env helper for convenience

Consider reading env by default so callers don’t need to pass it.

-export function registerTaskMasterTools(server, toolMode = 'all') {
+export function registerTaskMasterTools(server, toolMode = getToolsConfiguration()) {

55-58: Document ‘lean’ as alias for ‘core’

Add a short comment to match docs and improve readability.

-      case 'core':
-      case 'lean':
+      case 'core':
+      case 'lean': // alias for 'core'
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a886d26 and b9ac19f.

📒 Files selected for processing (5)
  • mcp-server/src/index.js (2 hunks)
  • mcp-server/src/tools/index.js (1 hunks)
  • mcp-server/src/tools/tool-registry.js (1 hunks)
  • tests/helpers/tool-counts.js (1 hunks)
  • tests/unit/mcp/tools/tool-registration.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.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:

  • tests/helpers/tool-counts.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
  • tests/unit/mcp/tools/tool-registration.test.js
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/tool-registry.js
  • mcp-server/src/tools/index.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/tool-registry.js
  • mcp-server/src/tools/index.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/tool-registry.js
  • mcp-server/src/tools/index.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 in mcp-server/src/core/utils/, tool execution/response helpers in mcp-server/src/tools/utils.js).

Files:

  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{test,spec}.{js,jsx,ts,tsx}: NEVER use async/await in test functions unless testing actual asynchronous operations
Use synchronous top-level imports in tests; avoid dynamic await import()
Keep test bodies synchronous whenever possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧠 Learnings (27)
📚 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:

  • tests/helpers/tool-counts.js
  • mcp-server/src/tools/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
  • tests/unit/mcp/tools/tool-registration.test.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/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.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/tool-registry.js
  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/{core/utils,tools}/**/*.js : Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/` (e.g., path/core logic helpers in `mcp-server/src/core/utils/`, tool execution/response helpers in `mcp-server/src/tools/utils.js`).

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Export all utility functions explicitly, group related functions logically, and include new tagged system utilities.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to {scripts/modules/utils.js,mcp-server/src/core/utils/path-utils.js,mcp-server/src/tools/utils.js} : Keep utilities relevant to their location, export all utility functions in a single statement per file, group related exports together, export configuration constants, do not use default exports, and do not create circular dependencies.

Applied to files:

  • mcp-server/src/tools/tool-registry.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `handleApiResult`, `createContentResponse`, `createErrorResponse`, `getCachedOrExecute`, and `processMCPResponseData` in `mcp-server/src/tools/utils.js` to standardize MCP tool responses and caching.

Applied to files:

  • mcp-server/src/tools/tool-registry.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 kebab-case for all file names in mcp-server/src/tools/ and mcp-server/src/core/direct-functions/.

Applied to files:

  • mcp-server/src/tools/index.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 : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to mcp-server/src/tools/utils.js : Use `normalizeProjectRoot(rawPath, log)`, `getRawProjectRootFromSession(session, log)`, and `withNormalizedProjectRoot(executeFn)` in `mcp-server/src/tools/utils.js` to ensure project root paths are normalized for MCP tools.

Applied to files:

  • mcp-server/src/tools/index.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 : Do not log entire large data structures or sensitive information in MCP tool files.

Applied to files:

  • mcp-server/src/tools/index.js
  • mcp-server/src/index.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Applies to mcp-server/src/tools/*.js : 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.

Applied to files:

  • mcp-server/src/tools/index.js
📚 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 scripts/modules/**/*.test.js : Test CLI and MCP interfaces with real task data, verify end-to-end workflows across tag contexts, and test error scenarios and recovery in integration tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Do not import real AI service clients in tests; create fully mocked versions that return predictable responses.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-10-07T18:09:26.636Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T18:09:26.636Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Use synchronous top-level imports in tests; avoid dynamic await import()

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 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 scripts/modules/**/*.test.js : Follow the mock-first-then-import pattern and use jest.spyOn() for testing in Jest, clearing mocks between tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Applies to {src/utils/**,src/middleware/**} : Test coverage for all code should meet or exceed 80% lines/functions and 70% branches globally; critical code (utils, middleware) should meet higher thresholds (90% utils, 85% middleware)

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Always declare mocks before importing the modules being tested in Jest test files.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Module dependencies should be mocked before importing the test module, following Jest's hoisting behavior.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Troubleshoot mock functions not being called by ensuring mocks are defined before imports, referencing the correct mock instance, and verifying import paths.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Follow the mock-first-then-import pattern for all Jest mocks.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧬 Code graph analysis (4)
tests/helpers/tool-counts.js (1)
mcp-server/src/tools/tool-registry.js (2)
  • getToolCounts (128-134)
  • getToolCategories (140-148)
mcp-server/src/tools/index.js (1)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • getToolRegistration (155-157)
mcp-server/src/index.js (1)
mcp-server/src/tools/index.js (2)
  • getToolsConfiguration (20-31)
  • registerTaskMasterTools (40-227)
tests/unit/mcp/tools/tool-registration.test.js (3)
mcp-server/src/tools/tool-registry.js (6)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
tests/helpers/tool-counts.js (6)
  • validateToolCounts (38-57)
  • EXPECTED_TOOL_COUNTS (15-19)
  • EXPECTED_TOOL_COUNTS (15-19)
  • validateToolStructure (63-100)
  • EXPECTED_CORE_TOOLS (24-32)
  • EXPECTED_CORE_TOOLS (24-32)
mcp-server/src/tools/index.js (1)
  • registerTaskMasterTools (40-227)
🔇 Additional comments (4)
tests/helpers/tool-counts.js (1)

63-101: Solid structure validation

Subset checks and length alignment are clear and correct. Nice.

mcp-server/src/index.js (1)

47-74: Initialization and registration logging look good

Normalized mode + result logging are helpful. Debug-level list avoids noisy stdio.

mcp-server/src/tools/tool-registry.js (1)

47-84: Registry and category exports look consistent

36 total tools; core and standard sets align and expose clean helpers.

Also applies to: 90-114, 128-148, 155-167

tests/unit/mcp/tools/tool-registration.test.js (1)

203-209: Env-driven tests aren’t exercising env logic

registerTaskMasterTools doesn’t read process.env; these cases default to 'all' and don’t cover fallback/normalization. Import getToolsConfiguration() and pass it (or pass the env value explicitly).

+import { getToolsConfiguration } from '../../../../mcp-server/src/tools/index.js';
@@
- registerTaskMasterTools(mockServer);
+ registerTaskMasterTools(mockServer, getToolsConfiguration());
@@
- registerTaskMasterTools(mockServer);
+ registerTaskMasterTools(mockServer, getToolsConfiguration());
@@
- registerTaskMasterTools(mockServer);
+ registerTaskMasterTools(mockServer, getToolsConfiguration());
@@
- expect(() => registerTaskMasterTools(mockServer)).not.toThrow();
- expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);
+ expect(() => registerTaskMasterTools(mockServer, getToolsConfiguration())).not.toThrow();
+ expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

Also applies to: 211-217, 238-244, 401-409

⛔ Skipped due to learnings
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 scripts/modules/**/*.test.js : Test CLI and MCP interfaces with real task data, verify end-to-end workflows across tag contexts, and test error scenarios and recovery in integration tests.
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/.

Comment thread tests/helpers/tool-counts.js
Comment thread tests/unit/mcp/tools/tool-registration.test.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (9)
tests/unit/mcp/tools/tool-registration.test.js (9)

71-82: Avoid brittle EXPECTED_ constants; use derived counts from the registry*

Relying on EXPECTED_TOOL_COUNTS/EXPECTED_CORE_TOOLS makes tests fragile. Prefer ALL_COUNT/CORE_COUNT/STANDARD_COUNT derived above.

-			expect(validation.actual.total).toBe(EXPECTED_TOOL_COUNTS.total);
-			expect(validation.actual.core).toBe(EXPECTED_TOOL_COUNTS.core);
-			expect(validation.actual.standard).toBe(EXPECTED_TOOL_COUNTS.standard);
+			expect(validation.actual.total).toBe(ALL_COUNT);
+			expect(validation.actual.core).toBe(CORE_COUNT);
+			expect(validation.actual.standard).toBe(STANDARD_COUNT);
@@
-			expect(coreTools.length).toBe(EXPECTED_TOOL_COUNTS.core);
+			expect(coreTools.length).toBe(CORE_COUNT);
@@
-			expect(standardTools.length).toBe(EXPECTED_TOOL_COUNTS.standard);
+			expect(standardTools.length).toBe(STANDARD_COUNT);

If you want to verify specific names, keep the arrayContaining(EXPECTED_CORE_TOOLS) but avoid asserting exact counts via hard-coded constants. As per coding guidelines.

Also applies to: 92-94, 99-100


123-160: Use derived counts consistently; drop helper constants in mode tests

Replace EXPECTED_TOOL_COUNTS.* with ALL_COUNT/CORE_COUNT/STANDARD_COUNT.

-			expect(mockServer.addTool).toHaveBeenCalledTimes(
-				EXPECTED_TOOL_COUNTS.total
-			);
+			expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);
@@
-			expect(mockServer.addTool).toHaveBeenCalledTimes(
-				EXPECTED_TOOL_COUNTS.core
-			);
+			expect(mockServer.addTool).toHaveBeenCalledTimes(CORE_COUNT);
@@
-			expect(mockServer.addTool).toHaveBeenCalledTimes(
-				EXPECTED_TOOL_COUNTS.standard
-			);
+			expect(mockServer.addTool).toHaveBeenCalledTimes(STANDARD_COUNT);

200-207: Exercise the fallback path by passing the invalid mode explicitly

Setting env alone doesn’t affect registerTaskMasterTools (it uses its arg). Pass the invalid input to cover the custom-list fallback branch.

-			process.env.TASK_MASTER_TOOLS = 'completely_invalid';
-
-			registerTaskMasterTools(mockServer);
+			process.env.TASK_MASTER_TOOLS = 'completely_invalid';
+			registerTaskMasterTools(mockServer, 'completely_invalid');

208-214: Test empty-string handling via the function arg

To hit the “empty custom list → fallback to all” logic, pass '' as the toolMode.

-			process.env.TASK_MASTER_TOOLS = '';
-
-			registerTaskMasterTools(mockServer);
+			process.env.TASK_MASTER_TOOLS = '';
+			registerTaskMasterTools(mockServer, '');

235-241: Cover “only commas” by passing it to toolMode

Ensure the parser path runs by providing the string to the function.

-			process.env.TASK_MASTER_TOOLS = ',,,';
-
-			registerTaskMasterTools(mockServer);
+			process.env.TASK_MASTER_TOOLS = ',,,';
+			registerTaskMasterTools(mockServer, ',,,');

252-254: Rename: drop “100% coverage” claim; describe what’s tested

Keep the matrix; avoid the “100% coverage” assertion in a unit test name.

-		it('should provide 100% code coverage for environment control logic', () => {
+		it('should cover the environment modes matrix', () => {

306-318: Remove time-based assertion to avoid CI flakiness

Wall-clock thresholds are unreliable; assert only functional results.

-			const startTime = Date.now();
-
 			process.env.TASK_MASTER_TOOLS = 'all';
 
 			registerTaskMasterTools(mockServer);
-
-			const endTime = Date.now();
-			const executionTime = endTime - startTime;
-
-			expect(executionTime).toBeLessThan(100);
 			expect(mockServer.addTool).toHaveBeenCalledTimes(ALL_COUNT);

320-338: Don’t equate tool count with token reduction; keep relative-size checks

Counts are proxies. Drop fixed percentage thresholds; assert ordering only.

-			const allToolsCount = Object.keys(toolRegistry).length;
-			const coreReduction =
-				((allToolsCount - coreTools.length) / allToolsCount) * 100;
-			const standardReduction =
-				((allToolsCount - standardTools.length) / allToolsCount) * 100;
-
-			expect(coreReduction).toBeGreaterThan(80);
-			expect(standardReduction).toBeGreaterThan(50);
+			// Token usage != tool count; relative ordering asserted above.

354-362: Rename test to reflect sequential repeated registrations
Update the test title:

-it('should handle concurrent registration attempts', () => {
+it('should accumulate registrations across repeated invocations', () => {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9ac19f and 73e5fef.

📒 Files selected for processing (1)
  • tests/unit/mcp/tools/tool-registration.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/mcp/tools/tool-registration.test.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:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{test,spec}.{js,jsx,ts,tsx}: NEVER use async/await in test functions unless testing actual asynchronous operations
Use synchronous top-level imports in tests; avoid dynamic await import()
Keep test bodies synchronous whenever possible

Files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧠 Learnings (15)
📓 Common learnings
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.
📚 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 scripts/modules/**/*.test.js : Test CLI and MCP interfaces with real task data, verify end-to-end workflows across tag contexts, and test error scenarios and recovery in integration tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Do not import real AI service clients in tests; create fully mocked versions that return predictable responses.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-10-07T18:09:26.636Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T18:09:26.636Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Use synchronous top-level imports in tests; avoid dynamic await import()

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 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 scripts/modules/**/*.test.js : Follow the mock-first-then-import pattern and use jest.spyOn() for testing in Jest, clearing mocks between tests.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.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:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Applies to {src/utils/**,src/middleware/**} : Test coverage for all code should meet or exceed 80% lines/functions and 70% branches globally; critical code (utils, middleware) should meet higher thresholds (90% utils, 85% middleware)

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Always declare mocks before importing the modules being tested in Jest test files.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:07:39.336Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-07-18T17:07:39.336Z
Learning: Module dependencies should be mocked before importing the test module, following Jest's hoisting behavior.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Troubleshoot mock functions not being called by ensuring mocks are defined before imports, referencing the correct mock instance, and verifying import paths.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Follow the mock-first-then-import pattern for all Jest mocks.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.

Applied to files:

  • tests/unit/mcp/tools/tool-registration.test.js
🧬 Code graph analysis (1)
tests/unit/mcp/tools/tool-registration.test.js (3)
mcp-server/src/tools/tool-registry.js (7)
  • toolRegistry (47-84)
  • toolRegistry (47-84)
  • coreTools (90-98)
  • coreTools (90-98)
  • standardTools (104-114)
  • standardTools (104-114)
  • allTools (141-141)
tests/helpers/tool-counts.js (6)
  • validateToolCounts (38-57)
  • EXPECTED_TOOL_COUNTS (15-19)
  • EXPECTED_TOOL_COUNTS (15-19)
  • validateToolStructure (63-100)
  • EXPECTED_CORE_TOOLS (24-32)
  • EXPECTED_CORE_TOOLS (24-32)
mcp-server/src/tools/index.js (1)
  • registerTaskMasterTools (40-227)
🔇 Additional comments (1)
tests/unit/mcp/tools/tool-registration.test.js (1)

388-408: Pass problematic inputs as the function arg to cover custom-list parsing

Currently this only proves the default ('all') path. Provide input to the parser to assert fallback-to-all behavior.

-				process.env.TASK_MASTER_TOOLS = input;
-
-				expect(() => registerTaskMasterTools(mockServer)).not.toThrow();
+				process.env.TASK_MASTER_TOOLS = input;
+				expect(() => registerTaskMasterTools(mockServer, input)).not.toThrow();
⛔ Skipped due to learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock the action handlers for CLI commands and verify they're called with correct arguments.

Comment on lines +216 to +233
it('should handle whitespace in comma-separated lists', () => {
process.env.TASK_MASTER_TOOLS = ' get_tasks , next_task , get_task ';

registerTaskMasterTools(mockServer, ' get_tasks , next_task , get_task ');

expect(mockServer.addTool).toHaveBeenCalledTimes(3);
});

it('should ignore duplicate tools in list', () => {
process.env.TASK_MASTER_TOOLS = 'get_tasks,get_tasks,next_task,get_tasks';

registerTaskMasterTools(
mockServer,
'get_tasks,get_tasks,next_task,get_tasks'
);

expect(mockServer.addTool).toHaveBeenCalledTimes(2);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add alias/normalization tests (underscores vs hyphens, alias map)

Cover alias resolution and normalization to lock behavior.

Example to add after this block:

it('should resolve aliases and hyphen/underscore normalization', () => {
  // alias: response_language -> response-language
  registerTaskMasterTools(mockServer, 'response_language');
  expect(mockServer.addTool).toHaveBeenCalledTimes(1);
  mockServer.addTool.mockClear();

  // normalization: underscores to hyphens and vice versa
  registerTaskMasterTools(mockServer, 'response-language');
  expect(mockServer.addTool).toHaveBeenCalledTimes(1);
});

I can open a follow-up PR with these additions if desired.

🤖 Prompt for AI Agents
In tests/unit/mcp/tools/tool-registration.test.js around lines 216 to 233, add
unit tests to cover alias resolution and hyphen/underscore normalization: create
a test that registers an alias (e.g., "response_language" which should map to
"response-language") and asserts mockServer.addTool is called once, clear the
mock, then register the normalized form ("response-language") and assert addTool
is called once again; ensure you use registerTaskMasterTools(mockServer,
'<tool>') for each case and call mockServer.addTool.mockClear() between
assertions so duplicates from prior calls don't affect counts.

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.

3 participants