Provides tools for persistent shell execution through tmux sessions, enabling command execution, process monitoring, and workspace management with dual-window architecture for separate execution and UI display.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Persistent Shell MCPstart the dev server in a persistent workspace called 'backend'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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...
Features
Dual-Window Architecture: Each workspace has two windows -
execfor command execution anduifor clean output displayPersistent 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
Installation
šØ 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.
Prerequisites
Node.js 18.0.0 or higher
tmux installed on your system
Ubuntu/Debian:
sudo apt install tmuxmacOS:
brew install tmuxCentOS/RHEL:
sudo yum install tmux
Install from npm
Install from source
Usage
MCP Client Configuration
Add to your MCP client configuration:
Available Tools
Core Execution Tools
execute_command
Execute commands that complete quickly and return full output. Uses the exec window.
start_process
Start long-running or interactive processes. Can target either window:
execwindow (default): For background processesuiwindow: For interactive applications that need user visibility
get_output
Capture current terminal output from either window:
uiwindow (default): Clean user-facing outputexecwindow: Raw shell with all commands
send_input
Send input to running processes in either window.
stop_process
Stop the currently running process in the exec window (sends Ctrl+C).
Workspace Management Tools
create_workspace
Create a new isolated workspace with dual windows.
destroy_workspace
Destroy a workspace and all its processes.
list_workspaces
List all active workspaces.
Architecture
Dual-Window Design
Each workspace consists of two tmux windows:
exec: Raw shell for command executionHandles all command execution
Shows full shell history and prompts
Used for background processes
ui: Clean output displayShows clean output for user interaction
Used for interactive applications
Provides better user experience
Workspace Isolation
Each workspace is a separate tmux session
Independent working directories and environments
Processes don't interfere between workspaces
Clean separation of different projects/tasks
Common Workflows
Quick Command Execution
Interactive Development
Background Process Management
Multi-Project Development
Project Structure
Troubleshooting
Tmux Not Found
Install tmux: sudo apt install tmux (Ubuntu/Debian) or brew install tmux (macOS)
Workspace Creation Failed
Check if tmux server is running and you have permissions to create sessions
Commands Not Responding
Use get_output with window_name: "exec" to see raw shell state
Process Stuck
Send interrupt signal with stop_process to terminate hanging processes
License
MIT