Think Playwright but for terminal applications. This server lets AI agents interact with terminal UIs through structured snapshots that detect buttons, text fields, and other elements. You get operations like terminal_click to interact with UI components, terminal_wait_for to sync on text or idle states, and terminal_snapshot to capture the current state tree. Ships with visual mode using xterm on Linux/macOS or headless for CI environments. The use case is automating complex terminal applications like htop, vim, or custom TUIs where you need more than just shell command execution. Built in Rust, installed via npx, and works across Claude, Cursor, VS Code, and other MCP clients.
Public tool metadata for what this MCP can expose to an agent.
terminal_startStart a terminal session. Auto-detects shell if omitted.6 paramsStart a terminal session. Auto-detects shell if omitted.
cwdstringenvobjectcolsintegernamestringrowsintegershellstringterminal_execRun a command in a session and wait for completion.6 paramsRun a command in a session and wait for completion.
commandstringtimeoutintegermaxLinesintegersessionIdstringquietExitMsintegerminOutputBytesintegerterminal_runRun a binary directly. shell=true for built-ins/pipes/redirects.12 paramsRun a binary directly. shell=true for built-ins/pipes/redirects.
cmdstringcwdstringargsarrayparsebooleanshellbooleansummarybooleantimeoutintegerparseOnlybooleansuccessFilestringmaxOutputBytesintegersuccessExitCodevaluesuccessFilePatternstringterminal_writeWrite raw data to a terminal session.2 paramsWrite raw data to a terminal session.
datastringsessionIdstringterminal_readRead new output from a terminal session.5 paramsRead new output from a terminal session.
sinceintegertimeoutintegermaxLinesintegersessionIdstringidleTimeoutintegerterminal_waitWait for a pattern to appear in terminal output.5 paramsWait for a pattern to appear in terminal output.
patternstringtimeoutintegersessionIdstringtailLinesintegerreturnModestringtail · full · match-onlydefault: tailterminal_stopStop a terminal session.3 paramsStop a terminal session.
sessionIdstringsnapshotLinesintegertranscriptPathstringterminal_listList active terminal sessions.1 paramsList active terminal sessions.
verbosebooleanterminal_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 params8 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.
argsobjectlistbooleantoolstringMCP server enabling AI agents to interact with terminal applications through structured Terminal State Tree representation. Works with any AI assistant that supports the Model Context Protocol.
npx mcp-server-terminal
Download pre-built binaries from Releases.
git clone https://github.com/aybelatchane/mcp-server-terminal.git
cd mcp-server-terminal
cargo build --release
# Binary: ./target/release/terminal-mcp
claude mcp add terminal -- npx mcp-server-terminal
Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
codex mcp add terminal -- npx mcp-server-terminal
Add to ~/.codex/config.toml:
[mcp_servers.terminal]
command = "npx"
args = ["mcp-server-terminal"]
gemini mcp add terminal npx mcp-server-terminal
VS Code 1.101+ supports MCP. Add to your VS Code settings (settings.json):
{
"mcp.servers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Add to ~/.cursor/mcp.json or .cursor/mcp.json in your project:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Add to your Zed settings (Preferences → Settings):
{
"context_servers": {
"terminal": {
"command": {
"path": "npx",
"args": ["mcp-server-terminal"]
}
}
}
}
Click MCP Servers icon → Configure → Advanced MCP Settings, then add:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Add to your Bedrock agent MCP configuration:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
For any MCP-compatible client, configure the server with:
npx["mcp-server-terminal"]Or if using the binary directly:
terminal-mcpAsk your AI agent:
| Tool | Description |
|---|---|
terminal_session_create | Start a terminal session |
terminal_session_list | List active sessions |
terminal_session_close | Close a session |
terminal_session_resize | Resize terminal dimensions |
terminal_snapshot | Capture terminal state with UI elements |
terminal_type | Type text into terminal |
terminal_press_key | Press keys (arrows, F-keys, Ctrl+X) |
terminal_click | Click on detected UI element |
terminal_wait_for | Wait for text, element, or idle state |
terminal_read_output | Read raw terminal output |
By default, sessions spawn a visible terminal window (xterm). For headless operation:
npx mcp-server-terminal --headless
Or in your MCP config:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal", "--headless"]
}
}
}
Visual mode requires X11. Add the DISPLAY environment variable to your MCP config:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"],
"env": {
"DISPLAY": ":0"
}
}
}
}
Set the RUST_LOG environment variable:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"],
"env": {
"RUST_LOG": "info"
}
}
}
}
Log levels: error, warn, info, debug, trace
Logs go to stderr (stdout is reserved for MCP protocol).
| Platform | Architecture | Status | Visual Mode |
|---|---|---|---|
| Linux | x64, arm64 | ✅ Full support | xterm + tmux |
| macOS | x64, arm64 | ✅ Full support | Terminal.app / iTerm2 |
| Windows (WSL) | x64, arm64 | ✅ Full support | xterm + tmux (via X11) |
| Windows (native) | x64 | ⚠️ Headless only | Not supported |
Windows users: Use WSL for full functionality including visual mode.
MIT
DISPLAYX11 display for visual mode (Linux/WSL). Example: :0
RUST_LOGdefault: infoLogging level: error, warn, info, debug, trace
therealtimex/browser-use
jae-jae/fetcher-mcp
merajmehrabi/puppeteer-mcp-server
com.thenextgennexus/playwright-mcp-server
saik0s/mcp-browser-use