Content-Length: 289639 | pFad | http://github.com/Michaelzag/python-sdk/commit/c3fd34a1a62d71e3f5d8a2418ad10c262cb1ab92

62 Enhancement: make stderr of server subprocess configurable (#191) · Michaelzag/python-sdk@c3fd34a · GitHub
Skip to content

Commit c3fd34a

Browse files
shefflerdsp-ant
andauthored
Enhancement: make stderr of server subprocess configurable (modelcontextprotocol#191)
* make stderr of server subprocess configurable * Update stdio.py --------- Co-authored-by: David Soria Parra <167242713+dsp-ant@users.noreply.github.com>
1 parent ae77772 commit c3fd34a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mcp/client/stdio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from contextlib import asynccontextmanager
44
from pathlib import Path
5-
from typing import Literal
5+
from typing import Literal, TextIO
66

77
import anyio
88
import anyio.lowlevel
@@ -87,7 +87,7 @@ class StdioServerParameters(BaseModel):
8787

8888

8989
@asynccontextmanager
90-
async def stdio_client(server: StdioServerParameters):
90+
async def stdio_client(server: StdioServerParameters, errlog: TextIO = sys.stderr):
9191
"""
9292
Client transport for stdio: this will connect to a server by spawning a
9393
process and communicating with it over stdin/stdout.
@@ -104,7 +104,7 @@ async def stdio_client(server: StdioServerParameters):
104104
process = await anyio.open_process(
105105
[server.command, *server.args],
106106
env=server.env if server.env is not None else get_default_environment(),
107-
stderr=sys.stderr,
107+
stderr=errlog,
108108
cwd=server.cwd,
109109
)
110110

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Michaelzag/python-sdk/commit/c3fd34a1a62d71e3f5d8a2418ad10c262cb1ab92

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy