Skip to content

Commit 374da84

Browse files
committed
Update is_running property logic so that it never evaluates to True if _running_count drops below 0
1 parent a2f0eab commit 374da84

File tree

1 file changed

+1
-1
lines changed
  • pydantic_ai_slim/pydantic_ai

1 file changed

+1
-1
lines changed

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async def __aexit__(self, *args: Any) -> bool | None:
309309
@property
310310
def is_running(self) -> bool:
311311
"""Check if the MCP server is running."""
312-
return bool(self._running_count)
312+
return self._running_count > 0
313313

314314
async def _sampling_callback(
315315
self, context: RequestContext[ClientSession, Any], params: mcp_types.CreateMessageRequestParams

0 commit comments

Comments
 (0)