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

Function _no_channel_session

tests/server/test_stateless_mode.py:56–62  ·  view source on GitHub ↗

A session whose standalone channel is the connection's no-channel sentinel; the request channel is a working stub.

(request_ch: StubOutbound | None = None)

Source from the content-addressed store, hash-verified

54
55
56def _no_channel_session(request_ch: StubOutbound | None = None) -> tuple[ServerSession, StubOutbound]:
57 """A session whose standalone channel is the connection's no-channel
58 sentinel; the request channel is a working stub."""
59 conn = Connection.from_envelope(LATEST_PROTOCOL_VERSION, None, None)
60 assert conn.has_standalone_channel is False
61 request = request_ch if request_ch is not None else StubOutbound()
62 return ServerSession(request, conn), request
63
64
65@pytest.fixture

Calls 3

ServerSessionClass · 0.90
from_envelopeMethod · 0.80
StubOutboundClass · 0.70

Tested by

no test coverage detected