Open History to see the last commit
1import { StdioClientTransport } from '@modelcontextprotocol/client/stdio'
2import type { StdioTransportConfig } from './transport'
3
4/**
5 * Build a stdio Transport to pass as `createMCPClient({ transport })`.
6 *
7 * Node only. This does not start the process.
8 * `config.command` is the program. `config.args`, `config.env`, and `config.cwd` go to that program.
9 */
10export function stdioTransport(config: Omit<StdioTransportConfig, 'type'>) {
11 return new StdioClientTransport({
12 command: config.command,
13 args: config.args,
14 env: config.env,
15 cwd: config.cwd,
16 })
17}