/** * Child MCP Registry * * In-memory registry tracking spawned child MCP processes, * their client connections, discovered tools, and lifecycle status. * Session-scoped — cleaned up when the MCP server exits. */ import type { ChildProcess } from "node:child_process"; import type { Client } from "@modelcontextprotocol/sdk/client/index.js"; import type { McpConfig } from "../client/types.js"; export interface ChildMcpTool { /** Tool name as discovered from the child MCP */ name: string; /** Tool description */ description: string; /** JSON Schema for the tool's input */ inputSchema: Record; } export interface ChildMcpEntry { /** The spawned child process */ process?: ChildProcess; /** MCP SDK client connected to the child */ client: Client; /** Tools discovered via client.listTools() */ tools: ChildMcpTool[]; /** The config used to spawn this child */ config: McpConfig; /** Where this child came from */ source: `skill:${string}` | "standalone"; /** The memory_id from the backend (if applicable) */ memory_id: string; /** Current process status */ status: "active" | "crashed"; /** When the child was spawned */ spawned_at: Date; } export declare class ChildMcpRegistry { private readonly children; /** * Register a new child MCP entry. * @throws if standalone or total limits are exceeded. */ add(name: string, entry: ChildMcpEntry): void; /** Get a child MCP entry by name. */ get(name: string): ChildMcpEntry | undefined; /** Remove a child MCP by name. Returns true if it existed. */ remove(name: string): boolean; /** List all child MCP entries. */ list(): ChildMcpEntry[]; /** List all child MCP entries with their registry names. */ entries(): Array<[string, ChildMcpEntry]>; /** Check if a child MCP is registered. */ has(name: string): boolean; /** Current number of child MCPs. */ count(): number; /** List child MCPs filtered by source. */ listBySource(source: "standalone" | string): ChildMcpEntry[]; /** Count child MCPs by source type. */ countBySource(sourceType: "standalone" | "skill"): number; /** Get all entries whose source matches a specific skill name. */ listBySkill(skillName: string): ChildMcpEntry[]; /** Get all registered child MCP names. */ names(): string[]; } /** Singleton child MCP registry instance */ export declare const childMcpRegistry: ChildMcpRegistry; //# sourceMappingURL=childMcpRegistry.d.ts.map