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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user