mcp-server-terminal
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.
README
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 |
|---|---|---|
| Linux | x64, arm64 | Supported |
| macOS | x64, arm64 | Supported |
| Windows | WSL | Supported |
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.