/** * mcpClient — connect to an MCP server, expose its tools to your Agent. * * const slack = await mcpClient({ * name: 'slack', * transport: { transport: 'stdio', command: 'npx', args: ['@example/slack-mcp'] }, * }); * * const tools = await slack.tools(); // → readonly Tool[] * const agent = Agent.create({ ... }).tools(tools).build(); * * // ... * * await slack.close(); * * Pattern: Adapter (GoF) — translates MCP `listTools()` / `callTool()` * into agentfootprint's `Tool` interface (schema + execute). * Each MCP tool becomes ONE agentfootprint Tool. The agent's * existing tool-call handler invokes `client.callTool()` * inside the wrapped `execute`. * * Role: Layer-3 integration. Sits next to `defineTool` — same * shape, different source. Once tools land on the agent, * the rest of the library doesn't know they came from MCP. * * Emits: N/A — wrapped tools emit the standard * `agentfootprint.stream.tool_start` / `tool_end` events * when the agent calls them. Add `name: ''` to * `McpClientOptions` so observability surfaces can group * tool calls by server. * * Lazy-require pattern: the `@modelcontextprotocol/sdk` peer-dep * loads only when a consumer actually constructs a client. Tests * inject `_client` and skip the import path entirely. */ import type { McpClient, McpClientOptions } from './types.js'; /** * Connect to an MCP server. Returns an `McpClient` that exposes the * server's tools as agentfootprint `Tool[]` and a `close()` to tear * down the transport. * * @throws when `@modelcontextprotocol/sdk` is not installed (see * error message for `npm install` hint), or when the transport * fails to connect. */ export declare function mcpClient(opts: McpClientOptions): Promise; //# sourceMappingURL=mcpClient.d.ts.map