StdioMCPTransport
Creates a transport for Model Context Protocol (MCP) clients to communicate with MCP servers using standard input and output streams. This transport is only supported in Node.js environments.
Experimental_StdioMCPTransport is a deprecated alias of StdioMCPTransport.
Import
import { StdioMCPTransport } from "@ai-sdk/mcp/mcp-stdio"
API Signature
Parameters
config:
StdioConfig
Configuration for the MCP client.
StdioConfig
command:
string
The command to run the MCP server.
args?:
string[]
The arguments to pass to the MCP server.
env?:
Record<string, string>
The environment variables to set for the MCP server.
stderr?:
IOType | Stream | number
The stream to write the MCP server's stderr to.
cwd?:
string
The current working directory for the MCP server.