Skip to main content
Glama
claude-sessions-mcp

claude-sessions-mcp

by LukeLamb

Claude tmux 세션

Linux용 Claude Desktop에서 tmux 세션 내의 장시간 실행되는 작업을 시작, 모니터링 및 제어할 수 있게 합니다. ML 학습, 데이터 파이프라인 및 단일 대화 세션 이후에도 유지되어야 하는 모든 작업을 위해 설계되었습니다.

Claude는 분리된(detached) 학습 실행을 시작하고, 한 시간 후에 창의 마지막 N줄을 캡처하여 상태를 확인하고, 키 입력(Ctrl+C 포함)을 보내고, 완료되면 세션을 종료할 수 있습니다. 실제 터미널에서 tmux attach -t <name>을 사용하여 동일한 세션을 실시간으로 볼 수 있으며, Claude와 사용자가 동시에 관찰할 수 있습니다.

요구 사항

  • tmux가 설치된 Linux:

    sudo apt install tmux
  • 기본 사용자별 tmux 서버와 함께 작동합니다(공유 서버 설정이 필요하지 않음).

Related MCP server: Tmux MCP Server

설치 (Claude Desktop)

  1. Releases 페이지에서 최신 Sessions.mcpb를 다운로드합니다.

  2. Claude Desktop에서: 설정 → 확장 프로그램 → 확장 프로그램 개발자 → 확장 프로그램 설치 → .mcpb 파일을 선택합니다.

  3. 확장 프로그램을 활성화합니다.

도구

도구

주석

기능

list_sessions

읽기 전용

이름, 창, 생성/활동 타임스탬프, 연결 플래그가 포함된 모든 tmux 세션

has_session

읽기 전용

세션 이름의 정확한 일치 여부 확인

list_windows

읽기 전용

세션 내의 창(인덱스, 이름, 활성 상태, 창 개수)

capture_pane

읽기 전용

세션 활성 창의 마지막 N줄(기본값 100, 최대 10000)

new_session

파괴적

분리된 세션 시작; 선택적으로 초기 셸 명령 실행

send_keys

파괴적

활성 창에 키 조합 또는 텍스트 전송(기본적으로 Enter가 추가됨)

kill_session

파괴적

세션 종료(내부의 모든 프로세스에 SIGHUP 전송)

예시 워크플로우

학습 실행 시작:

"학습 실행 b8-c1을 시작해: rdna4-train venv를 활성화하고 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"

나중에 확인:

"학습 b8-c1이 아직 진행 중이야? 마지막 50줄을 보여줘."

capture_pane name=b8-c1 lines=50

중단된 실행 중단:

"학습이 멈췄어 — Ctrl+C를 보내."

send_keys name=b8-c1 keys="C-c" enter=false

종료:

"세션을 종료해."

kill_session name=b8-c1

키 표기법

send_keys는 리터럴 텍스트(키 입력으로 전송됨) 또는 tmux 키 이름을 허용합니다. 일반적인 키:

키

효과

C-c

Ctrl+C (중단)

C-d

Ctrl+D (EOF / 로그아웃)

Escape

Escape 키

Up, Down, Left, Right

화살표 키

Enter

Enter (enter가 true일 때 자동으로 추가됨)

Space

Space

원시 조합을 보낼 때는 enter: false를 전달하여 추가 Enter가 입력되지 않도록 하십시오.

개인정보 보호 정책

이 확장 프로그램은 전적으로 로컬 컴퓨터에서 실행되며 tmux 바이너리로만 명령을 전달합니다. 데이터가 컴퓨터 외부로 유출되지 않습니다. 네트워크 I/O가 없습니다. 소켓이 없습니다. tmux의 사용자별 서버 소켓(기본값 /tmp/tmux-$UID/default) 외부에는 파일이 기록되지 않습니다.

Claude가 볼 수 있는 정보에는 세션 이름, 창 내용(사용자나 프로그램이 출력한 텍스트), 세션 메타데이터(생성/활동 타임스탬프, 창/창 개수)가 포함됩니다. send_keys와 kill_session은 관리되는 세션 내에서 실행 중인 모든 프로세스에 영향을 줄 수 있으므로, 터미널에 직접 입력하는 사용자와 동일한 수준의 신뢰를 부여하십시오.

문제 해결

"tmux is not installed" — sudo apt install tmux를 실행하십시오.

"can't find pane" 오류 — 일반적으로 작업 도중에 세션이 종료되었음을 의미합니다. 먼저 has_session을 호출하거나 list_sessions를 사용하여 실제로 실행 중인 항목을 확인하십시오.

세션 이름 제한 — 이름에는 ., :, | 또는 공백을 포함할 수 없습니다. .와 :은 tmux 대상 구분 기호이며, |는 이 서버의 필드 구분 기호입니다. 공백은 원칙적으로 거부됩니다.

세션이 초기 명령 후 유지되지 않음 — 설계상 new_session은 항상 셸을 시작하며, command 인수는 해당 셸에 키 입력으로 전송됩니다. 이것이 명령이 완료된 후에도 세션을 유지하는 방법입니다. command를 tmux new-session에 직접 전달하면 명령이 완료될 때 세션이 종료됩니다.

개발

약 300줄의 Node.js 스크립트이며, npm 의존성이 없습니다. .mcpb를 다시 빌드하려면:

cd bundle-source
zip -j ../Sessions.mcpb manifest.json package.json server.js README.md LICENSE icon.png glama.json

라이선스

MIT. LICENSE를 참조하십시오.

관련 항목

  • claude-terminal-mcp — 셸, 파일 시스템 및 백그라운드 작업(tmux가 과도한 짧은 수명의 명령용).

  • claude-linux-mcp — X11 데스크톱 제어.

  • claude-rocm-mcp — AMD GPU 모니터링; 학습 중 GPU 상태를 확인하려면 이 도구와 함께 사용하십시오.

Available Tools

7 tools
capture_paneA
Read-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_sessionA
Read-only

Check whether a named tmux session exists. Cheap precondition for capture_pane, send_keys, or kill_session.

Inputs: name (required).

kill_sessionA
Destructive

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_sessionsA
Read-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_windowsA
Read-only

List windows within a named session (index, name, active flag, pane count).

Inputs: name (required).

new_sessionA
Destructive

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_keysA
Destructive

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

    A4.3/5.0

    Scored across 7 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage local tmux sessions, including creating and controlling sessions, windows, and panes, sending commands, and capturing terminal output.
      16
      10 npm
      Do What The F*ck You Want To Public
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      2
      MIT