@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.
18 lines (16 loc) • 577 B
text/typescript
import { StdioClientTransport } from '@modelcontextprotocol/client/stdio'
import type { StdioTransportConfig } from './transport'
/**
* Build a stdio Transport to pass as `createMCPClient({ transport })`.
*
* Node only. This does not start the process.
* `config.command` is the program. `config.args`, `config.env`, and `config.cwd` go to that program.
*/
export function stdioTransport(config: Omit<StdioTransportConfig, 'type'>) {
return new StdioClientTransport({
command: config.command,
args: config.args,
env: config.env,
cwd: config.cwd,
})
}