/** * MCP Client Factory for NCP * * Provides implementation for enabling Photons to call external MCPs via the orchestrator. */ import { type MCPToolResult, type MCPToolInfo } from '@portel/photon-core'; /** * MCP Transport interface for communicating with MCP servers */ export interface MCPTransport { callTool(mcpName: string, toolName: string, parameters: Record): Promise; listTools(mcpName: string): Promise; isConnected(mcpName: string): Promise; } /** * MCP Client interface for a single MCP server connection * Simplified version for NCP's orchestrator use */ export interface MCPClient { callTool(toolName: string, parameters: Record): Promise; listTools(): Promise; } /** * MCP Client Factory interface for creating MCP clients * NCP-specific version (compatible with photon-core's pattern) */ export interface MCPClientFactory { create(mcpName: string): MCPClient; listServers(): Promise; } /** * Interface for orchestrator - kept minimal to avoid circular dependencies */ export interface OrchestratorInterface { run(toolName: string, parameters: any, meta?: Record): Promise<{ success: boolean; content?: any; error?: string; }>; getConnectionNames(): string[]; isConnected(mcpName: string): boolean; getToolsForMCP(mcpName: string): Array<{ name: string; description?: string; inputSchema?: any; }>; } /** * MCP Client implementation for a single MCP server */ export declare class MCPClientImpl { private mcpName; private transport; constructor(mcpName: string, transport: MCPTransport); callTool(toolName: string, parameters: Record): Promise; listTools(): Promise; } /** * MCP Transport implementation that uses NCP orchestrator */ export declare class NCPMCPTransport implements MCPTransport { private orchestrator; constructor(orchestrator: OrchestratorInterface); callTool(mcpName: string, toolName: string, parameters: Record): Promise; listTools(mcpName: string): Promise; isConnected(mcpName: string): Promise; } /** * MCP Client Factory implementation for NCP * Creates MCPClient instances that use the orchestrator for MCP communication */ export declare class NCPMCPClientFactory implements MCPClientFactory { private orchestrator; private transport; private clients; constructor(orchestrator: OrchestratorInterface); /** * Create an MCP client for a specific server */ create(mcpName: string): MCPClient; /** * List all available MCP servers */ listServers(): Promise; /** * Clear cached clients (useful when connections change) */ clearCache(): void; } /** * Create an MCP client factory from an orchestrator * This is the main entry point for setting up MCP access in Photons */ export declare function createMCPClientFactory(orchestrator: OrchestratorInterface): MCPClientFactory; //# sourceMappingURL=mcp-client-factory.d.ts.map