Skip to content

Commit 15f0ac7

Browse files
author
David Padbury
committed
fix: close mcp client event loop
1 parent a64a851 commit 15f0ac7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/strands/tools/mcp/mcp_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ async def _set_close_event() -> None:
330330
self._log_debug_with_thread("waiting for background thread to join")
331331
self._background_thread.join()
332332

333+
if self._background_thread_event_loop is not None:
334+
self._background_thread_event_loop.close()
335+
333336
self._log_debug_with_thread("background thread is closed, MCPClient context exited")
334337

335338
# Reset fields to allow instance reuse

0 commit comments

Comments
 (0)