/**
 * MCP client factory - creates the appropriate client based on config.
 */
import { McpStdioClient } from './client.js';
import { McpHttpClient } from './http-client.js';
/**
 * Create the appropriate MCP client based on configuration
 */
export function createMcpClient(name, config) {
    if (config.disabled) {
        throw new Error(`MCP server '${name}' is disabled`);
    }
    // Determine transport type
    const transport = config.transport || (config.url ? 'http' : 'stdio');
    switch (transport) {
        case 'stdio':
            if (!config.command) {
                throw new Error(`MCP server '${name}' requires a command for stdio transport`);
            }
            return new McpStdioClient(name, config);
        case 'http':
            if (!config.url) {
                throw new Error(`MCP server '${name}' requires a URL for HTTP transport`);
            }
            return new McpHttpClient(name, config);
        default:
            throw new Error(`Unsupported MCP transport: ${transport}`);
    }
}
//# sourceMappingURL=client-factory.js.map