Commit Graph

167 Commits

Author SHA1 Message Date
Eyal Toledano
c58d4b51ef Implement fix-dependencies MCP command for automatically fixing invalid dependencies 2025-03-31 14:01:49 -04:00
Eyal Toledano
9730576a03 Implement validate-dependencies MCP command for checking dependency validity 2025-03-31 13:55:07 -04:00
Eyal Toledano
a6a94e3a18 Implement remove-dependency MCP command for removing dependencies from tasks 2025-03-31 13:51:39 -04:00
Eyal Toledano
38c368a745 chore: task mgmt 2025-03-31 13:41:05 -04:00
Eyal Toledano
f032116961 chore: task mgmt 2025-03-31 13:28:36 -04:00
Eyal Toledano
c274c77aa7 feat(ui): add color-coded progress bar to task show view for visualizing subtask completion status 2025-03-31 13:18:58 -04:00
Eyal Toledano
1c72c88a32 Implement expand-all MCP command for expanding all pending tasks with subtasks 2025-03-31 13:10:10 -04:00
Eyal Toledano
f007df06d8 Implement clear-subtasks MCP command for clearing subtasks from parent tasks 2025-03-31 13:07:42 -04:00
Eyal Toledano
6481f725aa Implement analyze-complexity MCP command for analyzing task complexity 2025-03-31 13:04:53 -04:00
Eyal Toledano
a3abf194ad Implement remove-subtask MCP command for removing subtasks from parent tasks 2025-03-31 13:01:31 -04:00
Eyal Toledano
0b6207c882 Implement add-subtask MCP command for adding subtasks to existing tasks 2025-03-31 12:56:38 -04:00
Eyal Toledano
1bb1309ef8 feat: implement add-task MCP command
- Create direct function wrapper in add-task.js with prompt and dependency handling

- Add MCP tool integration for creating new tasks via AI

- Update task-master-core.js to expose addTaskDirect function

- Update changeset to document the new command
2025-03-31 12:50:14 -04:00
Eyal Toledano
5296e50b6a chore: uncomments the addResource and addResourceTemplate calls in the index.js for MCP. TODO: Figure out the project roots so we can do this on other projects vs just our own. 2025-03-31 12:47:53 -04:00
Eyal Toledano
b2b1a1ef8f feat: implement expand-task MCP command
- Create direct function wrapper in expand-task.js with error handling

- Add MCP tool integration for breaking down tasks into subtasks

- Update task-master-core.js to expose expandTaskDirect function

- Update changeset to document the new command

- Parameter support for subtask generation options (num, research, prompt, force)
2025-03-31 12:06:23 -04:00
Eyal Toledano
20d04b243b feat: implement next-task MCP command
- Create direct function wrapper in next-task.js with error handling and caching

- Add MCP tool integration for finding the next task to work on

- Update task-master-core.js to expose nextTaskDirect function

- Update changeset to document the new command
2025-03-31 12:00:23 -04:00
Eyal Toledano
7cd94959b9 chore: task mgmt 2025-03-31 11:57:54 -04:00
Eyal Toledano
407a4e880d feat: implement show-task MCP command
- Create direct function wrapper in show-task.js with error handling and caching

- Add MCP tool integration for displaying detailed task information

- Update task-master-core.js to expose showTaskDirect function

- Update changeset to document the new command

