Skip to content

Terminal MCP

An MCP server that gives LLMs a real interactive PTY with observability and seamless human takeover.

Install: go install github.com/fzxbl/terminal-mcp/cmd/terminal-mcp@latest

Install

$go install github.com/fzxbl/terminal-mcp/cmd/terminal-mcp@latest

Install command taken from the project's README or registry entry. Always review code before running it.

terminal-mcp

English | 简体中文

A real PTY terminal for AI agents — with full observability and seamless human takeover.

terminal-mcp is a Model Context Protocol server that gives an LLM agent a real PTY terminal (not a one-shot exec pipe). A human can watch every step the agent takes in real time, take over the exact same session the instant the agent goes down the wrong path, and the agent then resumes with the full context of everything the human just did. Local shells, ssh, containers, gdb, python, top, vim — the agent drives them like a person, and you're never locked out.

One terminal, shared by human and agent. The agent does the driving, you watch live, grab the wheel when it matters, and hand it back — without losing a beat.

Built in Go, single binary, official MCP SDK, Streamable HTTP. Drop it into Cursor, Claude, Comate, or any MCP client.


Why terminal-mcp

Most "run a command" tools hand the model a stateless pipe: one command in, one blob out. It breaks on anything interactive (a login, a REPL, a long-running session), and — worse — it gives the human no way to see what's happening or step in when the agent goes wrong.

terminal-mcp nails five things:

  • 1. A real PTY, not a pipe. A genuine pseudo-terminal with a persistent session. Interactive and full-screen programs (gdb, python, mysql, top, vim), line editing, colors, prompts, control keys — all work exactly as they do for a human. Not exec one-shots.
  • 2. Full observability — the same screen the agent sees. Every session has a live web terminal URL. Open it and watch, in real time, every keystroke and byte the agent produces. No guessing what your agent did.
  • 3. Take over to fix, release to resume — one session, driven by both. See the agent heading the wrong way? Click take over and type straight into the running PTY; its writes pause instantly. Fix things by hand (enter a password, run the right command, back it out of a hole), then release — everything you typed is fed back as [rc=n] $ command with output, so the agent continues with complete knowledge of what you just did. No re-explaining, no lost state.
  • 4. A fence around the agent — transparent resource limits, inescapable across shell switches. Configure a model-invisible ulimit that's injected at session start and re-injected every time the agent hops into a new shell (ssh remote / su / container). The hard limit is inherited by every child process, so unprivileged commands can't raise it back — the agent can't escape the cap by switching shells or running other commands. A safety net for autonomous agents, with zero awareness on the model side.
  • 5. Scales horizontally behind a load balancer. Session-level routing (the owner node is encoded into the session_id and requests auto-reverse-proxy across nodes) lets you run it as a multi-node deployment behind an LB and add machines when you need more capacity; each session is guarded by a one-time capability key, so many users and agents run concurrently without stepping on each other. (See "Distributed deployment & horizontal scaling" below.)

Plus the machinery that makes the above reliable:

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related