Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/dolphin_mcp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,24 @@ async def start(self):
cwd=self.cwd
)
self.receive_task = asyncio.create_task(self._receive_loop())
# Print subprocess stdout to current process stdout
async def _print_stdout(proc):
while True:
line = await proc.stdout.readline()
if not line:
break
logger.debug(f"[{self.server_name} STDOUT]", line.decode().rstrip(), file=sys.stdout)
await asyncio.sleep(0.01) # Throttle to avoid busy loop
asyncio.create_task(_print_stdout(self.process))
# Print subprocess stderr to current process stderr
async def _print_stderr(proc):
while True:
line = await proc.stderr.readline()
if not line:
break
logger.error(f"[{self.server_name} STDERR]", line.decode().rstrip(), file=sys.stderr)
await asyncio.sleep(0.01) # Throttle to avoid busy loop
asyncio.create_task(_print_stderr(self.process))
return await self._perform_initialize()
except Exception:
return False
Expand Down