/**
 * MCP Client Factory
 * Creates and manages MCP clients for external servers
 * Supports stdio, SSE, WebSocket, and HTTP transports
 * Enhanced with retry, rate limiting, and OAuth 2.1 support
 */
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
import type { ClientCapabilities } from "@modelcontextprotocol/sdk/types.js";
import { type ChildProcess } from "child_process";
import type { MCPTransportType } from "../types/externalMcp.js";
import type { MCPServerInfo, MCPClientResult } from "../types/mcpTypes.js";
/**
 * MCPClientFactory
 * Factory class for creating MCP clients with different transports
 */
export declare class MCPClientFactory {
    private static readonly NEUROLINK_IMPLEMENTATION;
    private static readonly DEFAULT_CAPABILITIES;
    /**
     * Create an MCP client for the given server configuration
     * Enhanced with retry logic, rate limiting, and circuit breaker protection
     */
    static createClient(config: MCPServerInfo, timeout?: number): Promise<MCPClientResult>;
    /**
     * Internal client creation logic
     */
    private static createClientInternal;
    /**
     * Create transport based on configuration
     */
    private static createTransport;
    /**
     * Create stdio transport with process spawning
     */
    private static createStdioTransport;
    /**
     * Create SSE transport
     */
    private static createSSETransport;
    /**
     * Create WebSocket transport
     */
    private static createWebSocketTransport;
    /**
     * Create HTTP transport (Streamable HTTP)
     * Enhanced with OAuth 2.1, rate limiting, and configurable timeouts
     */
    private static createHTTPTransport;
    /**
     * Create a fetch wrapper with timeout support
     */
    private static createFetchWithTimeout;
    /**
     * Create an enhanced fetch function with timeout and optional retry
     */
    private static createEnhancedFetch;
    /**
     * Set up OAuth provider if configured
     */
    private static setupAuthProvider;
    /**
     * Get authorization header based on auth configuration
     */
    private static getAuthorizationHeader;
    /**
     * Perform MCP handshake and get server capabilities
     */
    private static performHandshake;
    /**
     * Get server information
     */
    private static getServerInfo;
    /**
     * Extract capabilities from server info
     */
    private static extractCapabilities;
    /**
     * Create a timeout promise with AbortController support
     * Provides consistent async timeout patterns across the factory
     */
    private static createTimeoutPromise;
    /**
     * Close an MCP client and clean up resources
     */
    static closeClient(client: Client, transport: Transport, process?: ChildProcess): Promise<void>;
    /**
     * Test connection to an MCP server
     */
    static testConnection(config: MCPServerInfo, timeout?: number): Promise<{
        success: boolean;
        error?: string;
        capabilities?: ClientCapabilities;
    }>;
    /**
     * Validate MCP server configuration for client creation
     */
    static validateClientConfig(config: MCPServerInfo): {
        isValid: boolean;
        errors: string[];
    };
    /**
     * Get supported transport types
     */
    static getSupportedTransports(): MCPTransportType[];
    /**
     * Get default client capabilities
     */
    static getDefaultCapabilities(): ClientCapabilities;
}
