SuperAPI AI Directory

mcp-server-terminal

Interact with TUI/CLI applications through a structured terminal state tree with element detection, like Playwright for terminals.

Open website

About this tool

Terminal MCP Server is a Model Context Protocol (MCP) server designed to enable AI agents to interact with TUI/CLI terminal applications. It represents terminal interfaces through a structured "Terminal State Tree" (TST) and has element detection capabilities, positioning itself as something like "Playwright for terminals." The server can be used with any AI assistant that supports the Model Context Protocol.

Main capabilities:

  • Represents terminal interfaces through a structured Terminal State Tree (TST), with support for element detection.
  • Enables AI agents to create terminal sessions, take snapshots of the terminal, send keystrokes (such as arrow keys), type commands and press Enter, and perform other operations.
  • Supports both visible terminal window (xterm) and headless operation modes.

Installation methods:

  • Install via npm (recommended).
  • Download precompiled binaries via GitHub Releases.
  • Build from source.

Usage (configure in various MCP clients):

  • Claude: Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
  • Codex: Add to ~/.codex/config.toml.
  • VS Code / GitHub Copilot: VS Code 1.101+ supports MCP; add to settings.json.
  • Cursor: Add to ~/.cursor/mcp.json or .cursor/mcp.json in the project.
  • Windsurf: Add to ~/.codeium/windsurf/mcp_config.json.
  • Zed: Add to Zed settings (Preferences → Settings).
  • Cline (VS Code extension): Click the MCP Servers icon → Configure → Advanced MCP Settings, then add the configuration.
  • Bedrock: Add to the Bedrock agent's MCP configuration.
  • Other MCP clients: Configure with Args: ["mcp-server-terminal"]; if using the binary directly, then Command: terminal-mcp.

Typical usage examples (issuing instructions to an 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"

Headless mode: By default, a session launches a visible terminal window (xterm). To run headless, configure the corresponding setting in the MCP configuration.

X11 setup (Linux/WSL): Visible mode requires X11. You need to add the DISPLAY environment variable in the MCP configuration.

Logging: The log level can be controlled by setting the RUST_LOG environment variable. Available levels include error, warn, info, debug, and trace. Logs are output to stderr (stdout is reserved for the MCP protocol).

Platform support: Windows users are advised to use WSL to get full functionality (including visible mode).

Limitations and notes:

  • Visible mode requires an X11 environment under Linux/WSL.
  • On Windows, WSL is required to use full functionality.
  • Information about fees, pricing, and specific performance results is not provided in the available materials.