Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/strands/tools/mcp/mcp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,10 @@ def _matches_patterns(self, tool: MCPAgentTool, patterns: list[_ToolMatcher]) ->
return False

def _is_session_active(self) -> bool:
return self._background_thread is not None and self._background_thread.is_alive()
if self._background_thread is None or not self._background_thread.is_alive():
return False

if self._close_future is not None and self._close_future.done():
return False

return True