MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / connect

Function connect

src/mcp/client/client.py:65–67  ·  view source on GitHub ↗
(exit_stack: AsyncExitStack, _mode: ConnectMode, _raise_exceptions: bool)

Source from the content-addressed store, hash-verified

63 """Connector for the stream-backed paths (URL, user-supplied ``Transport``)."""
64
65 async def connect(exit_stack: AsyncExitStack, _mode: ConnectMode, _raise_exceptions: bool) -> Dispatcher[Any]:
66 read_stream, write_stream = await exit_stack.enter_async_context(transport)
67 return JSONRPCDispatcher(read_stream, write_stream)
68
69 return connect
70

Callers

nothing calls this directly

Calls 6

JSONRPCDispatcherClass · 0.90
InMemoryTransportClass · 0.90
modern_on_requestFunction · 0.90
lifespanMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected