list_sessions
List all active sessions
How to use it
list_sessions is exposed by the Pty MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the list_sessions tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Pty MCP
claude mcp add pty-mcp -- /usr/local/bin/pty-mcpOther tools in Pty MCP (11)
Close a session (terminates remote PTY)
Start a local interactive terminal (bash, python3, node, etc.)
Connect to a serial port device
SSH to a remote host (supports SSH config aliases)
Disconnect but keep remote PTY running
List persistent sessions on a remote host
Read output, optionally wait for a pattern (waitfor, timeout, contextlines, taillines)
Resize the terminal window (rows/cols) for any session type
Send control keys (ctrl+c, ctrl+d, arrows, tab, etc.)
Send a command and wait for output to settle
Prompt the human operator for a secret via GUI dialog; sends it to the PTY session without exposing it to AI context or logs ¹