fix(mcp): make projectRoot optional in all MCP tools

- Update all tool definitions to use z.string().optional() for projectRoot
- Fix direct function implementations to use findTasksJsonPath(args, log) pattern
- Enables consistent project root detection without requiring explicit params
- Update changeset to document these improvements

This change ensures MCP tools work properly with the smart project root
detection system, removing the need for explicit projectRoot parameters in
client applications. Improves usability and reduces integration friction.
This commit is contained in:
Eyal Toledano
2025-04-01 03:12:44 -04:00
parent 281c476738
commit 6161febbde
22 changed files with 27 additions and 37 deletions

View File

@@ -16,6 +16,11 @@
- Parent directory traversal to find tasks.json
- Package directory as fallback
- Updated all MCP tools to work without explicitly requiring project root:
- Changed all tool definitions from `projectRoot: z.string().describe(...)` to `projectRoot: z.string().optional().describe(...)`
- Updated all direct function implementations from `findTasksJsonPath(args.file, args.projectRoot)` to use the proper `findTasksJsonPath(args, log)` pattern
- These changes allow MCP tools to work properly without requiring the projectRoot parameter, using smart detection to automatically determine the project root
- Add comprehensive PROJECT_MARKERS array for detecting common project files:
- Task Master specific files (tasks.json, tasks/tasks.json)
- Version control markers (.git, .svn)