Disconnect every global MCP server idle longer than ``idle_threshold_ms``, returning the names disconnected. The server's registered config is kept — a later tool call reconnects on demand. Call periodically (e.g. every 60s with a 5-min threshold) from a host-side sweeper to release file descriptors and background workers from quiet MCP servers in long-running deployments.
(&self, py: Python<'_>, idle_threshold_ms: u64)
| 1403 | /// and background workers from quiet MCP servers in long-running |
| 1404 | /// deployments. |
| 1405 | fn disconnect_idle_mcp(&self, py: Python<'_>, idle_threshold_ms: u64) -> Vec<String> { |
| 1406 | let agent = self.inner.clone(); |
| 1407 | py.allow_threads(move || { |
| 1408 | get_runtime().block_on(agent.disconnect_idle_mcp(idle_threshold_ms)) |
| 1409 | }) |
| 1410 | } |
| 1411 | } |
| 1412 | |
| 1413 | // ============================================================================ |