()
| 316 | e.mcpInitialized = false |
| 317 | } |
| 318 | |
| 319 | func (e *CoreExecutionEngine) clearMCPTrustFuture(ch chan bool) { |
| 320 | e.mu.Lock() |
| 321 | if e.mcpTrustCh == ch { |
| 322 | e.mcpTrustCh = nil |
| 323 | } |
| 324 | e.mu.Unlock() |
| 325 | } |
| 326 | |
| 327 | func (e *CoreExecutionEngine) disconnectMCP(ctx context.Context) { |
| 328 | e.mcpMu.Lock() |
| 329 | defer e.mcpMu.Unlock() |
| 330 | clients, _ := e.mcpContext["mcp_clients"].(map[string]*mcp.McpClient) |
| 331 | for _, client := range clients { |
| 332 | client.Disconnect(ctx) |
| 333 | } |
| 334 | e.mcpContext = nil |
| 335 | e.mcpInitialized = false |