There was an error while loading. Please reload this page.
1 parent 52ad0a8 commit ce03a03Copy full SHA for ce03a03
1 file changed
src/mcp/client/_transport.py
@@ -3,7 +3,7 @@
3
from __future__ import annotations
4
5
from contextlib import AbstractAsyncContextManager
6
-from typing import Protocol
+from typing import Final, Protocol
7
8
from mcp.shared._stream_protocols import ReadStream, WriteStream
9
from mcp.shared.message import SessionMessage
@@ -12,6 +12,11 @@
12
13
TransportStreams = tuple[ReadStream[SessionMessage | Exception], WriteStream[SessionMessage]]
14
15
+# SDK-private signal emitted by StreamableHTTPTransport after a request with an
16
+# established MCP session receives HTTP 404. It never crosses the wire.
17
+SESSION_EXPIRED: Final = -32003
18
+SESSION_EXPIRED_MARKER: Final = "mcp.client.session_expired"
19
+
20
21
class Transport(AbstractAsyncContextManager[TransportStreams], Protocol):
22
"""Protocol for MCP transports.
0 commit comments