You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx
+16-5
Original file line number
Diff line number
Diff line change
@@ -639,15 +639,18 @@ Create an MCP client using either:
639
639
640
640
-`stdio`: Uses standard input and output streams for communication, ideal for local tool servers running on the same machine (like CLI tools or local services)
641
641
-`SSE` (Server-Sent Events): Uses HTTP-based real-time communication, better suited for remote servers that need to send data over the network
642
+
- Custom transport: Bring your own transport by implementing the `MCPTransport` interface
description: Create a transport for Model Context Protocol (MCP) clients to communicate with MCP servers using standard input and output streams
4
+
---
5
+
6
+
# `Experimental_StdioMCPTransport`
7
+
8
+
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.
9
+
10
+
This feature is experimental and may change or be removed in the future.
11
+
12
+
## Import
13
+
14
+
<Snippet
15
+
text={`import { Experimental_StdioMCPTransport } from "ai/mcp-stdio"`}
16
+
prompt={false}
17
+
/>
18
+
19
+
## API Signature
20
+
21
+
### Parameters
22
+
23
+
<PropertiesTable
24
+
content={[
25
+
{
26
+
name: 'config',
27
+
type: 'StdioConfig',
28
+
description: 'Configuration for the MCP client.',
29
+
properties: [
30
+
{
31
+
type: 'StdioConfig',
32
+
parameters: [
33
+
{
34
+
name: 'command',
35
+
type: 'string',
36
+
description: 'The command to run the MCP server.',
37
+
},
38
+
{
39
+
name: 'args',
40
+
type: 'string[]',
41
+
isOptional: true,
42
+
description: 'The arguments to pass to the MCP server.',
43
+
},
44
+
{
45
+
name: 'env',
46
+
type: 'Record<string, string>',
47
+
isOptional: true,
48
+
description:
49
+
'The environment variables to set for the MCP server.',
50
+
},
51
+
{
52
+
name: 'stderr',
53
+
type: 'IOType | Stream | number',
54
+
isOptional: true,
55
+
description: "The stream to write the MCP server's stderr to.",
56
+
},
57
+
{
58
+
name: 'cwd',
59
+
type: 'string',
60
+
isOptional: true,
61
+
description: 'The current working directory for the MCP server.',
0 commit comments