MCPcopy Create free account
hub / github.com/continuedev/continue / restartServer

Method restartServer

extensions/cli/src/services/MCPService.ts:218–237  ·  view source on GitHub ↗

* Restart a specific server

(serverName: string)

Source from the content-addressed store, hash-verified

216 * Restart a specific server
217 */
218 public async restartServer(serverName: string): Promise<void> {
219 if (!this.assistant || !this.assistant.mcpServers) return;
220
221 const serverConfig = this.assistant.mcpServers.find(
222 (s, index) => s && (s.name || `server-${index}`) === serverName,
223 );
224
225 if (!serverConfig) {
226 throw new Error(`Server ${serverName} not found in configuration`);
227 }
228
229 const existingConnection = this.connections.get(serverName);
230 if (existingConnection) {
231 if (existingConnection.status === "connected") {
232 await this.shutdownConnection(existingConnection);
233 }
234 this.connections.delete(serverName);
235 }
236 await this.connectServer(serverConfig);
237 }
238
239 private async connectServer(serverConfig: MCPServerConfig) {
240 const connection: ServerConnection = {

Callers 1

MCPService.test.tsFile · 0.45

Calls 4

shutdownConnectionMethod · 0.95
connectServerMethod · 0.95
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected