Aiterm Mcp
@kitepon-rgb
One persistent tmux-backed terminal for AI agents. ssh, docker exec, and REPLs nest inside a single authenticated session (no re-auth per command). Token-reduced reads, 4-layer completion detection, and a human can co-drive via the shared tmux socket. Install: npx -y aiterm-mcp
概要
What is Aiterm Mcp?
Aiterm Mcp is a Model Context Protocol server that provides one persistent terminal session (backed by tmux) over stdio. It is designed for AI agents that need to run multiple commands in a single SSH, Docker, or REPL session without reconnecting for each command. The server reduces token usage by truncating output and includes completion detection.
How to use Aiterm Mcp?
Install via claude mcp add --scope user --transport stdio aiterm -- npx -y aiterm-mcp (for Claude Code) or run npx -y aiterm-mcp for any MCP client. Requires Node.js 18 or later and tmux. The server exposes six tools: pty_open, pty_send, pty_read, pty_key, pty_close, and pty_list.
Key features of Aiterm Mcp
- One persistent tmux-backed terminal that survives restarts.
- SSH, containers, and REPLs nest via a single
pty_sendcall. - Token-reduced reads with per-command reducers for git, grep, pytest.
- Four-layer completion detection (exit codes,
until, quiescence, timeout). - Human co-driving possible via a shared tmux socket.
- Supports Linux, WSL2, macOS, and native Windows.
Use cases of Aiterm Mcp
- Running multi‑step SSH commands without re‑authenticating each step.
- Executing commands inside Docker containers or REPLs in a single session.
- Automating development workflows (e.g., git, pytest, grep) with reduced token consumption.
- Allowing a human and an AI agent to share the same terminal session.
FAQ from Aiterm Mcp
What problem does Aiterm Mcp solve?
Over SSH, one-command-at-a-time leads to re‑authenticating every call, short‑lived sessions piling up, and fail2ban locking you out. Aiterm holds one authenticated session, preventing those issues.
What are the runtime dependencies?
Node.js 18 or later and tmux must be installed on the host.
Which platforms are supported?
Linux, WSL2, macOS, and native Windows.
Can a human interact with the same terminal?
Yes, the terminal is backed by a shared tmux socket, allowing a human to co‑drive the session.
What tools does Aiterm Mcp expose?
Six tools: pty_open, pty_send, pty_read, pty_key, pty_close, and pty_list.