-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.bugSomething isn't workingSomething isn't working
Description
App Version
v3.19.5
API Provider
Not Applicable / Other
Model Used
N/A
π Steps to Reproduce
- Open a VSCode workspace with Roo Code extension installed
- Create a
.roo/mcp.jsonfile with MCP server configurations - Verify MCP servers are connected in the MCP Servers view
- Delete the
.roo/mcp.jsonfile from the file system - Check the MCP Servers view
π₯ Outcome Summary
Expected: MCP servers from the deleted .roo/mcp.json should be immediately disconnected and removed from the MCP Servers view
Actual: MCP servers remain connected and active until the VSCode workspace is reloaded
π Relevant Logs or Errors
No specific error messages are shown. The servers simply remain active despite the configuration file being deleted.
Technical Context (from codebase exploration)
Based on my investigation:
- The issue is in
src/services/mcp/McpHub.ts - The
watchProjectMcpFile()method (line 279) watches for file saves but not deletions - The
handleConfigFileChange()method (line 255) reads the file content but doesn't handle the case where the file no longer exists - When the file is deleted, the file watcher triggers, but the subsequent
fs.readFile()would fail, and the error is caught without properly cleaning up the project MCP servers - The
updateServerConnections()method (line 815) properly handles server removal when servers are removed from the config, but it's never called with an empty server list when the file is deleted
Related Code
watchProjectMcpFile()usesvscode.workspace.onDidSaveTextDocumentwhich doesn't capture file deletion events- Need to also watch for file deletion using
vscode.workspace.createFileSystemWatcherwithonDidDeleteevent - Should call
cleanupProjectMcpServers()when the project MCP file is deleted
Related Discussions
Related to PR #4267 which adds MCP server refresh functionality but doesn't address file deletion handling.
dosubot
Metadata
Metadata
Assignees
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done