import type { McpServerConfig, McpToolDef, McpToolResult } from './mcp-types.js';
/**
 * MCP JSON-RPC 2.0 client supporting stdio and HTTP transports.
 */
export declare class McpClient {
    private serverName;
    private _connected;
    private _config;
    private _nextId;
    private _process;
    private _readline;
    private _pendingRequests;
    constructor(serverName: string);
    /** Whether the client is currently connected */
    get connected(): boolean;
    /** Connect to MCP server. Spawns process (stdio) or validates URL (HTTP). Sends initialize handshake. */
    connect(config: McpServerConfig): Promise<void>;
    /** Call tools/list and return tool definitions */
    listTools(): Promise<McpToolDef[]>;
    /** Call tools/call with the given tool name and arguments */
    callTool(name: string, args: Record<string, unknown>): Promise<McpToolResult>;
    /** Graceful shutdown */
    disconnect(): Promise<void>;
    private _connectStdio;
    private _handleStdioLine;
    private _sendStdioRequest;
    private _sendStdioNotification;
    private _connectHttp;
    private _sendHttpRequest;
    private _sendHttpNotification;
    private _isStdio;
    private _sendRequest;
    private _sendNotification;
    /** Perform the MCP initialize handshake */
    private _performInitialize;
    private _assertConnected;
    private _log;
}
//# sourceMappingURL=mcp-client.d.ts.map