- Follow kebab-case/camelCase/snake_case naming conventions
2025-03-31 11:57:23 -04:00
Eyal Toledano
d822dc08fe Merge branch 'next' of github.com:eyaltoledano/claude-task-master into 23.16-23.30 2025-03-31 11:42:06 -04:00
github-actions[bot]
76618187f6 Version Packages (#57) 2025-03-31 17:13:02 +02:00
Ralph Khreish
757fd478d2 Add License (#45) 2025-03-31 17:09:31 +02:00
Eyal Toledano
5914771636 docs: document MCP server naming conventions and implement set-status
- Update architecture.mdc with file/function naming standards for MCP server components

- Update mcp.mdc with detailed naming conventions section

- Update task 23 to include naming convention details

- Update changeset to capture documentation changes

- Rename MCP tool files to follow kebab-case convention

- Implement set-task-status MCP command
2025-03-31 03:35:14 -04:00
Eyal Toledano
9d1ec10c34 feat: implement set-status MCP command and update changeset 2025-03-31 02:19:53 -04:00
Eyal Toledano
7d90d6808d feat(mcp): Implement generate MCP command for creating task files from tasks.json 2025-03-31 02:17:07 -04:00
Eyal Toledano
14a3512325 feat(mcp): Implement update-subtask MCP command for appending information to subtasks 2025-03-31 02:13:13 -04:00
Eyal Toledano
a186cb43e3 feat(mcp): Implement update-task MCP command for updating single tasks by ID with proper direct function wrapper, MCP tool implementation, and registration 2025-03-31 02:02:01 -04:00
Eyal Toledano
74dcf3b5f4 refactor(mcp): Modularize direct functions in MCP server
Split monolithic task-master-core.js into separate function files within
the mcp-server/src/core/direct-functions/ directory. This change:

- Creates individual files for each direct function implementation
- Moves findTasksJsonPath to a dedicated utils/path-utils.js file
- Converts task-master-core.js to be a simple import/export hub
- Improves maintainability and organization of the codebase
- Reduces potential merge conflicts when multiple developers contribute
- Follows standard module separation patterns

Each function is now in its own self-contained file with clear imports and
focused responsibility, while maintaining the same API endpoints.
2025-03-31 01:52:34 -04:00
Eyal Toledano
a588098fca Adds update direct function into MCP. 2025-03-31 00:49:16 -04:00
Eyal Toledano
99426d9bb1 chore: adds changeset.mdc to help agent automatically trigger changeset command with contextual information based on how we want to use it. not to be called for internal dev stuff. 2025-03-30 23:51:55 -04:00
Eyal Toledano
151c31e550 refactor(mcp): Remove unused executeMCPToolAction utility
The  function aimed to abstract the common flow within MCP tool  methods (logging, calling direct function, handling result).

However, the established pattern (e.g., in ) involves the  method directly calling the  function (which handles its own caching via ) and then passing the result to . This pattern is clear, functional, and leverages the core utilities effectively.

Removing the unused  simplifies , eliminates a redundant abstraction layer, and clarifies the standard implementation pattern for MCP tools.
2025-03-30 23:37:24 -04:00
Eyal Toledano
26a37d28ce chore: removes mcp sdk from package json. was erroneously added by a test. 2025-03-30 23:14:14 -04:00
Eyal Toledano
6e6407f683 Merge pull request #69 from eyaltoledano/add-test-for-confirmation-prompt
Add test for confirmation prompt
2025-03-30 23:10:21 -04:00
Eyal Toledano
80f933cd82 test: Add tests for parse-prd overwrite confirmation and fix existing test
Adds unit tests to tests/unit/task-manager.test.js for the parse-prd command confirmation prompt when overwriting an existing tasks.json file. Also fixes the existing directory creation test. Refs #67, Fixes #65
2025-03-30 23:09:05 -04:00
Eyal Toledano
2c3986c097 Merge pull request #67 from joedanz/confirm-tasks.json-overwrite
Added confirmation for task overwrite if tasks.json exists.
Fully tested

POPS @JOEDANZ' DEV CHERRY!
2025-03-30 23:00:53 -04:00
Joe Danziger
7086a77625 Added confirmation for task overwrite if tasks.json exists.
Slight refactor moving numTasks and outputPath to top with the other variables.  Eliminates duplication, and keeps us from having to check path twice.
Resolves #65
2025-03-30 18:30:00 -04:00
Eyal Toledano
66ca02242d Merge pull request #63 from eyaltoledano/23.9
23.9
2025-03-30 02:58:20 -04:00
Eyal Toledano
c211818303 chore: task management 2025-03-30 02:56:14 -04:00
Eyal Toledano
728ba254c9 chore: documentation update and cursor rules update. 2025-03-30 02:38:51 -04:00
Eyal Toledano
42585519d3 feat(cache): Implement caching for listTasks MCP endpoint
Implemented LRU caching for the  function to improve performance for repeated requests.

Key changes include:
- Added  dependency.
- Introduced a reusable  utility function in  leveraging a .
- Refactored  in  to use the caching utility with a key based on task path, filter, and subtask flag.
- Modified  to include the  boolean flag in the final JSON response structure, nesting the original data under a  key.
- Added  function and corresponding MCP tool () for monitoring cache performance.
- Improved error handling in  for cases where  is not found.

This addresses the previous issue of the empty task list likely caused by stale cache entries and provides clear visibility into whether a response is served from the cache.

Relates to #23.9
2025-03-30 02:25:24 -04:00
Eyal Toledano
cd4f4e66d7 feat(mcp): Refactor MCP tools for direct function calls & add docs
This commit introduces a major refactoring of the MCP server implementation to prioritize direct function calls over CLI execution, enhancing performance and reliability. It also includes substantial updates to documentation for consistency and interlinking.

**MCP Server & Core Logic Refactoring:**

1.  **Introduce Direct Function Wrappers ():**
    *   Created  to house direct wrappers for core Task Master functions (imported from ).
    *   Implemented  as the first wrapper, calling .
    *   Added  utility within  to centralize  file location logic, removing duplication.
    *   Established the  map for registering these wrappers.

2.  **Enhance MCP Utilities ():**
    *   Added : A primary utility function to streamline MCP tool  methods. It handles logging, argument processing (incl. project root normalization), calling the direct action function (e.g., ), processing results via , and formatting the final MCP response.
    *   Added : Standardizes processing of  objects returned by direct function wrappers.
    *   Added : Filters sensitive/large fields (like , ) from responses sent to the MCP client.
    *   Added , ,  to support the new workflow.
    *   Refactored  to use  internally, simplifying its usage (though it's now primarily a fallback).

3.  **Update MCP Tools (, ):**
    *   Refactored  to use  with , significantly simplifying the tool's  method.
    *   Updated  (initially) to use the improved  (Note: further refactoring to use a direct wrapper for  would follow the  pattern).

**Documentation Enhancements:**

4.  **Comprehensive Interlinking:** Added  links across rule files (, , , , , ) to connect related guidelines, improving navigation.

5.  **Standardize CLI Syntax ():** Removed legacy ℹ️ Initialized Perplexity client with OpenAI compatibility layer examples, reinforcing ℹ️ Initialized Perplexity client with OpenAI compatibility layer
  _____         _      __  __           _
 |_   _|_ _ ___| | __ |  \/  | __ _ ___| |_ ___ _ __
   | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__|
   | | (_| \__ \   <  | |  | | (_| \__ \ ||  __/ |
   |_|\__,_|___/_|\_\ |_|  |_|\__,_|___/\__\___|_|

by https://x.com/eyaltoledano
╭────────────────────────────────────────────╮
│                                            │
│   Version: 0.9.30   Project: Task Master   │
│                                            │
╰────────────────────────────────────────────╯

╭─────────────────────╮
│                     │
│   Task Master CLI   │
│                     │
╰─────────────────────╯

╭───────────────────╮
│  Task Generation  │
╰───────────────────╯
    parse-prd                 --input=<file.txt> [--tasks=10]          Generate tasks from a PRD document
    generate                                                           Create individual task files from tasks…

╭───────────────────╮
│  Task Management  │
╰───────────────────╯
    list                      [--status=<status>] [--with-subtas…      List all tasks with their status
    set-status                --id=<id> --status=<status>              Update task status (done, pending, etc.)
    update                    --from=<id> --prompt="<context>"         Update tasks based on new requirements
    add-task                  --prompt="<text>" [--dependencies=…      Add a new task using AI
    add-dependency            --id=<id> --depends-on=<id>              Add a dependency to a task
    remove-dependency         --id=<id> --depends-on=<id>              Remove a dependency from a task

╭──────────────────────────╮
│  Task Analysis & Detail  │
╰──────────────────────────╯
    analyze-complexity        [--research] [--threshold=5]             Analyze tasks and generate expansion re…
    complexity-report         [--file=<path>]                          Display the complexity analysis report
    expand                    --id=<id> [--num=5] [--research] […      Break down tasks into detailed subtasks
    expand --all              [--force] [--research]                   Expand all pending tasks with subtasks
    clear-subtasks            --id=<id>                                Remove subtasks from specified tasks

╭─────────────────────────────╮
│  Task Navigation & Viewing  │
╰─────────────────────────────╯
    next                                                               Show the next task to work on based on …
    show                      <id>                                     Display detailed information about a sp…

╭─────────────────────────╮
│  Dependency Management  │
╰─────────────────────────╯
    validate-dependenci…                                               Identify invalid dependencies without f…
    fix-dependencies                                                   Fix invalid dependencies automatically

╭─────────────────────────╮
│  Environment Variables  │
╰─────────────────────────╯
    ANTHROPIC_API_KEY              Your Anthropic API key                             Required
    MODEL                          Claude model to use                                Default: claude-3-7-sonn…
    MAX_TOKENS                     Maximum tokens for responses                       Default: 4000
    TEMPERATURE                    Temperature for model responses                    Default: 0.7
    PERPLEXITY_API_KEY             Perplexity API key for research                    Optional
    PERPLEXITY_MODEL               Perplexity model to use                            Default: sonar-pro
    DEBUG                          Enable debug logging                               Default: false
    LOG_LEVEL                      Console output level (debug,info,warn,error)       Default: info
    DEFAULT_SUBTASKS               Default number of subtasks to generate             Default: 3
    DEFAULT_PRIORITY               Default task priority                              Default: medium
    PROJECT_NAME                   Project name displayed in UI                       Default: Task Master

  _____         _      __  __           _
 |_   _|_ _ ___| | __ |  \/  | __ _ ___| |_ ___ _ __
   | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__|
   | | (_| \__ \   <  | |  | | (_| \__ \ ||  __/ |
   |_|\__,_|___/_|\_\ |_|  |_|\__,_|___/\__\___|_|

by https://x.com/eyaltoledano
╭────────────────────────────────────────────╮
│                                            │
│   Version: 0.9.30   Project: Task Master   │
│                                            │
╰────────────────────────────────────────────╯

╭─────────────────────╮
│                     │
│   Task Master CLI   │
│                     │
╰─────────────────────╯

╭───────────────────╮
│  Task Generation  │
╰───────────────────╯
    parse-prd                 --input=<file.txt> [--tasks=10]          Generate tasks from a PRD document
    generate                                                           Create individual task files from tasks…

╭───────────────────╮
│  Task Management  │
╰───────────────────╯
    list                      [--status=<status>] [--with-subtas…      List all tasks with their status
    set-status                --id=<id> --status=<status>              Update task status (done, pending, etc.)
    update                    --from=<id> --prompt="<context>"         Update tasks based on new requirements
    add-task                  --prompt="<text>" [--dependencies=…      Add a new task using AI
    add-dependency            --id=<id> --depends-on=<id>              Add a dependency to a task
    remove-dependency         --id=<id> --depends-on=<id>              Remove a dependency from a task

╭──────────────────────────╮
│  Task Analysis & Detail  │
╰──────────────────────────╯
    analyze-complexity        [--research] [--threshold=5]             Analyze tasks and generate expansion re…
    complexity-report         [--file=<path>]                          Display the complexity analysis report
    expand                    --id=<id> [--num=5] [--research] […      Break down tasks into detailed subtasks
    expand --all              [--force] [--research]                   Expand all pending tasks with subtasks
    clear-subtasks            --id=<id>                                Remove subtasks from specified tasks

╭─────────────────────────────╮
│  Task Navigation & Viewing  │
╰─────────────────────────────╯
    next                                                               Show the next task to work on based on …
    show                      <id>                                     Display detailed information about a sp…

╭─────────────────────────╮
│  Dependency Management  │
╰─────────────────────────╯
    validate-dependenci…                                               Identify invalid dependencies without f…
    fix-dependencies                                                   Fix invalid dependencies automatically

╭─────────────────────────╮
│  Environment Variables  │
╰─────────────────────────╯
    ANTHROPIC_API_KEY              Your Anthropic API key                             Required
    MODEL                          Claude model to use                                Default: claude-3-7-sonn…
    MAX_TOKENS                     Maximum tokens for responses                       Default: 4000
    TEMPERATURE                    Temperature for model responses                    Default: 0.7
    PERPLEXITY_API_KEY             Perplexity API key for research                    Optional
    PERPLEXITY_MODEL               Perplexity model to use                            Default: sonar-pro
    DEBUG                          Enable debug logging                               Default: false
    LOG_LEVEL                      Console output level (debug,info,warn,error)       Default: info
    DEFAULT_SUBTASKS               Default number of subtasks to generate             Default: 3
    DEFAULT_PRIORITY               Default task priority                              Default: medium
    PROJECT_NAME                   Project name displayed in UI                       Default: Task Master       as the primary CLI.

6.  **Add MCP Architecture & Workflow Sections:** Added detailed sections in  and  explaining MCP server structure and the workflow for adding new MCP tool integrations using the direct function pattern.

7.  **Clarify MCP Role:** Updated  and  to better explain the MCP server's role and its specific utilities.

Overall, this establishes a cleaner, more performant, and maintainable pattern for integrating Task Master functionality with the MCP server, supported by improved documentation.
2025-03-30 00:29:12 -04:00
Eyal Toledano
a5370ebdb7 Merge pull request #61 from eyaltoledano/update-subtask
Okay, focusing specifically on the `update-subtask` functionality and the related fix we worked on, here's a succinct description suitable for a commit message body or PR:

*   **`update-subtask` Feature:**
    *   Allows appending additional information (details, context) to an *existing* subtask using AI (`updateSubtaskById` function in `task-manager.js`).
    *   Crucially, it *adds* information rather than overwriting existing content.
    *   Uses XML-like tags (`<info added on ...>`) with timestamps to mark the added content within the subtask's `details` field in `tasks.json`.
    *   Preserves completed subtasks, preventing modification of 'done' items.
*   **Associated UI Fix:**
    *   Corrected the `show <subtask_id>` command (`displayTaskById` in `ui.js`) to display the `details` field for subtasks.
    *   This ensures the information appended by `update-subtask` is actually visible to the user.
2025-03-29 20:36:36 -04:00
Eyal Toledano
1094f50014 fix(ui): Display subtask details in 'show' command output
Ensures that the 'details' field, which can be updated via 'update-subtask', is correctly rendered when viewing a specific subtask.

fix(test): Remove empty describe block causing Jest error

Removes a redundant  block in  that contained a  hook but no tests.

chore: Add  npm script
2025-03-29 20:33:18 -04:00
Eyal Toledano
4604f96a92 New update-subtask command. 2025-03-29 19:14:44 -04:00
Eyal Toledano
e70f44b6fb fix: Correct handling of dependencies between subtasks
This commit fixes an issue with the dependency management system where
dependencies between subtasks of the same parent task were not being
handled correctly. Previously, when trying to add a dependency between
subtasks (e.g., making 23.8 depend on 23.13), the system incorrectly
interpreted it as a circular dependency of the parent task depending
on itself.

Changes:
- Modified add-dependency and remove-dependency commands to preserve
  string format for subtask IDs containing dots instead of converting
  them to integers
- Updated dependency detection logic to properly handle string-based
  subtask IDs
- Added specific tests verifying both successful dependency chains
  and circular dependency detection between subtasks of the same parent

The fix ensures proper task ordering for development workflows where
related subtasks must be completed in sequence (like establishing tests
before implementing a feature). It maintains backward compatibility with
existing task structures while correctly enforcing dependency chains
within subtask groups.

Tests:
- Added tests for valid dependency chains between subtasks of the same parent
- Added tests for circular dependency detection in subtask relationships
- Added specific test for the 23.8->23.13->23.10 subtask dependency chain

Resolves the issue where the suggested task development workflow couldn't
be properly enforced through the dependency management system.
2025-03-29 18:19:39 -04:00
Eyal Toledano
57f655affd adds mcp protocol spec and docs. 2025-03-29 18:07:51 -04:00
Eyal Toledano
38cd889ccd chore: expands some tasks and adds 'inspector' commands to scripts in package json to easily get inspector up for our mcp server at http://localhost:8888/?proxyPort=9000 which should play nice for those of us who have shit running on 3000 2025-03-29 17:52:11 -04:00
Eyal Toledano
18ea4dd4a8 Restore correct versions of task files from feature branch 2025-03-29 17:31:30 -04:00
Eyal Toledano
ba651645b0 Merge crunchyman/feat.add.mcp.2 into next 2025-03-29 17:26:04 -04:00
Eyal Toledano
42cac13f2c Merge remote changes and resolve conflicts 2025-03-29 17:23:59 -04:00
Ralph Khreish
257160a967 fix: addTask mcp tool (#50) 2025-03-29 17:16:41 +01:00
Ralph Khreish
9fd42eeafd fix: cursor connecting to mcp server and typo task-master-mcp 2025-03-29 12:10:48 +01:00