/** * MCP client implementation */ import { McpClientConfig, McpToolInfo, McpResourceInfo, McpPromptInfo, McpClientTransport } from "./types"; /** * Client for interacting with MCP servers */ export declare class McpClient { private client; private transport; private logger; private connected; private _serverName; /** * Creates a new MCP client * @param config Client configuration * @param transport Transport implementation */ constructor(config: McpClientConfig, transport: McpClientTransport); /** * Get the server name * @returns The name of the MCP server */ get serverName(): string; /** * Set the server name * @param name The name of the MCP server */ set serverName(name: string); /** * Connects to the MCP server * @returns Promise that resolves when connected */ connect(): Promise; /** * Disconnects from the MCP server * @returns Promise that resolves when disconnected */ disconnect(): Promise; /** * Lists available tools from the MCP server * @returns Promise that resolves to an array of tool information */ listTools(): Promise; /** * Calls a tool on the MCP server * @param name Tool name * @param args Tool arguments * @returns Promise that resolves to the tool result */ callTool(name: string, args: Record): Promise; /** * Lists available resources from the MCP server * @returns Promise that resolves to an array of resource information */ listResources(): Promise; /** * Reads a resource from the MCP server * @param uri Resource URI * @returns Promise that resolves to the resource content */ readResource(uri: string): Promise; /** * Lists available prompts from the MCP server * @returns Promise that resolves to an array of prompt information */ listPrompts(): Promise; /** * Gets a prompt from the MCP server * @param name Prompt name * @param args Prompt arguments * @returns Promise that resolves to the prompt content */ getPrompt(name: string, args?: Record): Promise; /** * Checks if the client is connected and throws an error if not * @private */ private ensureConnected; }