diff --git a/src/agents/mcp/server.py b/src/agents/mcp/server.py index e70d7ce6..1c01f175 100644 --- a/src/agents/mcp/server.py +++ b/src/agents/mcp/server.py @@ -4,7 +4,7 @@ import asyncio from contextlib import AbstractAsyncContextManager, AsyncExitStack from pathlib import Path -from typing import Any, Literal +from typing import Any, Literal, Self from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream from mcp import ClientSession, StdioServerParameters, Tool as MCPTool, stdio_client @@ -34,7 +34,7 @@ def name(self) -> str: pass @abc.abstractmethod - async def cleanup(self): + async def cleanup(self) -> Self: """Cleanup the server. For example, this might mean closing a subprocess or closing a network connection. """