Tmux MCP Server

by tntisdial

Not rated
GitHub

About

Provides persistent shell execution through tmux sessions.

Details

Author
tntisdial
Categories
Developer Tools, Other, Infrastructure

Setup

Install Tmux MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/tntisdial/persistent-shell-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

Provides persistent shell execution through tmux sessions.

This is experimental software intended for testing and development purposes only. Do not use in production environments or with sensitive data.

A Model Context Protocol (MCP) server that provides persistent shell execution through tmux sessions. This server enables AI assistants to execute commands in a persistent shell. This unlocks a lot of possiblities, such as Agent Orchestration...

- Dual-Window Architecture: Each workspace has two windows -execfor command execution anduifor clean output display
- Persistent Workspaces: Execute commands in tmux sessions that persist across MCP client restarts
- Interactive Process Support: Handle long-running processes, REPLs, and interactive commands
- Workspace Isolation: Multiple isolated workspaces for different projects or tasks
- Clean UI Management: Separate windows for execution and user-facing output
- Automatic Session Management: Create, destroy, and monitor workspaces seamlessly

🚨 SECURITY WARNING: This software allows AI assistants to execute arbitrary shell commands on your system. Only install and use in isolated testing environments. Never use on systems with sensitive data or in production environments.

- Node.js 18.0.0 or higher
- tmux installed on your system

- Ubuntu/Debian:sudo apt install tmux
- macOS:brew install tmux
- CentOS/RHEL:sudo yum install tmux

git clone https://github.com/TNTisdial/persistent-shell-mcp.git cd persistent-shell-mcp npm install npm link
{ "mcpServers": { "tmux-shell": { "command": "tmux-mcp-server" } } }

Execute commands that complete quickly and return full output. Uses theexecwindow.

execute_command({ command: "ls -la", workspace_id: "my-project" })

Start long-running or interactive processes. Can target either window:

- execwindow (default): For background processes
- uiwindow: For interactive applications that need user visibility

start_process({ command: "python3", workspace_id: "dev", target_window: "ui" // For interactive apps like vim, python REPL })

Capture current terminal output from either window:

- uiwindow (default): Clean user-facing output
- execwindow: Raw shell with all commands

get_output({ workspace_id: "dev", window_name: "ui" // or "exec" for raw output })

Send input to running processes in either window.

send_input({ text: "print('Hello World')", workspace_id: "dev", target_window: "ui" })

Stop the currently running process in the exec window (sends Ctrl+C).

stop_process({workspace_id: "dev"})

Create a new isolated workspace with dual windows.

Destroy a workspace and all its processes.

Each workspace consists of two tmux windows:
-

execwindow: Raw shell for command execution

- Handles all command execution
- Shows full shell history and prompts
- Used for background processes

- Shows clean output for user interaction
- Used for interactive applications
- Provides better user experience

- Each workspace is a separate tmux session
- Independent working directories and environments
- Processes don't interfere between workspaces
- Clean separation of different projects/tasks

// Execute and get results immediately execute_command({command: "npm install", workspace_id: "frontend"}) execute_command({command: "git status", workspace_id: "frontend"})
// Start Python REPL in UI window start_process({ command: "python3", workspace_id: "python-dev", target_window: "ui" }) // Send Python commands send_input({text: "import os", workspace_id: "python-dev", target_window: "ui"}) send_input({text: "print(os.getcwd())", workspace_id: "python-dev", target_window: "ui"}) // Check output get_output({workspace_id: "python-dev", window_name: "ui"})
// Start server in background start_process({command: "npm run dev", workspace_id: "server"}) // Check server status get_output({workspace_id: "server", window_name: "exec"}) // Stop server when done stop_process({workspace_id: "server"})
// Frontend workspace create_workspace({workspace_id: "frontend"}) execute_command({command: "cd /path/to/frontend", workspace_id: "frontend"}) // Backend workspace create_workspace({workspace_id: "backend"}) execute_command({command: "cd /path/to/backend", workspace_id: "backend"}) // Database workspace create_workspace({workspace_id: "database"}) start_process({command: "mysql -u root -p", workspace_id: "database", target_window: "ui"})
tmux-mcp/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ server.js # Main MCP server and tool definitions β”‚ β”œβ”€β”€ tmux-manager.js # Tmux session and window management β”‚ └── index.js # Entry point β”œβ”€β”€ bin/ β”‚ └── tmux-mcp-server # Executable script β”œβ”€β”€ package.json └── README.md

Install tmux:sudo apt install tmux(Ubuntu/Debian) orbrew install tmux(macOS)

Check if tmux server is running and you have permissions to create sessions

Useget_outputwithwindow_name: "exec"to see raw shell state

Send interrupt signal withstop_processto terminate hanging processes

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Execute shell commands without permission prompts.

Execute bash commands on the host machine.

Execute shell commands with structured output via a powerful CLI server.

A secure MCP server for executing controlled command-line operations with comprehensive security features.

MCP server for controlling cmux (Ghostty-based terminal) via native CLI. Send commands, read output, send control characters β€” all in background via Unix socket.

Execute pre-approved shell commands securely on a server.

A secure MCP server for executing terminal commands with controlled directory access and command permissions.

A shell command / terminal executor with async support

A high-performance MCP server for the headless terminal (ht), implemented in Rust.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.