
pty-mcp
Built for sysadmins who need AI to actually manage servers, not just generate scripts. Exposes real PTY sessions over MCP: spawn local shells, SSH into remote hosts, connect to serial consoles for network gear, and run persistent sessions that survive disconnects via an included ai-tmux daemon. The standout feature is wait_for, which blocks server-side until a regex pattern appears in output instead of forcing the agent to poll in a loop. Send control characters like ctrl+c, resize terminals, and optionally log all operations for audit trails. If you're letting Claude reboot a server and wait until it pings back, or tail logs until an error appears, this is the tool.
- GitHub stars
- 9
- tools
- 12
- transport
- STDIO
- last updated
- Mar 24, 2026
Tools
12 toolsPublic tool metadata for what this MCP can expose to an agent.
create_local_sessionStart a local interactive terminal (bash, python3, node, etc.)
Start a local interactive terminal (bash, python3, node, etc.)
No parameter schema in public metadata yet.
create_ssh_sessionSSH to a remote host (supports SSH config aliases)
SSH to a remote host (supports SSH config aliases)
No parameter schema in public metadata yet.
create_serial_sessionConnect to a serial port device
Connect to a serial port device
No parameter schema in public metadata yet.
send_inputSend a command and wait for output to settle
Send a command and wait for output to settle
No parameter schema in public metadata yet.
read_outputRead output, optionally wait for a pattern (`wait_for`, `timeout`, `context_lines`, `tail_lines`)
Read output, optionally wait for a pattern (`wait_for`, `timeout`, `context_lines`, `tail_lines`)
No parameter schema in public metadata yet.
send_controlSend control keys (ctrl+c, ctrl+d, arrows, tab, etc.)
Send control keys (ctrl+c, ctrl+d, arrows, tab, etc.)
No parameter schema in public metadata yet.
send_secretPrompt the human operator for a secret via GUI dialog; sends it to the PTY session without exposing it to AI context or logs
Prompt the human operator for a secret via GUI dialog; sends it to the PTY session without exposing it to AI context or logs
No parameter schema in public metadata yet.
list_sessionsList all active sessions
List all active sessions
No parameter schema in public metadata yet.
close_sessionClose a session (terminates remote PTY)
Close a session (terminates remote PTY)
No parameter schema in public metadata yet.
detach_sessionDisconnect but keep remote PTY running
Disconnect but keep remote PTY running
No parameter schema in public metadata yet.
resize_sessionResize the terminal window (rows/cols) for any session type
Resize the terminal window (rows/cols) for any session type
No parameter schema in public metadata yet.
list_remote_sessionsList persistent sessions on a remote host
List persistent sessions on a remote host
No parameter schema in public metadata yet.
Sponsors
Readme
pty-mcp
An MCP (Model Context Protocol) server that gives AI agents interactive terminal sessions — local shells, SSH, serial ports, and persistent remote sessions that survive disconnects.
Built for sysadmins and network engineers who want AI to help with real server and device management, not just code generation.
AI agent interacting with Telehack BBS via pty-mcp
Why
AI agents run commands in non-interactive shells. They can't:
- SSH into a server and interact with running processes
- Connect to routers or switches via serial console
- Monitor logs and react when a specific event occurs
- Keep session state across multiple commands
- Wait for a server to reboot and detect when it's back up
pty-mcp solves all of these by providing real PTY sessions over MCP.
Details
- Repository
- github.com/raychao-oao/pty-mcp
- Package
https://github.com/raychao-oao/pty-mcp/releases/download/v0.2.3/pty-mcp-darwin-arm64- Transport
- STDIO
- Registry
- MCP registry, active