/**
 * MCP stdio transport client.
 *
 * Implements JSON-RPC 2.0 over stdin/stdout to communicate
 * with MCP servers. Clean-room implementation based on public spec.
 */
import { EventEmitter } from 'node:events';
import type { MCPServerConfig, MCPInitializeResult, MCPServerCapabilities, MCPTool, MCPToolCallResult, MCPResource, MCPResourceContent } from './types.js';
export declare class MCPClient extends EventEmitter {
    readonly serverName: string;
    private config;
    private proc;
    private nextId;
    private pending;
    private readBuffer;
    private _connected;
    private _capabilities;
    private _serverInfo;
    constructor(serverName: string, config: MCPServerConfig);
    get connected(): boolean;
    get capabilities(): MCPServerCapabilities | undefined;
    get serverInfo(): {
        name: string;
        version: string;
    } | undefined;
    /** Spawn the MCP server process and complete the initialize handshake. */
    connect(): Promise<MCPInitializeResult>;
    /** Disconnect the MCP server. */
    disconnect(): Promise<void>;
    listTools(): Promise<MCPTool[]>;
    callTool(name: string, args?: Record<string, unknown>): Promise<MCPToolCallResult>;
    listResources(): Promise<MCPResource[]>;
    readResource(uri: string): Promise<MCPResourceContent[]>;
    private request;
    private notify;
    private onData;
    private rejectAll;
}
