Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions src/mcp/client/stdio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ async def stdin_writer():
await terminate_windows_process(process)
else:
process.terminate()
read_stream.close()
write_stream.close()


def _get_executable_command(command: str) -> str:
Expand Down
13 changes: 13 additions & 0 deletions tests/client/test_stdio_cm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest

from mcp import StdioServerParameters
from mcp.client.stdio import stdio_client


@pytest.mark.anyio
async def test_context_manager_exiting():
async with stdio_client(StdioServerParameters(command="tee")) as (
read_stream,
write_stream,
):
pass
Loading