developer-tools

Terminal Control

wehnsdaefflae

by wehnsdaefflae

Manage remote systems and debug apps with Terminal Control—use tmux, run tmux commands, and list sessions for total cont

Provides interactive terminal session management through tmux, enabling command execution, multiple shell sessions, and persistent terminal state for debugging applications, managing remote systems, and database administration.

github stars

9

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

Real-time web interface with live terminalComprehensive security with command filteringDual access for both agents and users

best for

  • / AI agents debugging applications interactively
  • / Remote system administration and monitoring
  • / Database administration through CLI tools
  • / Development workflows requiring persistent terminal state

capabilities

  • / Execute terminal commands through persistent tmux sessions
  • / Manage multiple shell sessions simultaneously
  • / Access interactive programs like debuggers and SSH clients
  • / View terminal output in different modes (screen, history, tail)
  • / Control sessions via web browser interface
  • / Monitor and cleanup long-running processes

what it does

Provides AI agents with secure terminal access through persistent tmux sessions. Includes real-time web interface for direct user interaction alongside agent control.

about

Terminal Control is a community-built MCP server published by wehnsdaefflae that provides AI assistants with tools and capabilities via the Model Context Protocol. Manage remote systems and debug apps with Terminal Control—use tmux, run tmux commands, and list sessions for total cont It is categorized under developer tools.

how to install

You can install Terminal Control in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

license

MIT

Terminal Control is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

Terminal Control MCP Server

A modern MCP server that enables AI agents to control terminal sessions through persistent tmux-based sessions. Features real-time web interface for direct user access, comprehensive security controls, and support for interactive terminal programs including debuggers, SSH connections, and database clients.

✨ Features

🖥️ Tmux-Based Terminal Control

  • Reliable Backend: Built on tmux and libtmux for stable terminal multiplexing
  • Session Persistence: Long-running sessions with automatic cleanup and monitoring
  • Raw Stream Capture: Direct terminal output via tmux pipe-pane
  • Agent-Controlled: AI agents manage timing and interaction flow without automatic timeouts
  • Flexible Content Modes: Get screen, history, since-input, or tail output for optimal workflow control
  • Dual Access: Both agent (MCP tools) and user (web browser) can interact simultaneously

🌐 Optional Web Interface

  • Real-time Terminal: Live xterm.js terminal emulator with WebSocket updates
  • Session URLs: Direct browser access to any terminal session
  • Zero Setup: Automatic web server startup with configurable networking
  • Manual Control: Send commands directly without interrupting agent workflows
  • Session Management: View all active sessions and their status

🛡️ Comprehensive Security

  • Command Filtering: Block dangerous operations (rm -rf /, sudo, disk formatting, etc.)
  • Path Protection: Restrict access to user directories only
  • Rate Limiting: 60 calls/minute with session limits (max 50 concurrent)
  • History Isolation: Prevent terminal sessions from polluting system history
  • Audit Logging: Complete security event tracking
  • Input Validation: Multi-layer validation for all inputs
  • Configurable Levels: Off, low, medium, high protection levels

🚀 Quick Start

System Requirements

This package requires tmux for terminal multiplexing:

# Ubuntu/Debian
sudo apt update && sudo apt install -y tmux

# macOS
brew install tmux

# CentOS/RHEL/Fedora
sudo yum install tmux  # or sudo dnf install tmux

Python Requirements: Python 3.9 or later

Installation

From PyPI (Recommended)

# Install directly from PyPI
pip install terminal-control-mcp

From Source

# Clone the repository
git clone https://github.com/wehnsdaefflae/terminal-control-mcp.git
cd terminal-control-mcp

# Create virtual environment (choose one)
python -m venv .venv          # Using standard venv
# OR
uv venv                       # Using uv (faster)

# Activate virtual environment
source .venv/bin/activate     # Linux/macOS
# .venv\Scripts\activate      # Windows

# Install the package
pip install .

# Or install in development mode
pip install -e ".[dev]"

Configuration

The server supports configuration through TOML files and environment variables:

Claude Code (Anthropic)

# Add the MCP server
claude mcp add terminal-control -s user terminal-control-mcp

# Verify installation
claude mcp list

The MCP server will be automatically launched by Claude Code when needed.

Other MCP Clients

For other MCP clients, add to your configuration:

{
  "mcpServers": {
    "terminal-control": {
      "command": "terminal-control-mcp",
      "cwd": "/path/to/working/directory"
    }
  }
}

🔧 Configuration

The server uses TOML configuration files with optional environment variable overrides. Environment variables can override any TOML setting for deployment flexibility.

Configuration File Locations

The server looks for configuration files in this order:

  1. ./terminal-control.toml (current working directory)
  2. ~/.config/terminal-control.toml (user configuration directory)
  3. /etc/terminal-control.toml (system-wide configuration)
  4. Built-in defaults (if no config file found)

