claude-sessions-mcp

claude-sessions-mcp

Lets Claude manage tmux sessions on Linux — start long-running ML training jobs, check their output, send keystrokes, and kill them.

Category
访问服务器

README

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 tmux installed:
    sudo apt install tmux
    
  • Works with the default per-user tmux server (no shared-server setup needed).

Install (Claude Desktop)

  1. Download the latest Sessions.mcpb from the Releases page.
  2. In Claude Desktop: Settings → Extensions → Extension Developer → Install Extension → pick the .mcpb.
  3. Enable the extension.

Tools

Tool Annotation What it does
list_sessions read-only All tmux sessions with name, windows, created/activity timestamps, attached flag
has_session read-only Exact-match check for a session name
list_windows read-only Windows within a session (index, name, active, pane count)
capture_pane read-only Last N lines of the session's active pane (default 100, max 10000)
new_session destructive Start a detached session; optionally run an initial shell command
send_keys destructive Send key combos or text to the active pane (Enter appended by default)
kill_session destructive Terminate a session (sends SIGHUP to all processes inside)

Example workflows

Start a training run:

"Start training run b8-c1: activate my rdna4-train venv 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-c1 still 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
C-c Ctrl+C (interrupt)
C-d Ctrl+D (EOF / logout)
Escape Escape key
Up, Down, Left, Right Arrow keys
Enter Enter (also appended automatically when enter is true)
Space 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.json

License

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选