import type { StructuredTool } from "@langchain/core/tools"; import type { Logger } from "@/logger.js"; import type { MCPServersConfig } from "@/types/mcp.js"; export type MCPResourceDescriptor = { uri: string; name: string; description?: string; mimeType?: string; }; export type MCPResourceTemplateDescriptor = { uriTemplate: string; name: string; description?: string; mimeType?: string; }; export type MCPResourceContentDescriptor = { uri: string; mimeType?: string; text?: string; blob?: string; }; export type MCPProxyConfig = { enabled?: boolean; command?: string; baseArgs?: string[]; projectName?: string; pushExplorer?: boolean; apiKey?: string; apiUrl?: string; }; /** * Manages MCP server connections and tool retrieval * Handles server lifecycle: initialization, tool loading, and cleanup */ export declare class MCPClientManager { private client; private logger; private serverConfigs; private executionWorkspace; private proxyConfig; constructor(configs: MCPServersConfig[], logger: Logger, options?: { executionWorkspace?: string | null; proxyConfig?: MCPProxyConfig; }); /** * Merge multiple MCP configurations (global + agent-specific) * Agent-specific servers override global ones with same name */ private mergeConfigs; /** * Convert Wingman MCP config to MultiServerMCPClient format */ private buildClientConfig; private buildStdioServerConfig; private applyRuntimeEnv; /** * Initialize MCP client and connect to servers */ initialize(): Promise; /** * Retrieve all tools from connected MCP servers * Returns LangChain StructuredTools ready for agent use */ getTools(): Promise; /** * List MCP resources exposed by configured servers. */ listResources(serverNames?: string[]): Promise>; /** * List MCP resource templates exposed by configured servers. */ listResourceTemplates(serverNames?: string[]): Promise>; /** * Read a specific MCP resource from a server. */ readResource(serverName: string, uri: string): Promise; private sanitizeToolNames; /** * Cleanup MCP client resources * Call when agent completes or on error */ cleanup(): Promise; /** * Check if any MCP servers are configured */ hasServers(): boolean; }