claude-sessions-mcp
Allows management of tmux sessions, including creating, monitoring, and controlling long-running jobs. Provides tools to list sessions, capture pane output, send keystrokes, and kill sessions.
Claude tmux Sessions
Lets Claude Desktop on Linux start, monitor, and control long-running jobs inside tmux sessions. Designed for ML training, data pipelines, and anything else you want to survive beyond a single conversation.
Claude can start a detached training run, check on it an hour later by capturing the last N lines of its pane, send keystrokes (including Ctrl+C), and kill the session when done. You can tmux attach -t <name> from any real terminal to watch the same session live — Claude and a human can observe simultaneously.
Requirements
Linux with
tmuxinstalled:sudo apt install tmuxWorks with the default per-user tmux server (no shared-server setup needed).
Related MCP server: Tmux MCP Server
Install (Claude Desktop)
Download the latest
Sessions.mcpbfrom the Releases page.In Claude Desktop: Settings → Extensions → Extension Developer → Install Extension → pick the
.mcpb.Enable the extension.
Tools
Tool | Annotation | What it does |
| read-only | All tmux sessions with name, windows, created/activity timestamps, attached flag |
| read-only | Exact-match check for a session name |
| read-only | Windows within a session (index, name, active, pane count) |
| read-only | Last N lines of the session's active pane (default 100, max 10000) |
| destructive | Start a detached session; optionally run an initial shell command |
| destructive | Send key combos or text to the active pane (Enter appended by default) |
| destructive | Terminate a session (sends SIGHUP to all processes inside) |
Example workflows
Start a training run:
"Start training run
b8-c1: activate myrdna4-trainvenv and run train.py."
new_session name=b8-c1 command="source ~/.venvs/rdna4-train/bin/activate && python /media/luke/Storage\ Device\ 1/NeuroForge/train.py b8-c1"
Check on it later:
"Is training
b8-c1still going? Show me the last 50 lines."
capture_pane name=b8-c1 lines=50
Interrupt a hung run:
"The training is stuck — send Ctrl+C."
send_keys name=b8-c1 keys="C-c" enter=false
Wrap up:
"Kill the session."
kill_session name=b8-c1
Key notation
send_keys accepts either literal text (sent as keystrokes) or tmux key names. Common ones:
Keys | Effect |
| Ctrl+C (interrupt) |
| Ctrl+D (EOF / logout) |
| Escape key |
| Arrow keys |
| Enter (also appended automatically when |
| Space |
Pass enter: false when sending raw combos so you don't get an extra Enter after.
Privacy policy
This extension runs entirely on your local machine and shells out only to the tmux binary. No data leaves your machine. No network I/O. No sockets. No files written outside of tmux's own per-user server socket (default /tmp/tmux-$UID/default).
The information visible to Claude includes session names, pane contents (the text you or your programs have printed), and session metadata (created/activity timestamps, window/pane counts). send_keys and kill_session can affect any process running inside a managed session, so treat it with the same trust level you'd give to a user typing into your terminal.
Troubleshooting
"tmux is not installed" — run sudo apt install tmux.
"can't find pane" errors — generally means the named session was killed mid-operation. Call has_session first, or use list_sessions to see what's actually running.
Session name restrictions — names cannot contain ., :, |, or whitespace. The . and : are tmux target separators; | is this server's field delimiter; whitespace is rejected on principle.
Session doesn't survive my initial command — by design, new_session always starts a shell; the command argument is sent as keystrokes into that shell. That's what keeps the session alive after the command finishes. If you passed command directly to tmux new-session it would exit when the command did.
Development
Single ~300-line Node.js script, zero npm dependencies. Rebuild the .mcpb:
cd bundle-source
zip -j ../Sessions.mcpb manifest.json package.json server.js README.md LICENSE icon.png glama.jsonLicense
MIT. See LICENSE.
Related
claude-terminal-mcp — shell, filesystem, and background jobs (for shorter-lived commands where tmux would be overkill).
claude-linux-mcp — X11 desktop control.
claude-rocm-mcp — AMD GPU monitoring; use alongside this one to check GPU health during training.
Available Tools
7 toolscapture_paneARead-only
Capture the last N lines visible in the session's active pane (default 100, max 10000). Returns the joined text. The primary primitive for "is my training still running? show me the latest output".
Inputs: name (required), lines.
has_sessionARead-only
Check whether a named tmux session exists. Cheap precondition for capture_pane, send_keys, or kill_session.
Inputs: name (required).
kill_sessionADestructive
Terminate a named tmux session. Any processes running inside are sent SIGHUP by tmux. Errors if the session does not exist.
Inputs: name (required).
list_sessionsARead-only
List all tmux sessions on the current user's tmux server. Returns name, window count, created/activity timestamps (ISO 8601), and attached status. Returns an empty list when no tmux server is running.
Inputs: no named parameters.
list_windowsARead-only
List windows within a named session (index, name, active flag, pane count).
Inputs: name (required).
new_sessionADestructive
Start a new detached tmux session. Always starts a shell (so the session survives after the initial command finishes). If command is given, it is sent to the shell as keystrokes + Enter, so aliases, venvs, and functions work as expected. Errors if the session name already exists.
Inputs: name (required), command, cwd.
send_keysADestructive
Send key combos or text to the session's active pane. Use for interrupts (C-c), end-of-input (C-d), or typing a command. Text is sent literally. Enter is appended by default; set enter=false for raw key combos.
Inputs: name (required), keys (required), enter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: creation, output capture, listing sessions/windows, existence check, input sending, and termination. No two tools overlap in functionality, making misselection unlikely.
All tools follow a consistent verb_noun pattern in lowercase snake_case (e.g., new_session, capture_pane, list_sessions). The naming is uniform and predictable, with no stylistic deviations.
7 tools is a well-scoped set for tmux session management, covering the essential lifecycle operations without redundancy or bloat. Each tool serves a clear purpose.
The surface covers the core lifecycle (create, read, check, update via send_keys, delete) adequately. Minor gaps exist, such as no rename or attach/detach operations, but these are not critical for typical usage and can be worked around.
Maintenance
Related MCP Connectors
A cloud Linux desktop for your AI: browse, click, type, read the screen and run commands.
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive tmux session management through MCP, allowing users to list sessions, send commands, set up automated messaging timers, and control tmux processes directly from Claude Desktop. Provides both real-time session monitoring and automated workflow features like exit/continue cycles.2MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to manage local tmux sessions, including creating and controlling sessions, windows, and panes, sending commands, and capturing terminal output.167 npmDo What The F*ck You Want To Public
- AlicenseNot gradedqualityDmaintenanceEnables Claude to execute commands and manage directory-aware panes within tmux sessions for a shared terminal experience. It features smart output capture, interactive prompt detection, and background task management.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to control tmux sessions, manage windows and panes, and search/extract text from terminal output.2MIT