-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add toggle functionality for enabling/disabling/reloading all MCP servers #3737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add toggle functionality for enabling/disabling/reloading all MCP servers #3737
Conversation
…servers with configuration reload + Tests
|
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
26009d2 to
03d96ab
Compare
|
Description updated. I think its ready for review |
…to feat/3676-mcp-reload
…t/3676-mcp-reload
…eedlord/Roo-Code into feat/3676-mcp-reload
…eedlord/Roo-Code into feat/3676-mcp-reload
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @seedlord, Thank you for the contribution, I left some questions and suggestions.
After you check that can you also review the merge conflicts?
Let me know if you have any questions, hopefully we can review this PR soon.
| const allServers = this.getAllServers() | ||
|
|
||
| // Set the Disabled flag for all servers | ||
| for (const server of allServers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As also noted by a previous comment, updating server configurations sequentially in this loop:
for (const server of allServers) { await this.updateServerConfig(...); ... }
could be slow if there are many servers.
It might be a good idea to use Promise.all for the updateServerConfig calls to perform these updates concurrently, which could improve performance.
| }), | ||
| ) | ||
|
|
||
| await mcpHub.toggleAllServersDisabled(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test case it("should disable all servers when passed true", ...), the call to await mcpHub.toggleAllServersDisabled(true) and its subsequent assertions for fs.writeFile appear to be duplicated.
|
I am abroad. Gonna check next week when im home 👍 |
|
closed redundant pr #4267 |

Related GitHub Issue
Closes: #3676
Description
This pull request introduces new functionality for managing MCP servers, primarily through the addition of two new buttons in the UI: "Reload All MCP Servers" and "Toggle All MCP Servers Enabled/Disabled".
Key changes include:
extension.reloadAllMcpServersandextension.toggleAllMcpServersDisabled) are implemented to handle the actions triggered by these buttons.McpHubservice now includestoggleAllServersDisabledandrestartAllMcpServersmethods, which manage the state and reloading/restarting of MCP servers.toggleAllServersDisabledandrestartAllMcpServersmethods.Test Procedure
All relevant unit tests, especially those covering
McpHub.test.ts, pass successfully.New tests explicitly verify the behavior of
toggleAllServersDisabled(including the configuration reload when enabling servers) andrestartAllMcpServers.Manual testing confirms that after globally enabling/disabling MCP servers, configuration and servers are correctly reloaded, and that all active servers can be restarted as expected.
Type of Change
srcor test files.Screenshots / Videos
(Not applicable, as there are no UI changes)
Documentation Updates
Additional Notes
No further notes.
Important
Adds UI buttons and backend logic for reloading and toggling all MCP servers, with supporting commands and tests.
McpView.tsx.mcp.jsonfor German and English.extension.reloadAllMcpServersandextension.toggleAllMcpServersDisabledinregisterCommands.ts.toggleAllServersDisabledandrestartAllMcpServersmethods toMcpHub.ts.webviewMessageHandler.tsto handleexecuteVSCodeCommandmessages.toggleAllServersDisabledandrestartAllMcpServersinMcpHub.test.ts.This description was created by
for cc278a6. You can customize this summary. It will automatically update as commits are pushed.