You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MCPClient class docstring (file: smolagents/mcp_client.py), the example for manual connection management currently uses mcp_client.stop() in the finally block:
try:
mcp_client=MCPClient(...)
tools=mcp_client.get_tools()
# use your tools here.finally:
mcp_client.stop()
However, the correct method to close the connection is mcp_client.disconnect(), as defined in the class. There is no stop() method, so this could confuse users and lead to errors.
Suggested fix:
Update the docstring example to use mcp_client.disconnect() instead of mcp_client.stop(). This will ensure the documentation matches the actual API and helps users manage connections correctly.