Terminal MCP Server MCP Server
io.github.aybelatchane/mcp-server-terminal
MCP server for AI agents to interact with terminal applications through structured state representation.
What is the Terminal MCP Server MCP server?
The Terminal MCP Server enables AI agents to interact with terminal applications through a Terminal State Tree representation, similar to Playwright for terminals. It provides tools for creating sessions, capturing terminal state, typing commands, pressing keys, and waiting for specific outputs across multiple platforms including Linux, macOS, and Windows (via WSL).
This server allows AI assistants to automate terminal interactions by providing structured access to terminal state and UI elements. You can use it to run commands, monitor output, interact with terminal applications like htop, and automate complex terminal workflows—useful for DevOps automation, system administration, testing, and interactive CLI tool control.
How to install Terminal MCP Server
Copy-paste configuration for popular MCP clients.
DISPLAYX11 display for visual mode (Linux/WSL). Example: :0
RUST_LOGLogging level: error, warn, info, debug, trace
Tools & capabilities
Tools this server exposes to the agent.
terminal_session_create— Start a terminal sessionterminal_session_list— List active sessionsterminal_session_close— Close a sessionterminal_session_resize— Resize terminal dimensionsterminal_snapshot— Capture terminal state with UI elementsterminal_type— Type text into terminalterminal_press_key— Press keys (arrows, F-keys, Ctrl+X)terminal_click— Click on detected UI elementterminal_wait_for— Wait for text, element, or idle stateterminal_read_output— Read raw terminal output
Use cases
- Automate interactive CLI tools and terminal applications like htop, vim, or tmux
- Run shell commands and capture output for analysis or validation
- Test command-line interfaces and scripts by simulating user interactions
- Monitor system processes and logs in real-time through terminal automation
- Control terminal-based workflows and multi-step administrative tasks
Terminal MCP Server MCP server FAQ
It's an MCP server that lets AI agents interact with terminal applications through structured state representation, similar to how Playwright works for web browsers. It provides tools to create sessions, run commands, capture terminal state, and interact with UI elements.
Yes, the Terminal MCP Server is open-source and licensed under MIT.
Add to `~/.cursor/mcp.json` or `.cursor/mcp.json` in your project: {"mcpServers": {"terminal": {"command": "npx", "args": ["mcp-server-terminal"]}}}
For Claude Desktop, add to `~/.claude.json` (macOS/Linux) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows): {"mcpServers": {"terminal": {"command": "npx", "args": ["mcp-server-terminal"]}}}
No, the Terminal MCP Server does not require any authentication. It runs locally and interacts with your system's terminal.
Full support on Linux (x64, arm64) and macOS (x64, arm64). Windows users can use WSL for full functionality including visual mode; native Windows supports headless mode only.
README (reference)
Source of truth, from the repository.
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)
npx mcp-server-terminal
Via GitHub Releases
Download pre-built binaries from Releases.
Build from Source
git clone https://github.com/aybelatchane/mcp-server-terminal.git
cd mcp-server-terminal
cargo build --release
# Binary: ./target/release/terminal-mcp
Configuration
Claude
Claude Code (CLI)
claude mcp add terminal -- npx mcp-server-terminal
Claude Desktop
Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
OpenAI Codex
Codex CLI
codex mcp add terminal -- npx mcp-server-terminal
Codex Configuration File
Add to ~/.codex/config.toml:
[mcp_servers.terminal]
command = "npx"
args = ["mcp-server-terminal"]
Google Gemini
Gemini CLI
gemini mcp add terminal npx mcp-server-terminal
VS Code / GitHub Copilot
VS Code 1.101+ supports MCP. Add to your VS Code settings (settings.json):
{
"mcp.servers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Cursor
Add to ~/.cursor/mcp.json or .cursor/mcp.json in your project:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Zed
Add to your Zed settings (Preferences → Settings):
{
"context_servers": {
"terminal": {
"command": {
"path": "npx",
"args": ["mcp-server-terminal"]
}
}
}
}
Cline (VS Code Extension)
Click MCP Servers icon → Configure → Advanced MCP Settings, then add:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
AWS Bedrock
Add to your Bedrock agent MCP configuration:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"]
}
}
}
Other MCP Clients
For any MCP-compatible client, configure the server with:
- Command:
npx - Args:
["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 |
|---|---|
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 |
Visual Mode
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"]
}
}
}
X11 Setup (Linux/WSL)
Visual mode requires X11. Add the DISPLAY environment variable to your MCP config:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["mcp-server-terminal"],
"env": {
"DISPLAY": ":0"
}
}
}
}
Logging
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 Support
| 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.
License
MIT
Related MCP servers
AI-native mock API server with MCP. Create REST/SOAP mocks from Claude, Cursor, or Windsurf.

Türk Hukuku İçtihat
Türk yargı kararlarını (Yargıtay, Danıştay, AYM) resmî kaynaklardan yapay zekâya açan MCP sunucusu.

Türk Hukuku Mevzuat
Türk mevzuatının resmî güncel metnini (mevzuat.gov.tr) yapay zekâya açan MCP sunucusu.

Python Docs MCP Server
The canonical Python stdlib oracle for AI coding agents — always free, always MIT, token-frugal.
GrowthHackers copywriting prompts (Meta/Google Ads, email, VSL) as MCP tools — search & generate.
View repository →
io.github.ayo-nci/bulkrender
Generate DOCX and PDF documents from AI assistants using BulkRender templates.
