Skip to content

Commit 9ae4df8

Browse files
authored
Use default environment even when env is provided(#327)
1 parent e2a7338 commit 9ae4df8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mcp/client/stdio.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ async def stdio_client(server: StdioServerParameters, errlog: TextIO = sys.stder
103103

104104
process = await anyio.open_process(
105105
[server.command, *server.args],
106-
env=server.env if server.env is not None else get_default_environment(),
106+
env=(
107+
{**get_default_environment(), **server.env}
108+
if server.env is not None
109+
else get_default_environment()
110+
),
107111
stderr=errlog,
108112
cwd=server.cwd,
109113
)

0 commit comments

Comments
 (0)