Provides programmatic control over tmux terminal sessions, enabling creation and management of sessions, sending commands, capturing pane output, splitting windows, and managing panes for terminal automation and SSH access.
Tmux MCP Server
An MCP (Model Context Protocol) server that provides programmatic control over tmux terminal sessions. Enables Claude (or other MCP clients) to create, manage, and interact with tmux sessions for SSH access, command execution, and terminal automation.
Features
Create and manage tmux sessions
Send commands to sessions
Capture pane output
Split windows and manage panes
Full control over terminal sessions via MCP tools
Installation
Prerequisites
Node.js (v16 or higher)
tmux installed on your system
For Windows: WSL2 with tmux installed
Setup
Clone or download this repository
Install dependencies:
Make the server executable:
Configuration
Add the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
For WSL2 on Windows, you can use wsl to run the server:
Restart Claude Desktop after updating the configuration.
Available Tools
tmux_create_session
Create a new tmux session.
session_name(optional): Name for the sessionstart_directory(optional): Starting directory
tmux_list_sessions
List all active tmux sessions with details.
tmux_send_keys
Send keys/commands to a session.
session_name(required): Target session namekeys(required): Keys or command to sendliteral(optional): If true, don't append Enter
tmux_capture_pane
Capture the visible content of a pane.
session_name(required): Target session namepane_index(optional): Pane index (default: "0")lines(optional): Number of lines from scrollback (-1 for all)
tmux_kill_session
Terminate a tmux session.
session_name(required): Session to kill
tmux_split_window
Split a window to create a new pane.
session_name(required): Target session namevertical(optional): If true, split vertically (side by side)
tmux_select_pane
Select a specific pane in a session.
session_name(required): Target session namepane_index(required): Pane index to select
tmux_list_panes
List all panes in a session with details.
session_name(required): Target session name
Usage Examples
SSH to a CML Console Server
Monitor Multiple Devices
Use Cases
CML Device Access: SSH to CML console servers and access node consoles
Configuration Management: Send commands to network devices and capture output
Troubleshooting: Interactive debugging of network issues
Automation: Script complex terminal workflows
Testing: Automated testing of CLI applications
Monitoring: Watch multiple terminal sessions simultaneously
Troubleshooting
Sessions not appearing
Ensure tmux is installed and accessible in your PATH:
WSL2 connectivity issues
Make sure you can run tmux from WSL2:
Command not executing
Check if the session exists:
License
MIT
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables programmatic control over tmux terminal sessions for SSH access, command execution, and terminal automation. Supports creating sessions, sending commands, capturing output, and managing multiple panes for interactive debugging and monitoring.