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

Function _extract_session_id_from_endpoint

src/mcp/client/sse.py:25–27  ·  view source on GitHub ↗
(endpoint_url: str)

Source from the content-addressed store, hash-verified

23
24
25def _extract_session_id_from_endpoint(endpoint_url: str) -> str | None:
26 query_params = parse_qs(urlparse(endpoint_url).query)
27 return query_params.get("sessionId", [None])[0] or query_params.get("session_id", [None])[0]
28
29
30@asynccontextmanager

Callers 2

sse_readerFunction · 0.85

Calls

no outgoing calls

Tested by 1