What Changed — aiterm-mcp: A Persistent Terminal MCP Server

A new MCP server called aiterm-mcp has been published to npm. It gives Claude Code a single persistent terminal session instead of spawning a fresh shell for every command. This eliminates the "connect → authenticate → execute → disconnect" cycle that silently burns tokens on every SSH or server task.
What It Means For You — Concrete Impact on Daily Claude Code Usage

When you ask Claude Code to run server commands, it typically sends one command at a time. For SSH, that means ssh host "command" every single time. Each call repeats the full connection, authentication, and MOTD boilerplate. The author measured SSH login MOTD alone at ~385 tokens per connection. For a 10-command task, that's 3,800 tokens of pure boilerplate — before any real work.
aiterm-mcp fixes this by holding one terminal session. SSH connects once. cd and environment variables persist. All subsequent commands are sent directly through the same session. You pay the MOTD token cost once, then zero.
But there's more: aiterm-mcp also prunes output before Claude Code reads it. It removes control characters, folds repeated lines, truncates long output (keeping head and tail), and even summarizes common commands like git status, git log, grep, and pytest into key points. The author measured a 61% reduction on 120 lines of journalctl logs.
Try It Now — Installation and Usage
Installation is a single command. No cloning or building required:
claude mcp add --scope user --transport stdio aiterm -- npx -y aiterm-mcp
Restart Claude Code, then verify with /mcp. You'll see six new tools: pty_open, pty_send, pty_read, pty_send_key, pty_close, pty_list.
Requirements:
- Node.js 18+
- tmux (
apt install tmux/brew install tmux) - Linux / WSL2 / macOS (Windows bridges to WSL)
How to use it in practice:
- Open a terminal:
pty_opencreates a tmux session. - SSH once:
pty_send("ssh 192.168.1.2")— authentication happens here, once. - Run commands:
pty_send("uname -a"),pty_send("docker ps -a"), etc. — all run in the same SSH session. - Read pruned output:
pty_readreturns output with control characters stripped, repeated lines folded, and long content truncated.
Because the terminal is backed by tmux, sessions persist across Claude Code restarts. You can also tmux attach to watch the AI work in real-time.
Honest note: This doesn't eliminate round-trips — Claude Code still needs to send, read, and decide. What it eliminates is the cost per round-trip: no re-authentication, no re-setup, and no output noise.
Source: dev.to









