MCP 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. Download pre-built binaries from Releases. Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claudedesktopconfig.json (Windows): Add to ~/.codex/config.toml: VS Code 1.101+ supports MCP. Add to your V
Add this skill
npx mdskills install aybelatchane/mcp-server-terminalWell-documented MCP server with comprehensive tools for terminal interaction and excellent setup guides
1# Terminal MCP Server23[](https://www.npmjs.com/package/mcp-server-terminal)4[](https://www.npmjs.com/package/mcp-server-terminal)5[](https://opensource.org/licenses/MIT)67MCP 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](https://modelcontextprotocol.io/).89## Installation1011### Via npm (Recommended)1213```bash14npx mcp-server-terminal15```1617### Via GitHub Releases1819Download pre-built binaries from [Releases](https://github.com/aybelatchane/mcp-server-terminal/releases).2021### Build from Source2223```bash24git clone https://github.com/aybelatchane/mcp-server-terminal.git25cd mcp-server-terminal26cargo build --release27# Binary: ./target/release/terminal-mcp28```2930## Configuration3132### Claude3334#### Claude Code (CLI)3536```bash37claude mcp add terminal -- npx mcp-server-terminal38```3940#### Claude Desktop4142Add to `~/.claude.json` (macOS/Linux) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):4344```json45{46 "mcpServers": {47 "terminal": {48 "command": "npx",49 "args": ["mcp-server-terminal"]50 }51 }52}53```5455---5657### OpenAI Codex5859#### Codex CLI6061```bash62codex mcp add terminal -- npx mcp-server-terminal63```6465#### Codex Configuration File6667Add to `~/.codex/config.toml`:6869```toml70[mcp_servers.terminal]71command = "npx"72args = ["mcp-server-terminal"]73```7475---7677### Google Gemini7879#### Gemini CLI8081```bash82gemini mcp add terminal npx mcp-server-terminal83```8485---8687### VS Code / GitHub Copilot8889VS Code 1.101+ supports MCP. Add to your VS Code settings (`settings.json`):9091```json92{93 "mcp.servers": {94 "terminal": {95 "command": "npx",96 "args": ["mcp-server-terminal"]97 }98 }99}100```101102---103104### Cursor105106Add to `~/.cursor/mcp.json` or `.cursor/mcp.json` in your project:107108```json109{110 "mcpServers": {111 "terminal": {112 "command": "npx",113 "args": ["mcp-server-terminal"]114 }115 }116}117```118119---120121### Windsurf122123Add to `~/.codeium/windsurf/mcp_config.json`:124125```json126{127 "mcpServers": {128 "terminal": {129 "command": "npx",130 "args": ["mcp-server-terminal"]131 }132 }133}134```135136---137138### Zed139140Add to your Zed settings (Preferences → Settings):141142```json143{144 "context_servers": {145 "terminal": {146 "command": {147 "path": "npx",148 "args": ["mcp-server-terminal"]149 }150 }151 }152}153```154155---156157### Cline (VS Code Extension)158159Click MCP Servers icon → Configure → Advanced MCP Settings, then add:160161```json162{163 "mcpServers": {164 "terminal": {165 "command": "npx",166 "args": ["mcp-server-terminal"]167 }168 }169}170```171172---173174### AWS Bedrock175176Add to your Bedrock agent MCP configuration:177178```json179{180 "mcpServers": {181 "terminal": {182 "command": "npx",183 "args": ["mcp-server-terminal"]184 }185 }186}187```188189---190191### Other MCP Clients192193For any MCP-compatible client, configure the server with:194195- **Command**: `npx`196- **Args**: `["mcp-server-terminal"]`197198Or if using the binary directly:199200- **Command**: `terminal-mcp`201202## Usage203204Ask your AI agent:205206- *"Create a terminal session running htop"*207- *"Take a snapshot of the terminal"*208- *"Press the down arrow key"*209- *"Type 'ls -la' and press Enter"*210211## MCP Tools212213| Tool | Description |214|------|-------------|215| `terminal_session_create` | Start a terminal session |216| `terminal_session_list` | List active sessions |217| `terminal_session_close` | Close a session |218| `terminal_session_resize` | Resize terminal dimensions |219| `terminal_snapshot` | Capture terminal state with UI elements |220| `terminal_type` | Type text into terminal |221| `terminal_press_key` | Press keys (arrows, F-keys, Ctrl+X) |222| `terminal_click` | Click on detected UI element |223| `terminal_wait_for` | Wait for text, element, or idle state |224| `terminal_read_output` | Read raw terminal output |225226## Visual Mode227228By default, sessions spawn a visible terminal window (xterm). For headless operation:229230```bash231npx mcp-server-terminal --headless232```233234Or in your MCP config:235236```json237{238 "mcpServers": {239 "terminal": {240 "command": "npx",241 "args": ["mcp-server-terminal", "--headless"]242 }243 }244}245```246247### X11 Setup (Linux/WSL)248249Visual mode requires X11. Add the DISPLAY environment variable to your MCP config:250251```json252{253 "mcpServers": {254 "terminal": {255 "command": "npx",256 "args": ["mcp-server-terminal"],257 "env": {258 "DISPLAY": ":0"259 }260 }261 }262}263```264265## Logging266267Set the `RUST_LOG` environment variable:268269```json270{271 "mcpServers": {272 "terminal": {273 "command": "npx",274 "args": ["mcp-server-terminal"],275 "env": {276 "RUST_LOG": "info"277 }278 }279 }280}281```282283Log levels: `error`, `warn`, `info`, `debug`, `trace`284285Logs go to stderr (stdout is reserved for MCP protocol).286287## Platform Support288289| Platform | Architecture | Status | Visual Mode |290|----------|--------------|--------|-------------|291| Linux | x64, arm64 | ✅ Full support | xterm + tmux |292| macOS | x64, arm64 | ✅ Full support | Terminal.app / iTerm2 |293| Windows (WSL) | x64, arm64 | ✅ Full support | xterm + tmux (via X11) |294| Windows (native) | x64 | ⚠️ Headless only | Not supported |295296> **Windows users:** Use WSL for full functionality including visual mode.297298## License299300MIT301
Full transparency — inspect the skill content before installing.