# Check whether MCPTools connected and leave no stray MCP servers

> Agno's `MCPTools.connect()` now tells you whether the toolkit is ready, and a failed or cancelled connect no longer leaves the stdio server it launched running.

- Published: 2026-11-17
- Author: Nick
- Categories: Changelog
- Canonical: https://www.agno.com/blog/check-whether-mcptools-connected-and-leave-no-stray-mcp-servers
- Markdown: https://www.agno.com/blog/check-whether-mcptools-connected-and-leave-no-stray-mcp-servers.md

Agno's `MCPTools.connect()` now returns `True` once the toolkit has the server's tools and `False` when it doesn't, so your code can tell whether the MCP server is usable. Before, the method logged any error and returned `None` in every case.

```python
mcp_tools = MCPTools("npx -y @openbnb/mcp-server-airbnb")
if not await mcp_tools.connect():
    raise RuntimeError("Airbnb MCP server is unavailable")
```

A stdio server that answered the handshake and then failed tool discovery also kept running on earlier releases, and `close()` skipped it because the toolkit never finished initializing. A connect cancelled while tools were loading left the server behind the same way. `connect()` now closes the session and the server process in both cases.

```text
Earlier releases: connect() returned None; server processes alive after connect(): ['badtools_server.py']; after close(): ['badtools_server.py']
This release:     connect() returned False; server processes alive after connect(): []; after close(): []
```

We ran each case on both releases against small stdio servers written for the test, one that errors on `tools/list` and one that never answers it, and listed child processes with psutil.

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/mcp/airbnb.py), and learn more about the [stdio transport](https://docs.agno.com/tools/mcp/transports/stdio) in the documentation.
