ssh_close_all_sessions
Terminate all active SSH sessions managed by the SSH MCP Server to reset connections, ensure system security, or clear stale sessions.
Instructions
모든 SSH 세션 종료
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:307-314 (handler)MCP tool handler: decorated with @mcp.tool(), calls ssh_manager.close_all_sessions() and formats the response.@mcp.tool() async def ssh_close_all_sessions() -> str: """모든 SSH 세션 종료""" try: closed_count = await ssh_manager.close_all_sessions() return f"Closed {closed_count} SSH sessions" except Exception as e: return f"Failed to close sessions: {str(e)}"
- main.py:170-180 (helper)Core implementation in SSHSessionManager: closes all sessions by iterating and calling close_session on each, returns count of closed sessions.async def close_all_sessions(self) -> int: """모든 세션 종료""" session_ids = list(self.connections.keys()) closed_count = 0 for session_id in session_ids: if await self.close_session(session_id): closed_count += 1 return closed_count