import type { ToolsInput } from '@mastra/core/agent'; import { MCPServerBase } from '@mastra/core/mcp'; import type { MCPServerConfig, MCPServerHonoSSEOptions, MCPServerHTTPOptions, MCPServerSSEOptions, MCPToolType, ServerDetailInfo, ServerInfo } from '@mastra/core/mcp'; import type { InternalMastraMCPClient } from './client.js'; type ToolListResult = { tools: Array<{ id?: string; name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType; _meta?: Record; }>; }; /** * A lightweight proxy that wraps a single MCPClient server connection as an * MCPServerBase instance. This allows external (non-Mastra) MCP servers * connected through MCPClient to be registered in Mastra's `mcpServers` * config and appear in Studio alongside native MCPServer instances. * * Tool and resource operations are delegated lazily to the underlying * InternalMastraMCPClient connection. */ export declare class MCPClientServerProxy extends MCPServerBase { private clientGetter; private cachedClient; private _cachedToolList; constructor(config: { name: string; version?: string; id?: string; description?: string; }, clientGetter: () => Promise); private getClient; private convertSchema; private fetchToolList; convertTools(_tools: ToolsInput, _agents?: MCPServerConfig['agents'], _workflows?: MCPServerConfig['workflows']): Record; /** * Returns the cached tool list synchronously, or triggers an async fetch. * The Studio API handlers are async and will auto-await a returned Promise. */ getToolListInfo(): ToolListResult | Promise; getToolInfo(toolId: string): { name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType; _meta?: Record; } | undefined | Promise<{ name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType; _meta?: Record; } | undefined>; executeTool(toolId: string, args: any, _executionContext?: { messages?: any[]; toolCallId?: string; }): Promise; listResources(): Promise<{ resources: Array<{ uri: string; name: string; description?: string; mimeType?: string; _meta?: Record; }>; }>; readResource(uri: string): Promise<{ contents: Array<{ uri: string; text?: string; blob?: string; }>; }>; startStdio(): Promise; startSSE(_options: MCPServerSSEOptions): Promise; startHonoSSE(_options: MCPServerHonoSSEOptions): Promise; startHTTP(_options: MCPServerHTTPOptions): Promise; close(): Promise; getServerInfo(): ServerInfo; getServerDetail(): ServerDetailInfo; } export {}; //# sourceMappingURL=server-proxy.d.ts.map