Terminal MCP Server

Registre officiel Recherche et web

MCP server for AI agents to interact with terminal applications. Think Playwright for terminals.

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package mcp-server-terminal
Claude Code
claude mcp add terminal-mcp-server -e 'DISPLAY=<DISPLAY>' -e 'RUST_LOG=info' -- npx -y mcp-server-terminal@1.0.3 --headless
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "terminal-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-server-terminal@1.0.3",
                "--headless"
            ],
            "env": {
                "DISPLAY": "<DISPLAY>",
                "RUST_LOG": "info"
            }
        }
    }
}

Variables d'environnement

  • DISPLAY X11 display for visual mode (Linux/WSL). Example: :0
  • RUST_LOG Logging level: error, warn, info, debug, trace

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. Terminal MCP Server
  2. Installation
  3. Configuration
  4. Usage
  5. MCP Tools
  6. Visual Mode
  7. Logging
  8. Platform Support
  9. License

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

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

Questions fréquentes

Qu'est-ce que Terminal MCP Server ?

MCP server for AI agents to interact with terminal applications. Think Playwright for terminals.

Comment installer Terminal MCP Server ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add terminal-mcp-server -e 'DISPLAY=<DISPLAY>' -e 'RUST_LOG=info' -- npx -y mcp-server-terminal@1.0.3 --headless. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Terminal MCP Server ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

Terminal MCP Server est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Terminal MCP Server ?

Il est publié par aybelatchane. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.