PluginBench
MCP Server
Maintained
MIT

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.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • DISPLAY

    X11 display for visual mode (Linux/WSL). Example: :0

  • RUST_LOG

    Logging level: error, warn, info, debug, trace

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-terminal",
        "--headless"
      ],
      "env": {
        "DISPLAY": "<YOUR_DISPLAY>",
        "RUST_LOG": "<YOUR_RUST_LOG>"
      }
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • 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

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

What is the Terminal MCP Server?

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.

Is it free?

Yes, the Terminal MCP Server is open-source and licensed under MIT.

How do I install it in Cursor?

Add to `~/.cursor/mcp.json` or `.cursor/mcp.json` in your project: {"mcpServers": {"terminal": {"command": "npx", "args": ["mcp-server-terminal"]}}}

How do I install it in Claude?

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"]}}}

Does it require authentication?

No, the Terminal MCP Server does not require any authentication. It runs locally and interacts with your system's terminal.

What platforms are supported?

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

npm version npm downloads License: MIT

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

ToolDescription
terminal_session_createStart a terminal session
terminal_session_listList active sessions
terminal_session_closeClose a session
terminal_session_resizeResize terminal dimensions
terminal_snapshotCapture terminal state with UI elements
terminal_typeType text into terminal
terminal_press_keyPress keys (arrows, F-keys, Ctrl+X)
terminal_clickClick on detected UI element
terminal_wait_forWait for text, element, or idle state
terminal_read_outputRead 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

PlatformArchitectureStatusVisual Mode
Linuxx64, arm64✅ Full supportxterm + tmux
macOSx64, arm64✅ Full supportTerminal.app / iTerm2
Windows (WSL)x64, arm64✅ Full supportxterm + tmux (via X11)
Windows (native)x64⚠️ Headless onlyNot 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 yargı kararlarını (Yargıtay, Danıştay, AYM) resmî kaynaklardan yapay zekâya açan MCP sunucusu.

2
Python
MIT
View repository →

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

0
Python
MIT
View repository →

The canonical Python stdlib oracle for AI coding agents — always free, always MIT, token-frugal.

4
Python
MIT
View repository →

GrowthHackers copywriting prompts (Meta/Google Ads, email, VSL) as MCP tools — search & generate.

View repository →

Generate DOCX and PDF documents from AI assistants using BulkRender templates.

0
JavaScript
View repository →