MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / __aenter__

Method __aenter__

src/mcp/client/_memory.py:98–101  ·  view source on GitHub ↗

Connect to the server and return streams for communication.

(self)

Source from the content-addressed store, hash-verified

96 tg.cancel_scope.cancel()
97
98 async def __aenter__(self) -> TransportStreams:
99 """Connect to the server and return streams for communication."""
100 self._cm = self._connect()
101 return await self._cm.__aenter__()
102
103 async def __aexit__(
104 self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None

Callers

nothing calls this directly

Calls 1

_connectMethod · 0.95

Tested by

no test coverage detected