Skip to content

Commit

Permalink
make stderr of server subprocess configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sheffler committed Feb 5, 2025
1 parent 53bfac0 commit 467f307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcp/client/stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class StdioServerParameters(BaseModel):


@asynccontextmanager
async def stdio_client(server: StdioServerParameters):
async def stdio_client(server: StdioServerParameters, errlog=sys.stderr):
"""
Client transport for stdio: this will connect to a server by spawning a
process and communicating with it over stdin/stdout.
Expand All @@ -100,7 +100,7 @@ async def stdio_client(server: StdioServerParameters):
process = await anyio.open_process(
[server.command, *server.args],
env=server.env if server.env is not None else get_default_environment(),
stderr=sys.stderr,
stderr=errlog,
)

async def stdout_reader():
Expand Down

0 comments on commit 467f307

Please sign in to comment.