MCPcopy
hub / github.com/claude-code-best/claude-code / disconnect

Method disconnect

packages/mcp-client/src/manager.ts:129–144  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

127 }
128
129 async disconnect(name: string): Promise<void> {
130 const conn = this.connections.get(name)
131 if (!conn) return
132
133 if (conn.type === 'connected') {
134 try {
135 await conn.cleanup()
136 } catch (err) {
137 this.deps.logger.warn(`Error disconnecting ${name}:`, err)
138 }
139 }
140
141 this.connections.delete(name)
142 this.toolsCache.delete(name)
143 this.emit('disconnected', name)
144 }
145
146 async disconnectAll(): Promise<void> {
147 const names = [...this.connections.keys()]

Callers 1

disconnectAllMethod · 0.95

Calls 5

emitMethod · 0.95
getMethod · 0.65
warnMethod · 0.65
deleteMethod · 0.65
cleanupMethod · 0.45

Tested by

no test coverage detected