Skip to content

Commit 826ec0a

Browse files
committed
Rename _terminate_session to terminal in StreamableHTTPServerTransport
1 parent 342a6b5 commit 826ec0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mcp/server/streamable_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,15 +612,15 @@ async def _handle_delete_request(self, request: Request, send: Send) -> None:
612612
if not await self._validate_request_headers(request, send):
613613
return
614614

615-
await self._terminate_session()
615+
await self.terminate()
616616

617617
response = self._create_json_response(
618618
None,
619619
HTTPStatus.OK,
620620
)
621621
await response(request.scope, request.receive, send)
622622

623-
async def _terminate_session(self) -> None:
623+
async def terminate(self) -> None:
624624
"""Terminate the current session, closing all streams.
625625
626626
Once terminated, all requests with this session ID will receive 404 Not Found.

src/mcp/server/streamable_http_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ async def run_stateless_server(*, task_status: TaskStatus[None] = anyio.TASK_STA
190190
# Handle the HTTP request and return the response
191191
await http_transport.handle_request(scope, receive, send)
192192

193-
# Terminate the session after the request is handled
194-
await http_transport._terminate_session() # type: ignore[reportPrivateUsage]
193+
# Terminate the transport after the request is handled
194+
await http_transport.terminate()
195195

196196
async def _handle_stateful_request(
197197
self,

0 commit comments

Comments
 (0)