We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08f4e01 commit 805fb46Copy full SHA for 805fb46
src/mcp/client/stdio.py
@@ -1,6 +1,7 @@
1
import os
2
import sys
3
from contextlib import asynccontextmanager
4
+from pathlib import Path
5
from typing import Literal
6
7
import anyio
@@ -66,6 +67,9 @@ class StdioServerParameters(BaseModel):
66
67
If not specified, the result of get_default_environment() will be used.
68
"""
69
70
+ cwd: str | Path | None = None
71
+ """The working directory to use when spawning the process."""
72
+
73
encoding: str = "utf-8"
74
75
The text encoding used when sending/receiving messages to the server
@@ -101,6 +105,7 @@ async def stdio_client(server: StdioServerParameters):
101
105
[server.command, *server.args],
102
106
env=server.env if server.env is not None else get_default_environment(),
103
107
stderr=sys.stderr,
108
+ cwd=server.cwd,
104
109
)
110
111
async def stdout_reader():
0 commit comments