Skip to content

Commit 454a631

Browse files
committed
Support disable mcp
1 parent 9e1dd3e commit 454a631

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/bridge/api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ export class EcaRemoteApi {
227227
return this.request(`/mcp/${encodeURIComponent(name)}/logout`, { method: 'POST' });
228228
}
229229

230+
/** Disable an MCP server by name. */
231+
async mcpDisableServer(name: string): Promise<void> {
232+
return this.request(`/mcp/${encodeURIComponent(name)}/disable`, { method: 'POST' });
233+
}
234+
235+
/** Enable an MCP server by name. */
236+
async mcpEnableServer(name: string): Promise<void> {
237+
return this.request(`/mcp/${encodeURIComponent(name)}/enable`, { method: 'POST' });
238+
}
239+
230240
// ---------------------------------------------------------------------------
231241
// SSE
232242
// ---------------------------------------------------------------------------

src/bridge/outbound-handler.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ export async function handleOutbound(
152152
await api.mcpLogoutServer(data.name);
153153
break;
154154

155+
case 'mcp/disableServer':
156+
await api.mcpDisableServer(data.name);
157+
break;
158+
159+
case 'mcp/enableServer':
160+
await api.mcpEnableServer(data.name);
161+
break;
162+
155163
case 'mcp/updateServer':
156164
// Respond immediately to prevent webviewSendAndGet from hanging
157165
// (no REST endpoint for updating MCP server config in web context)

0 commit comments

Comments
 (0)