Skip to content

Commit edb0abd

Browse files
committed
Inline the streamable-http transport-context kind literal
1 parent d9f77bc commit edb0abd

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/mcp/server/streamable_http.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@
9090
# Pattern ensures entire string contains only valid characters by using ^ and $ anchors
9191
SESSION_ID_PATTERN = re.compile(r"^[\x21-\x7E]+$")
9292

93-
# Streamable HTTP transport kind for `TransportContext.kind`.
94-
STREAMABLE_HTTP_KIND = "streamable-http"
95-
9693
# Type aliases
9794
StreamId = str
9895
EventId = str
@@ -562,7 +559,7 @@ async def close_standalone_stream_callback() -> None:
562559
return ServerMessageMetadata(request_context=request)
563560

564561
def _transport_context(self, request: Request, *, can_send_request: bool) -> TransportContext:
565-
return TransportContext(kind=STREAMABLE_HTTP_KIND, can_send_request=can_send_request, headers=request.headers)
562+
return TransportContext(kind="streamable-http", can_send_request=can_send_request, headers=request.headers)
566563

567564
async def _mint_priming_event(self, stream_id: StreamId, protocol_version: str) -> SSEEvent | None:
568565
"""Store the priming cursor for `stream_id` and return its SSE wire form.

0 commit comments

Comments
 (0)