/** * External MCP lifecycle manager. * * Owns the three coupled containers (`externalMCPs`, `externalMCPClients`, * `externalMCPSDKClients`) that beam.ts previously held as separate fields * on BeamContext, plus the cohesive add/remove/close operations that * touch all three together. * * Implements `ExternalMCPState` so existing helpers in `external-mcp.ts` * (which read the maps directly) continue to work unchanged. */ import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import type { ExternalMCPInfo } from '../types.js'; import type { ExternalMCPState } from './external-mcp.js'; export declare class ExternalMCPManager implements ExternalMCPState { /** External MCP server metadata (name, methods, connected, etc.). */ readonly externalMCPs: ExternalMCPInfo[]; /** Transport-level clients (raw, used by the streamable-HTTP path). */ readonly externalMCPClients: Map; /** SDK Client instances (used for tool calls that need structuredContent). */ readonly externalMCPSDKClients: Map>; /** Append-many. Used after `loadExternalMCPs(...)` returns a list. */ addAll(mcps: ExternalMCPInfo[]): void; /** * Remove an MCP by name from all three containers in one atomic-from-JS step. * Returns the SDK client (if any) so the caller can close it asynchronously * after all map mutations are done — matches the existing two-phase pattern * in beam.ts where Maps are made consistent first, then close is awaited. */ removeByName(name: string): { sdkClient?: Client; }; /** * Gracefully close every SDK client and clear the two client maps. * Used on Beam shutdown. Logs at debug — close errors during shutdown * are expected, not actionable. */ closeAllSDKClients(): Promise; } //# sourceMappingURL=external-mcp-manager.d.ts.map