import { type CallToolResult, type Tool as McpTool } from '@modelcontextprotocol/sdk/types.js'; import { UnauthorizedError } from '@modelcontextprotocol/sdk/client/auth.js'; import type { ToolResult } from '../tools/types.js'; import type { McpServerConfig } from './types.js'; import type { McpServerLayer } from './env-containment.js'; export interface McpClientConnectResult { tools: McpTool[]; serverInfo: { name: string; version: string; } | undefined; } export declare class McpClient { private readonly serverName; private readonly config; private readonly layer; private readonly trustedAllowSecretEnv; private client; private connected; private pendingAuthTransport; onTransportError?: (err: Error) => void; onToolListChanged?: () => void; constructor(serverName: string, config: McpServerConfig, layer?: McpServerLayer, trustedAllowSecretEnv?: readonly string[]); connect(): Promise; listTools(): Promise; refreshTools(): Promise; callTool(toolName: string, input: unknown, signal: AbortSignal): Promise; finishAuth(authorizationCode: string): Promise; disconnect(): Promise; } declare function normalizeCallToolResult(result: CallToolResult): ToolResult; export { UnauthorizedError }; export { normalizeCallToolResult };