MCPcopy
hub / github.com/coder/mux / stopServers

Method stopServers

src/node/services/mcpServerManager.ts:1263–1278  ·  view source on GitHub ↗
(workspaceId: string)

Source from the content-addressed store, hash-verified

1261 }
1262
1263 async stopServers(workspaceId: string): Promise<void> {
1264 const entry = this.workspaceServers.get(workspaceId);
1265 if (!entry) return;
1266
1267 // Remove from cache immediately so callers can't re-use tools backed by a
1268 // client that is in the middle of closing.
1269 this.workspaceServers.delete(workspaceId);
1270
1271 for (const instance of entry.instances.values()) {
1272 try {
1273 await instance.close();
1274 } catch (error) {
1275 log.warn("Failed to stop MCP server", { error, name: instance.name });
1276 }
1277 }
1278 }
1279
1280 /**
1281 * Test an MCP server.

Callers 3

cleanupIdleServersMethod · 0.95
getToolsForWorkspaceMethod · 0.95
removeMethod · 0.80

Calls 3

getMethod · 0.65
closeMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected