Skip to main content
Glama
LukeLamb

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".

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name.
linesNoNumber of lines to capture (default 100).

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnly and non-destructive behavior. The description adds that it captures from the 'active pane' and returns 'joined text', which is useful behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first technical with defaults/limits, second a relatable use case. No wasted words, information is front-loaded and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with two parameters and no output schema, the description covers purpose, behavior, parameters, and use case fully. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% coverage with descriptions for both parameters. The description adds the default value for 'lines' (100), which is not in the schema, giving minor additional value. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Capture the last N lines'), the resource ('session's active pane'), defaults and limits, and a concrete use case. It distinguishes from sibling tools which manage sessions or send keys, not capture output.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear context for use ('is my training still running?') but does not explicitly state when not to use or name alternatives. However, the sibling tools imply that this is the sole tool for capturing output.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

has_sessionA
Read-only

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

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name. Cannot contain ".", ":", "|", or whitespace.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and destructiveHint=false. Description adds that the operation is 'cheap', which is valuable behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words, front-loaded with purpose. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (one parameter, no output schema), the description is complete: it explains purpose, usage context, and constraint hints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with the parameter name described and constraints noted. Description does not add additional semantic meaning beyond what the schema provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool checks if a tmux session exists, using a specific verb and resource. It distinguishes itself from sibling tools by mentioning it's a precondition for three specific actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explicitly states it's a cheap precondition for capture_pane, send_keys, or kill_session, providing clear usage context. No exclusions or alternatives are mentioned, but the context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kill_sessionA
Destructive

Terminate a named tmux session. Any processes running inside are sent SIGHUP by tmux. Errors if the session does not exist.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds beyond annotations: details SIGHUP behavior and error condition if session does not exist. Matches destructiveHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, front-loaded with primary purpose. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complete for a simple kill tool with one parameter and no output schema. Covers purpose, behavior, and error case.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage but only a minimal description for the 'name' parameter. No additional semantics added in tool description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Terminate a named tmux session' with a specific verb-resource pair. Distinct from sibling tools like capture_pane or list_sessions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Conveys when to use (to terminate a session) and mentions consequences (SIGHUP, error if missing). Could note alternatives but sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and destructiveHint. Description adds beyond that by detailing return fields (ISO 8601 timestamps, attached status) and the edge case of an empty list when no tmux server is running.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the main action, and every word adds value. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters, no output schema, and annotations, the description fully covers what the tool does, its return values, and a key edge case (no server running).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and schema coverage is 100% (trivially). Per guidelines for 0 parameters, baseline is 4. Description does not need to add parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'List all tmux sessions' with specific return fields (name, window count, timestamps, attached status). It distinguishes from sibling tools like kill_session and new_session by focusing on listing only.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for reading sessions, not modifying them. However, it does not explicitly state when not to use or mention alternatives. The context from sibling tools helps, but clarity could be improved.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_windowsA
Read-only

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

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description adds the return fields (index, name, active flag, pane count). However, it does not disclose behavior if the session does not exist or any other edge cases. Adds some context but not rich behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence (12 words) with no wasted words. It is front-loaded with the action 'List windows' and immediately clarifies scope and return fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only list tool with 1 parameter and no output schema, the description is fairly complete: it specifies what it does, what it returns, and the required input. It could mention that the session must exist, but that is implied. Sibling tools provide additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (the only parameter 'name' is described as 'Session name'). The description reinforces that the session is named but adds no new semantic meaning beyond the schema. Baseline 3 for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resource 'windows within a named session', and specifies return fields (index, name, active flag, pane count). This distinguishes it from sibling tools like list_sessions (list sessions) and capture_pane (capture pane output).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a session name and want to see its windows, but does not explicitly state when to use this tool versus alternatives like list_sessions or when not to use it. No guidance on prerequisites (e.g., session must exist).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name (unique). Cannot contain ".", ":", "|", or whitespace.
commandNoOptional initial command to run inside the shell (e.g. "cd /path && python train.py").
cwdNoOptional starting working directory for the session.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds significant behavioral details beyond annotations: detached, always starts shell, command sent as keystrokes enabling aliases, errors on duplicate name. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with no waste. First sentence states purpose, second explains key behavior, third clarifies command detail and error condition. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, behavior, error conditions, and parameter semantics. No output schema needed. Complete for a creation tool with 3 parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds key nuance: command is sent as keystrokes + Enter, preserving aliases and venvs. This raises the score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool starts a new detached tmux session, which is a specific verb + resource. It distinguishes from siblings like 'kill_session' by focusing on creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Describes when to use (to start a session) and conditions: always starts a shell, errors if name exists. No explicit comparison to alternatives, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesSession name.
keysYesKey combo (e.g. "C-c", "C-d", "Escape") or literal text to type.
enterNoAppend an Enter keypress after the keys. Default true.

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate destructive and open-world hints; the description adds detail: text is sent literally, Enter appended by default, and raw combos require enter=false. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences, front-loaded with purpose, then specific guidelines. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers key behavioral aspects; lacks description of return values, but given no output schema and the nature of the action (send), this is acceptable. Sibling tools are listed for context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters; description enriches meaning by explaining literal sending and enter default behavior, going beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (send), resource (key combos or text to session's active pane), and specific use cases (interrupts, end-of-input, typing a command). It distinguishes from sibling tools like capture_pane or kill_session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear when-to-use guidance (interrupts, end-of-input, typing) and explains the enter parameter behavior. Does not explicitly mention when not to use or alternatives among siblings, but sibling tools are sufficiently different.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv0.1.0
    • First observedcapture_pane
    • First observedhas_session
    • First observedkill_session
    • First observedlist_sessions
    • First observedlist_windows
    • First observednew_session
    • First observedsend_keys

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

ActivityMaintained
ResponsivenessNo issues

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
    8 npm
    Do What The F*ck You Want To Public
  • F
    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
    -