feat(mcp): Add next_step guidance to initialize-project and add tests

Added detailed next_step guidance to the initialize-project MCP tool response,
providing clear instructions about creating a PRD file and using parse-prd
after initialization. This helps users understand the workflow better after
project initialization.

Also added comprehensive unit tests for the initialize-project MCP tool that:
- Verify tool registration with correct parameters
- Test command construction with proper argument formatting
- Check special character escaping in command arguments
- Validate success response formatting including the new next_step field
- Test error handling and fallback mechanisms
- Verify logging behavior

The tests follow the same pattern as other MCP tool tests in the codebase.
This commit is contained in:
Eyal Toledano
2025-04-09 18:45:38 -04:00
parent 5216b810fa
commit 828a4ec504
4 changed files with 366 additions and 17 deletions

View File

@@ -0,0 +1,5 @@
---
'task-master-ai': patch
---
Adjusts the response sent to the MCP client for `initialize-project` tool so it includes an explicit `next_steps` object. This is in an effort to reduce variability in what the LLM chooses to do as soon as the confirmation of initialized project. Instead of arbitrarily looking for tasks, it will know that a PRD is required next and will steer the user towards that before reaching for the parse-prd command."