fix: Improve MCP server robustness and debugging

- Refactor  for more reliable project root detection, particularly when running within integrated environments like Cursor IDE. Includes deriving root from script path and avoiding fallback to '/'.
- Enhance error handling in :
    - Add detailed debug information (paths searched, CWD, etc.) to the error message when  is not found in the provided project root.
    - Improve clarity of error messages and potential solutions.
- Add verbose logging in  to trace session object content and the finally resolved project root path, aiding in debugging path-related issues.
- Add default values for  and  to the example  environment configuration.
This commit is contained in:
Eyal Toledano
2025-04-02 22:04:00 -04:00
parent 9869ebe045
commit 52adb5c2f6
28 changed files with 658 additions and 257 deletions

View File

@@ -43,7 +43,7 @@ export function registerAddTaskTool(server) {
const result = await addTaskDirect({
projectRoot: rootFolder, // Pass the resolved root
...args
}, log);
}, log, { reportProgress, mcpLog: log, session});
return handleApiResult(result, log);
} catch (error) {