UNPKG

@tanstack/ai-mcp

Version:

Host-side Model Context Protocol client for TanStack AI: discover and run MCP server tools, resources, and prompts in any adapter's chat() loop, with generated end-to-end types.

16 lines (14 loc) 543 B
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js' import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js' import type { StdioTransportConfig } from './transport' /** Build a stdio transport instance to pass as `createMCPClient({ transport })`. Node-only. */ export function stdioTransport( config: Omit<StdioTransportConfig, 'type'>, ): Transport { return new StdioClientTransport({ command: config.command, args: config.args, env: config.env, cwd: config.cwd, }) }