MCPcopy Create free account
hub / github.com/Roy3838/Observer / toggleCustomServer

Method toggleCustomServer

app/src/utils/ModelManager.ts:428–442  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

426 }
427
428 public toggleCustomServer(address: string): CustomServer[] {
429 const server = this.customServers.find(s => s.address === address);
430 if (server) {
431 server.enabled = !server.enabled;
432 this.saveCustomServersToStorage();
433
434 if (server.enabled && server.status === 'online') {
435 this.addServer(address);
436 } else {
437 this.removeServer(address);
438 }
439 }
440
441 return [...this.customServers];
442 }
443
444 public updateCustomServerStatus(address: string, status: 'online' | 'offline'): CustomServer[] {
445 const server = this.customServers.find(s => s.address === address);

Callers 1

toggleCustomServerFunction · 0.80

Calls 3

addServerMethod · 0.95
removeServerMethod · 0.95

Tested by

no test coverage detected