Configuration Sections

[web] - Web Interface Settings

[web]
enabled = false         # Enable web interface (default: false)
host = "0.0.0.0"       # Bind address (default: "0.0.0.0")
port = 8080            # Port number (default: 8080)
auto_port = true       # Automatic unique port selection (default: true)
external_host = ""     # External hostname for URLs (optional)

Web Interface Modes:

  • Enabled: Real-time web interface with xterm.js terminal emulator
  • Disabled: Automatically opens system terminal windows attached to tmux sessions

Auto Port Selection: When auto_port=true, ports are automatically selected in the 9000-9999 range using hash(working_dir + process_id) % 1000 + 9000 to avoid conflicts between multiple instances.

[security] - Security Settings

[security]
level = "high"              # Security level: off, low, medium, high
max_calls_per_minute = 60   # Rate limiting (calls per minute)
max_sessions = 50           # Maximum concurrent sessions

Security Levels:

  • off: No validation (⚠️ USE WITH EXTREME CAUTION)
  • low: Basic input validation only
  • medium: Standard protection (blocks common dangerous commands)
  • high: Full protection (comprehensive validation and filtering)

[session] - Session Management

[session]
default_shell = "bash"                      # Default shell for new sessions
timeout = 30                                # Session startup timeout (seconds)
isolate_history = true                      # Prevent sessions from polluting system history
history_file_prefix = "mcp_session_history" # Prefix for isolated history files

History Isolation Features:

  • Automatic Isolation: Each session gets isolated history files in temporary directories
  • Multi-Shell Support: Supports bash, zsh, fish, csh, tcsh, Python REPL, Node.js, PostgreSQL, MySQL
  • Session-Specific Files: History files are prefixed with session IDs for complete isolation
  • Automatic Cleanup: All history files are automatically deleted when sessions terminate
  • Configurable: Can be disabled via isolate_history = false if system history is preferred

Supported Applications:

  • Bash: HISTFILE, HISTCONTROL, HISTSIZE, HISTFILESIZE
  • Zsh: HISTFILE, ZDOTDIR, SAVEHIST, HISTSIZE
  • Fish: XDG_CONFIG_HOME, XDG_DATA_HOME
  • Python: PYTHONSTARTUP with readline configuration
  • Node.js: NODE_REPL_HISTORY
  • PostgreSQL: PSQL_HISTORY
  • MySQL: MYSQL_HISTFILE

[terminal] - Terminal Settings

[terminal]
width = 120                      # Terminal width (columns)
height = 30                      # Terminal height (rows)
close_timeout = 5.0              # Terminal close timeout (seconds)
process_check_timeout = 1.0      # Process health check timeout (seconds)
polling_interval = 0.05          # Output polling interval (seconds)
send_input_delay = 0.1           # Delay after sending input (seconds)

Terminal Emulator Support: The system automatically detects available terminal emulators in order of preference:

  • GNOME/GTK: gnome-terminal
  • KDE: konsole
  • XFCE: xfce4-terminal
  • Elementary OS: io.elementary.terminal
  • Generic: x-terminal-emulator, xterm
  • macOS: Terminal (via open -a Terminal)
  • Modern terminals: alacritty, kitty, terminator

Custom Terminal Emulator Configuration:

[terminal]
# Custom terminal emulator preferences (ordered by preference)
emulators = [
    { name = "my-terminal", command = ["my-terminal", "--exec"] },
    { name = "gnome-terminal", command = ["gnome-terminal", "--"] },
    { name = "konsole", command = ["konsole", "-e"] },
]

[logging] - Logging Configuration

[logging]
level = "INFO"    # Log level: DEBUG, INFO, WARNING, ERROR

Complete Configuration Example

Create terminal-control.toml in your project root:

[web]
enabled = false         # Use terminal windows instead of web interface
host = "0.0.0.0"
port = 8080
auto_port = true        # Automatic unique port selection

[security]
level = "high"
max_calls_per_minute = 60
max_sessions = 50

[session]
default_shell = "bash"
timeout = 30

[terminal]
width = 120
height = 30
close_timeout = 5.0
process_check_timeout = 1.0
polling_interval = 0.05
send_input_delay = 0.1

[logging]
level = "INFO"

🛠️ MCP Tools (6 Tools)

The server provides 6 MCP tools for complete terminal session lifecycle management:

Session Management

list_terminal_sessions

List all active terminal sessions with status information.

Returns:

  • Session IDs, commands, and states
  • Creation timestamps and last activity
  • Total session count (max 50)
  • Web interface URLs (if enabled)

exit_terminal

Terminate and cleanup a terminal session.

Parameters:

  • session_id: Session ID to destroy

