Skip to content

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

Closed
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4dce299
feat: add toggle functionality for enabling/disabling all global MCP …
seedlord May 20, 2025
6a015ab
Merge branch 'RooVetGit:main' into feat/3676-mcp-reload-on-enable
seedlord May 20, 2025
74384e2
Update src/services/mcp/McpHub.ts
seedlord May 20, 2025
783cbc6
Update McpHub.test.ts
seedlord May 20, 2025
ac26ff6
revert mcp changes
seedlord May 21, 2025
03d96ab
Merge branch 'main' into feat/3676-mcp-reload-on-enable
seedlord May 21, 2025
a7a96fb
Add commands to reload and toggle MCP servers; update UI and localiza…
seedlord May 21, 2025
e8f99e2
Add tests for toggleAllServersDisabled and restartAllMcpServers metho…
seedlord May 21, 2025
7d5dd40
Merge branch 'main' into feat/3676-mcp-reload
seedlord May 21, 2025
cc278a6
Add new commands for reloading and toggling MCP server states
seedlord May 21, 2025
0123cad
Merge branch 'RooCodeInc:main' into feat/3676-mcp-reload-on-enable
seedlord May 22, 2025
8856dab
refactor: update command identifiers to include extension prefix
seedlord May 22, 2025
8d937c3
refactor: optimize server configuration updates using Promise.all
seedlord May 22, 2025
fe0a70e
revert Promise.all for toggleAllServerDisabled
seedlord May 22, 2025
999d27b
fixed Merge branch 'main' of https://github.com/RooVetGit/Roo-Code in…
seedlord May 22, 2025
442ad40
Merge branch 'main' of https://github.com/RooVetGit/Roo-Code into fea…
seedlord May 22, 2025
fe34086
Merge branch 'feat/3676-mcp-reload-on-enable' of https://github.com/s…
seedlord May 22, 2025
f0596ac
revert eslint changes
seedlord May 22, 2025
77e9ae1
Merge branch 'feat/3676-mcp-reload-on-enable' of https://github.com/s…
seedlord May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert Promise.all for toggleAllServerDisabled
  • Loading branch information
seedlord committed May 22, 2025
commit fe0a70e1f7792bd18e53c721bee284c8df91fea2
16 changes: 7 additions & 9 deletions src/services/mcp/McpHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1317,15 +1317,13 @@ export class McpHub {
const allServers = this.getAllServers()

// Set the Disabled flag for all servers
await Promise.all(
allServers.map(async (server) => {
await this.updateServerConfig(server.name, { disabled }, server.source)
const conn = this.findConnection(server.name, server.source)
if (conn) {
conn.server.disabled = disabled
}
}),
)
for (const server of allServers) {
Copy link
Collaborator

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 this.updateServerConfig(server.name, { disabled }, server.source)
const conn = this.findConnection(server.name, server.source)
if (conn) {
conn.server.disabled = disabled
}
}

// If activated, reload configuration
if (!disabled) {
Expand Down