import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { Implementation } from '@modelcontextprotocol/sdk/types.js'; import { type SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js'; import { type StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js'; type ConnectionConfig = { type: 'sse'; url: URL; params: SSEClientTransportOptions; tools: string[]; name: string; } | { type: 'stdio'; params: StdioServerParameters; tools: string[]; name: string; }; interface ToolChainStep { toolName: string; args: any; outputMapping?: { [key: string]: string; }; fromStep?: number; } interface ToolChainOutput { steps?: number[]; final?: boolean; } interface ToolChain { name: string; steps: ToolChainStep[]; description?: string; output?: ToolChainOutput; } export declare class McpServerComposer { readonly server: McpServer; namespace: string; private readonly targetClients; private readonly clientTools; constructor(serverInfo: Implementation); add(config: ConnectionConfig, clientInfo: Implementation, skipRegister?: boolean, retryCount?: number): Promise; composeToolChain(toolChain: ToolChain): void; private getNestedValue; listTargetClients(): { clientInfo: Implementation; config: ConnectionConfig; }[]; private createTransport; private composeTools; private composeResources; private composePrompts; private handleTargetServerClose; disconnectAll(): Promise; disconnect(clientName: string): Promise; /** * 查找已注册的工具 */ findTool(toolName: string): Promise<{ tool: any; fullName: string; } | null>; getPrompt(promptName: string, args: any): Promise; listPrompts(): Promise; listResources(): Promise; readResource(resourceName: string): Promise; /** * 列出所有已注册的工具 */ listTools(): Promise>; /** * 调用工具 * @param toolName 工具名称 * @param args 工具参数 * @returns 工具执行结果 */ callTool(toolName: string, args?: any, options?: any): Promise; /** * 检查工具是否存在 * @param toolName 工具名称 * @returns 是否存在 */ hasToolAvailable(toolName: string): Promise; private getRegisteredTools; } export {}; //# sourceMappingURL=serverComposer.d.ts.map