MCP server that gives AI agents (Claude Code, Cursor, Windsurf, etc.) real interactive terminal sessions. Run REPLs, SSH, database clients, and any interactive CLI — with clean text output, smart completion detection, and 7-layer security.
MCP server for real interactive terminal sessions — REPLs, SSH, databases, Docker
AI coding agents can't handle interactive commands. There's no PTY, no stdin streaming. You can't run rails console, python, psql, ssh, or any REPL through them. This MCP server fixes that.
AI Agent (Claude Code, Cursor, etc.)
↕ MCP (JSON-RPC over stdio)
mcp-interactive-terminal
↕ node-pty + xterm-headless
Interactive Process (rails console, python, psql, ssh, bash...)
↕
Clean text output (exactly what a human would see)
Install
Claude Code
claude mcp add terminal -- npx -y mcp-interactive-terminal
That's it. The server is now available. Ask Claude to "open a python REPL and calculate 2**100".
Cursor
Go to Settings > MCP Servers, click Add Server, and enter:
The server communicates over stdio using the Model Context Protocol. Any MCP-compatible client can use it with the same npx -y mcp-interactive-terminal command.
Real-World Examples
Rails Console
You: "Open rails console for staging and check the user count"
Agent creates session → bash
Agent sends: cd /path/to/app && rails console -e staging
Agent sends: User.count
Agent returns: 1,847,293
You: "Connect to postgres and show me the largest tables"
Agent creates session → psql -U myuser mydb
Agent sends: SELECT tablename, pg_size_pretty(pg_total_relation_size(tablename::text)) ...
Agent returns: formatted table of results
SSH
You: "SSH into the staging server and check disk usage"
Agent creates session → ssh [email protected]
Agent sends: df -h
Agent returns: disk usage table
Docker
You: "Open a shell in my running container and check the logs"
Agent creates session → docker exec -it my-container bash
Agent sends: tail -100 /var/log/app.log
Agent returns: last 100 log lines
Node.js REPL
You: "Open node and test the date parsing logic"
Agent creates session → node
Agent sends: new Date('2024-02-29').toISOString()
Agent returns: 2024-02-29T00:00:00.000Z
{ "session_id": "a1b2c3d4", "input": "rm -rf /tmp/old", "justification": "Cleaning up stale temp files from failed build" }
→ { "output": "...", "is_complete": true, "is_alive": true }
Required when send_command detects a dangerous pattern. The agent must explain why the command is necessary. This is a separate tool — even if send_command is auto-approved, this requires its own permission.
How It Works
Two Terminal Modes
PTY mode (default) — uses node-pty + @xterm/headless (the same terminal emulator as VS Code):
Clean output — the AI sees exactly what a human would see on screen
Cursor positioning, progress bars, \r overwrites all render correctly
Full keyboard: arrow keys, tab completion, ctrl+c/d/z, home/end
MCP servers that fail to start often show no error in the client. Check:
# Test the server directly:
npx -y mcp-interactive-terminal
# You should see "[mcp-terminal] Starting MCP Interactive Terminal Server" on stderr.
# If you see an error, that's what's failing.
Node.js version too old
The server requires Node.js >= 18. If you see errors about unsupported syntax or missing APIs:
node --version # Must be >= 18
# If using nvm:
nvm install 18 && nvm use 18
# If using volta:
volta install node@18
For nvm/volta/fnm users: npx may use a different Node version than your shell. Use an absolute path:
node-pty is a native module that requires build tools. If it fails to compile, the server automatically falls back to pipe mode — interactive sessions still work, just without terminal emulation.
This is because create_session runs the command directly (like exec), not through a shell. Spawning bash first gives you a full shell environment.
Output looks garbled
If output contains escape codes or looks wrong, you're likely in pipe mode (node-pty failed to load). Check the server logs for "falling back to pipe mode". Install build tools (see above) to enable PTY mode.
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Perguntas
Como instalo Interactive Terminal?
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Interactive Terminal precisa de uma chave de API?
O publicador lista estas variáveis de ambiente: MCP_TERMINAL_MAX_SESSIONS, MCP_TERMINAL_SANDBOX, MCP_TERMINAL_REDACT_SECRETS.
Qual transporte Interactive Terminal usa?
Interactive Terminal roda localmente via stdio.
Quando Interactive Terminal foi verificado pela última vez?
Última verificação: 2026-11-09. MCP server for real interactive terminal sessions — REPLs, SSH, databases, Docker