Skip to content
mkpvishnu avatar

Terminal Mcp

mkpvishnu/terminal-mcp

Persistent terminal sessions for SSH, REPLs, database CLIs, and TUI apps, with keys and screen reads.

CCM score
74 of 100
GitHub stars
12
tools
9
transport
STDIO
env vars
2
last updated
Feb 28, 2026
View on GitHub

Own this MCP server? Claim it

What it does

  • Starts and stops sessions with terminal_start and terminal_stop, runs commands with terminal_exec and terminal_run, and reads output with terminal_read and terminal_wait
  • Sends raw input and keys with terminal_write and terminal_send_key, plus terminal_resize, terminal_get_history, and terminal_write_file
  • Runs locally over stdio with no account or API key; the uvx launcher is the only required setup
  • Designed for remote shells, interactive interpreters, and monitoring TUIs where state must persist between calls

Tools

9 tools

Public tool metadata for what this MCP can expose to an agent.

terminal_startStart a terminal session. Auto-detects shell if omitted.6 params

Start a terminal session. Auto-detects shell if omitted.

Parameters* required
colsinteger
default: 120
cwdstring
envobject
namestring
rowsinteger
default: 30
shellstring
terminal_execRun a command in a session and wait for completion.6 params

Run a command in a session and wait for completion.

Parameters* required
commandstring
maxLinesinteger
default: 200
minOutputBytesinteger
Min bytes before quiet exitdefault: 1
quietExitMsinteger
Exit if silent for N ms
sessionIdstring
timeoutinteger
default: 30000
terminal_runRun a binary directly. shell=true for built-ins/pipes/redirects.12 params

Run a binary directly. shell=true for built-ins/pipes/redirects.

Parameters* required
argsarray
cmdstring
cwdstring
maxOutputBytesinteger
default: 102400
parseboolean
Parse structured outputdefault: true
parseOnlyboolean
Omit raw when parseddefault: false
shellboolean
Run via system shelldefault: false
successExitCodevalue
null=anydefault: 0
successFilestring
successFilePatternstring
Regex
summaryboolean
default: false
timeoutinteger
default: 30000
terminal_writeWrite raw data to a terminal session.2 params

Write raw data to a terminal session.

Parameters* required
datastring
sessionIdstring
terminal_readRead new output from a terminal session.5 params

Read new output from a terminal session.

Parameters* required
idleTimeoutinteger
Must be < timeoutdefault: 500
maxLinesinteger
default: 200
sessionIdstring
sinceinteger
Byte position for inc. read
timeoutinteger
default: 30000
terminal_waitWait for a pattern to appear in terminal output.5 params

Wait for a pattern to appear in terminal output.

Parameters* required
patternstring
returnModestring
one of tail · full · match-onlydefault: tail
sessionIdstring
tailLinesinteger
default: 50
timeoutinteger
default: 30000
terminal_stopStop a terminal session.3 params

Stop a terminal session.

Parameters* required
sessionIdstring
snapshotLinesinteger
Return last N lines. 0 = none.default: 0
transcriptPathstring
Write history to this path
terminal_listList active terminal sessions.1 params

List active terminal sessions.

Parameters* required
verboseboolean
default: true
terminal_extra8 more tools: terminal_run_paged, terminal_get_history, terminal_resize, terminal_send_key, terminal_watch, terminal_retry, terminal_diff, terminal_write_file. list=true for full schemas, or pass tool + args to call.3 params

8 more tools: terminal_run_paged, terminal_get_history, terminal_resize, terminal_send_key, terminal_watch, terminal_retry, terminal_diff, terminal_write_file. list=true for full schemas, or pass tool + args to call.

Parameters* required
argsobject
listboolean
default: false
toolstring

Configuration

TERMINAL_MCP_MAX_SESSIONS

Maximum concurrent sessions

TERMINAL_MCP_IDLE_TIMEOUT

Seconds before auto-close (default 1800)

Readme

terminal-mcp banner

Give your AI a real terminal. Persistent sessions. Interactive programs. Zero limitations.

PyPI Python 3.10+ License: MIT CI CodeQL


View the full README on GitHub

Details

Repository
github.com/mkpvishnu/terminal-mcp
Categories
Developer Tools, DevOps & Cloud
Package
terminal-mcp
Transport
STDIO
Registry
MCP registry, active

Questions

What can an AI agent do with the terminal-mcp server?

terminal-mcp gives an AI agent a real terminal with persistent PTY sessions that survive across tool calls, so it can connect over SSH, use Python, Node or Ruby REPLs, keep database CLI connections such as psql, mysql or redis-cli open, and navigate TUI apps like htop, vim or fzf. Its core tools include terminal_start, terminal_exec, terminal_write, terminal_read and terminal_wait, with more session controls such as terminal_send_key and terminal_watch.

How do I install the terminal-mcp MCP server?

Run it directly with uvx terminal-mcp, or install it globally with pip install terminal-mcp. Once connected, the agent can start sessions and run commands in a shell that keeps its state between calls.

Which environment variables does terminal-mcp accept?

TERMINAL_MCP_MAX_SESSIONS sets the maximum number of concurrent sessions, and TERMINAL_MCP_IDLE_TIMEOUT sets the seconds before an idle session auto-closes. A third variable, TERMINAL_MCP_MAX_BUFFER_BYTES, caps the per-session buffer size, and all three are optional.

Where does terminal-mcp rank in the Developer Tools category?

terminal-mcp is listed in the Developer Tools category on Claude Marketplaces, alongside servers such as Context7, Chrome DevTools MCP and Codebase Memory. It stands out by giving agents persistent interactive sessions, which plain subprocess-based shell tools cannot maintain between commands.

Similar to Terminal Mcp

More Developer Tools