Terminal MCP Server
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.
Installation
Via npm (Recommended)
Via GitHub Releases
Download pre-built binaries from Releases.
Build from Source
Configuration
Claude
Claude Code (CLI)
Claude Desktop
Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
OpenAI Codex
Codex CLI
Codex Configuration File
Add to ~/.codex/config.toml:
Google Gemini
Gemini CLI
VS Code / GitHub Copilot
VS Code 1.101+ supports MCP. Add to your VS Code settings (settings.json):
Cursor
Add to ~/.cursor/mcp.json or .cursor/mcp.json in your project:
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Zed
Add to your Zed settings (Preferences → Settings):
Cline (VS Code Extension)
Click MCP Servers icon → Configure → Advanced MCP Settings, then add:
AWS Bedrock
Add to your Bedrock agent MCP configuration:
Other MCP Clients
For any MCP-compatible client, configure the server with:
Command:
npxArgs:
["mcp-server-terminal"]
Or if using the binary directly:
Command:
terminal-mcp
Usage
Ask your AI agent:
"Create a terminal session running htop"
"Take a snapshot of the terminal"
"Press the down arrow key"
"Type 'ls -la' and press Enter"
MCP Tools
Tool | Description |
| Start a terminal session |
| List active sessions |
| Close a session |
| Resize terminal dimensions |
| Capture terminal state with UI elements |
| Type text into terminal |
| Press keys (arrows, F-keys, Ctrl+X) |
| Click on detected UI element |
| Wait for text, element, or idle state |
| Read raw terminal output |
Visual Mode
By default, sessions spawn a visible terminal window (xterm). For headless operation:
Or in your MCP config:
X11 Setup (Linux/WSL)
Visual mode requires X11. Add the DISPLAY environment variable to your MCP config:
Logging
Set the RUST_LOG environment variable:
Log levels: error, warn, info, debug, trace
Logs go to stderr (stdout is reserved for MCP protocol).
Platform Support
Platform | Architecture | Status |
Linux | x64, arm64 | Supported |
macOS | x64, arm64 | Supported |
Windows | WSL | Supported |
License
MIT