MCP server for real interactive terminal sessions — REPLs, SSH, databases, Docker
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag — we're steadily working through the catalog.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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.
That's it. The server is now available. Ask Claude to "open a python REPL and calculate 2**100".
Go to Settings > MCP Servers, click Add Server, and enter:
Add to your MCP configuration:
Add to your .vscode/mcp.json:
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.
The server exposes 7 MCP tools:
create_session — Spawn an interactive process| Parameter | Required | Default | Description |
|---|---|---|---|
command | Yes | — | Command to run (bash, python3, psql, ssh, etc.) |
args | No | [] | Command arguments |
name | No | auto | Human-readable session name |
cwd | No | server cwd | Working directory |
env | No | {} | Additional environment variables |
cols | No | 120 | Terminal columns |
rows | No | 40 | Terminal rows |
send_command — Send input and get output| Parameter | Required | Default | Description |
|---|---|---|---|
session_id | Yes | — | Target session |
input | Yes | — | Command/input to send (newline appended automatically) |
timeout_ms | No | 5000 | Max wait time for output |
max_output_chars | No | 20000 | Truncate output beyond this |
Dangerous commands (rm -rf, DROP TABLE, curl|bash, etc.) are blocked — the agent must use confirm_dangerous_command first.
read_output — Read terminal screen (read-only)Safe to auto-approve — this only reads, never sends input.
list_sessions — List active sessions (read-only)Safe to auto-approve.
close_session — Kill a sessionsend_control — Send control charactersSupported: ctrl+c, ctrl+d, ctrl+z, ctrl+l, ctrl+r, tab, escape, up, down, left, right, enter, backspace, delete, home, end, and more.
confirm_dangerous_command — Two-step safety confirmationRequired 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.
PTY mode (default) — uses node-pty + @xterm/headless (the same terminal emulator as VS Code):
\r overwrites all render correctlyPipe mode (automatic fallback) — activates when node-pty can't load (e.g., in sandboxed environments):
child_process.spawn with auto-injected flags (python -u -i, bash -i, etc.)The mode is selected automatically — PTY is tried first, pipe mode kicks in if it fails.
| Scenario | PTY mode | Pipe mode |
|---|---|---|
printf "\rProgress: 3/3" | Progress: 3/3 | Progress: 1/3Progress: 2/3Progress: 3/3 |
| ANSI colors | Stripped cleanly | Stripped via regex |
| vim, htop, top | Readable screen | Garbled |
| Arrow keys, tab completion | Works | Works |
| Terminal resize | Works | No-op |
Instead of blindly waiting a fixed time, the server uses a layered strategy:
$, python >>>, psql #, etc.), watches for it to reappeartimeout_ms with is_complete: falseSeven-layer defense-in-depth:
| Layer | What It Does | Default |
|---|---|---|
| MCP Tool Annotations | readOnlyHint/destructiveHint on each tool | Always on |
| Confirmation Flow | Dangerous patterns require confirm_dangerous_command | Always on |
| Input Pattern Detection | Detect rm -rf, DROP TABLE, curl|bash, etc. | Always on |
| Command Blocklist/Allowlist | Block/allow specific commands | Configurable |
| OS-Level Sandbox | Kernel-level process sandboxing via @anthropic-ai/sandbox-runtime | Off (opt-in) |
| Secret Redaction | Redact AWS keys, tokens, private keys in output | Off (opt-in) |
| Resource Limits | Max sessions, output cap, idle timeout, audit logging | Always on |
Only auto-approve the read-only tools:
This way send_command, create_session, and especially confirm_dangerous_command always require human approval.
All settings via environment variables. Pass them in your MCP config:
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/interactive-terminal)<a href="https://allmcps.com/mcp/interactive-terminal"><img src="https://allmcps.com/api/badge/interactive-terminal?style=directory" alt="Interactive Terminal on AllMCPs" /></a>