MCPcopy Create free account
hub / github.com/echoVic/blade-code / destroy

Method destroy

src/agent/MCPComponent.ts:124–137  ·  view source on GitHub ↗

* 销毁 MCP 组件

()

Source from the content-addressed store, hash-verified

122 * 销毁 MCP 组件
123 */
124 async destroy(): Promise<void> {
125 if (this.client) {
126 // 断开所有连接
127 for (const session of this.sessions.values()) {
128 await this.client.disconnect(session.id);
129 }
130 }
131
132 this.sessions.clear();
133 this.resources.clear();
134 this.tools.clear();
135
136 this.log('MCP 组件已销毁');
137 }
138
139 /**
140 * 连接到多个服务器

Callers

nothing calls this directly

Calls 3

logMethod · 0.95
disconnectMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected