Skip to content

Commit 785e09f

Browse files
authored
Fixed issue modelcontextprotocol#326 - MCP client with npx not working when env parameter of StdioServerParameters is set
1 parent 5a54d82 commit 785e09f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/client/stdio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def stdio_client(server: StdioServerParameters):
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={**get_default_environment(), **server.env} if server.env is not None else get_default_environment(),
107107
stderr=sys.stderr,
108108
cwd=server.cwd,
109109
)

0 commit comments

Comments
 (0)