/** * ExternalMcpServer — manages one externally-spawned MCP server subprocess. * * Lifecycle: * - start(): spawn child via SDK StdioClientTransport, perform MCP handshake. * - listTools(): return tool descriptors from the server (cached after first call). * - callTool(name, args): invoke a tool, return its result. * - stop(): SIGTERM the child, wait up to 5s, SIGKILL if still alive. * * SECURITY: providerConfig.mcpEnv may contain API tokens. NEVER include the * env contents in error messages, log lines, or returned errors. Only the * provider NAME is safe to expose externally. * * Error isolation: ExternalMcpServer does NOT implement circuit-breaker or * restart-on-crash logic. Observability MCPs are best-effort — a crashed * provider is simply absent from the diagnoser's tool list for that spawn. * The caller (mergeObsTools) uses Promise.allSettled to handle partial failure. */ import type { ObservabilityProvider } from "../config/schema.js"; export interface ToolDescriptor { name: string; description?: string; inputSchema?: unknown; } export declare class ExternalMcpServer { private readonly provider; private client; private transport; private toolsCache; private stopping; constructor(provider: ObservabilityProvider); get name(): string; start(): Promise; listTools(): Promise; callTool(name: string, args: unknown): Promise; stop(): Promise; } //# sourceMappingURL=external-client.d.ts.map