import { ConnectorTool } from '../../types/connector.js'; import { MCPConfig } from '../../types/mcp.js'; import '@modelcontextprotocol/sdk/client/sse.js'; import '@modelcontextprotocol/sdk/client/stdio.js'; import '@modelcontextprotocol/sdk/client/streamableHttp.js'; /** * Module for managing Model Context Protocol (MCP) server connections. * * This module handles the lifecycle of MCP client connections, discovers * available tools from connected servers, and provides an interface for * executing those tools. Multiple MCP servers can be connected simultaneously. */ declare class MCPModule { private mcpConnectors; addMCPConnector(configs: { [name: string]: MCPConfig; }): void; private getOrCreateClient; connectToServers(): Promise; /** * Returns all available tools from connected MCP servers. * * @returns Array of MCPTool instances representing available tools */ getTools(prompt: string): Array; /** * Executes a tool on its corresponding MCP server. * * @param tool - The MCPTool instance to execute * @param _args - Arguments to pass to the tool * @returns Promise resolving to the tool's execution result * @throws Error if the MCP server for the tool is not found */ useTool(tool: ConnectorTool, _args?: Record): Promise; /** * Closes all MCP client connections. * * Should be called when shutting down the application to ensure * all MCP connections are properly closed. */ cleanup(): Promise; } export { MCPModule };