Features:

  • Bidirectional cleanup: Sessions destroyed when agents call exit_terminal OR when users type exit
  • Automatic monitoring: Dead sessions detected and cleaned up every 5 seconds
  • Terminal window management: Closes associated terminal windows when web interface is disabled

Content Retrieval

get_screen_content

Get terminal content with precise control over output format.

Parameters:

  • session_id: Session to get content from
  • content_mode: Content retrieval mode
    • "screen" (default): Current visible screen only
    • "since_input": Output since last input command
    • "history": Full terminal history
    • "tail": Last N lines (requires line_count)
  • line_count: Number of lines for tail mode

Returns:

  • Terminal content based on mode
  • Process running status
  • ISO timestamp for agent timing decisions

Input Control

send_input

Send input to terminal sessions.

Parameters:

  • session_id: Target session
  • input_text: Text to send (supports escape sequences)

Important: Newlines are NOT automatically added.


FAQ

What is the Terminal Control MCP server?
Terminal Control is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for Terminal Control?
This profile displays 28 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.

Use Cases

Extended AI Capabilities

Add new capabilities to Claude beyond text generation

Example

Access external data sources, execute code, interact with tools and services

Transform Claude from chatbot to action-taking agent

Context Enhancement

Provide Claude with access to relevant context and data

Example

Load project documentation, access knowledge bases, query databases

Get more accurate, context-aware responses

Workflow Automation

Automate multi-step workflows combining AI and external tools

Example

Research → Summarize → Create document → Send notification

Complete complex tasks end-to-end without manual steps

Implementation Guide

Prerequisites

  • Claude Desktop 0.7.0+ or Cursor IDE with MCP support
  • Basic understanding of MCP architecture and capabilities
  • Access credentials for integrated services (if required)
  • Willingness to experiment and iterate on configuration

Time Estimate

15-60 minutes depending on server complexity

Installation Steps

  1. 1.Install MCP server: npm install -g [package-name] or via GitHub
  2. 2.Add server configuration to ~/.claude/mcp.json
  3. 3.Provide required credentials and configuration
  4. 4.Restart Claude Desktop to load new server
  5. 5.Test basic functionality with simple prompts
  6. 6.Explore capabilities and experiment with use cases
  7. 7.Document successful patterns for reuse

Troubleshooting

  • MCP server not loading: Check config syntax, verify installation
  • Connection errors: Check network, firewall, credentials
  • Feature not working: Read server docs, check required parameters
  • Performance issues: Monitor resource usage, check for network latency
  • Conflicts with other servers: Check port assignments, namespace collisions

Best Practices

✓ Do

  • +Read server documentation thoroughly before setup
  • +Start with simple use cases to validate functionality
  • +Test in non-production environment first
  • +Monitor resource usage and performance
  • +Keep servers updated for bug fixes and new features
  • +Document configuration for team members
  • +Use environment variables for sensitive configuration

✗ Don't

  • Don't grant overly permissive access to MCP servers
  • Don't skip reading security considerations in docs
  • Don't expose sensitive data without proper controls
  • Don't run untrusted MCP servers without code review
  • Don't ignore error messages—investigate root cause

💡 Pro Tips

  • Combine multiple MCP servers for powerful workflows
  • Create custom MCP servers for your specific needs
  • Share successful configurations with team
  • Use MCP inspector for debugging
  • Join MCP community for tips and troubleshooting

Technical Details

Architecture

Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.

Protocols

  • Model Context Protocol (MCP)
  • JSON-RPC 2.0
  • stdio or HTTP transport

Compatibility

  • Claude Desktop
  • Cursor IDE
  • Custom MCP clients

When to Use This

✓ Use When

Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.

✗ Avoid When

Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.

Integration

  • Tool composition: Chain multiple MCP tools in workflows
  • Context augmentation: Provide AI with relevant external data
  • Action delegation: Let AI execute tasks on external systems
  • Bidirectional sync: Keep AI context and external systems in sync

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.628 reviews
  • Aanya Ndlovu· Dec 20, 2024

    Terminal Control has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Ganesh Mohane· Dec 12, 2024

    I recommend Terminal Control for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Xiao Sethi· Dec 8, 2024

    Terminal Control is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Min Bansal· Nov 27, 2024

    I recommend Terminal Control for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Rahul Santra· Nov 3, 2024

    Terminal Control is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Pratham Ware· Oct 22, 2024

    Terminal Control has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Min Gill· Oct 18, 2024

    According to our notes, Terminal Control benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

  • Henry Singh· Sep 25, 2024

    Useful MCP listing: Terminal Control is the kind of server we cite when onboarding engineers to host + tool permissions.

  • Piyush G· Sep 1, 2024

    Terminal Control reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Shikha Mishra· Aug 20, 2024

    Terminal Control is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.

showing 1-10 of 28

1 / 3