Skip to main content
Glama

cmuxLayer

AIエージェント同士は、お互いのターミナルを見ることができません。 1つはタブ1で、もう1つはタブ2で実行され、あなたはそれらの間のクリップボード役を担うことになります。cmuxLayerはこれを解決します。AIエージェントにターミナルワークスペースのプログラム制御権を与える26個のMCPツールを提供します。

install License MCP Tools Tests

クイックスタート

npm install -g cmuxlayer

cmuxが実行されている必要があります。

MCP設定に追加してください:

Codex CLI / T3 Code

T3 Codeは、~/.codex/config.toml(または $CODEX_HOME/config.toml)にあるCodex CLI設定ファイルからMCPサーバーを継承します。

[mcp_servers.cmux]
command = "cmuxlayer"

Claude Code, Cursor, VS Code, Claude Desktop

{
  "mcpServers": {
    "cmux": {
      "command": "cmuxlayer"
    }
  }
}

設定ファイルの場所: Codex CLI / T3 Code ~/.codex/config.toml (または $CODEX_HOME/config.toml) | Claude Code .mcp.json または claude mcp add cmuxlayer -s user -- cmuxlayer | Cursor .cursor/mcp.json | VS Code .vscode/mcp.json | Claude Desktop — プラットフォーム固有のパスについては MCP docs を参照してください

Related MCP server: hyperpanes-mcp

できること

AIエージェントに次のような指示を出せます:

  • "ペインを右に分割して、そこでテストスイートを実行して"

  • "新しいペインでClaude Codeエージェントを起動し、auth.tsをリファクタリングして"

  • "surface:2の画面を読み取って、ビルドが成功したか教えて"

  • "すべてのエージェントが終了するのを待ってから、出力を読み取って"

  • "サイドバーのステータスをデプロイの進捗状況を表示するように設定して"

内部的には、cmuxLayerはターミナル制御、画面読み取り、レイアウト管理、マルチエージェントオーケストレーションのための26個のMCPツールを公開しています。read_screenは、Claude Code、Codex、Gemini、Cursorのエージェントメタデータ(ステータス、モデル、トークン、コンテキスト%)を解析します。

MCPツール (26)

すべてのツールには、自動安全ポリシー適用のためのToolAnnotationsが付属しています。

ターミナル制御 — new_split new_surface move_surface reorder_surface send_input send_key read_screen rename_tab close_surface browser_surface

エージェントのライフサイクル — spawn_agent send_to send_to_agent wait_for wait_for_all interact stop_agent kill

ワークスペース — list_surfaces list_agents my_agents get_agent_state read_agent_output notify set_status set_progress

読み取り専用 (6)

ツール

説明

list_surfaces

ワークスペース全体のすべてのサーフェスを一覧表示

read_screen

解析されたエージェントステータスを含むターミナル出力を読み取る

get_agent_state

追跡対象エージェントの完全な状態

list_agents

オプションのフィルター付きですべてのエージェントを一覧表示

my_agents

ライブ画面ステータスを持つ親エージェントの子エージェント

read_agent_output

区切りマーカー間の構造化された出力

ミューテーション (17)

ツール

説明

new_split

ターミナルまたはブラウザの分割ペインを作成

new_surface

既存のペインにタブを作成

move_surface

サーフェスを別のペインや位置に移動

reorder_surface

ペイン内のタブを並べ替える

send_input

サーフェスにテキストを送信

send_key

キー入力を送信 (return, escape, ctrl-cなど)

rename_tab

サーフェスタブの名前を変更

notify

cmux通知バナーを表示

set_status

サイドバーのステータスキーと値を設定

set_progress

進捗インジケーターを設定 (0.0-1.0)

browser_surface

ブラウザサーフェスと対話

spawn_agent

新しいペインでCLIエージェントを起動

send_to

サーフェスを知らなくても追跡対象エージェントにテキストを送信

send_to_agent

実行中のエージェントにプロンプトを送信

wait_for

エージェントがターゲット状態(デフォルトは done)に達するまで待機

wait_for_all

複数のエージェントが終了するまで待機

interact

対話型入力を送信 (確認、キャンセル、再開)

破壊的 (3)

ツール

説明

close_surface

ターミナルまたはブラウザのペインを閉じる

stop_agent

エージェントを正常に停止

kill

エージェントプロセスを強制終了

サポートされているエージェント

CLI

コマンド

自動検出

Claude Code

claude

ステータス, モデル, トークン, コンテキスト %

Codex

codex

ステータス, モデル, コンテキスト %

Gemini CLI

gemini

ステータス, モデル, トークン, コンテキスト %

Cursor

cursor agent

ステータス, モデル, トークン, コンテキスト %

read_screenはエージェントタイプを自動検出し、ターミナル出力からメタデータを解析します。

アーキテクチャ

AI Agent  ─── MCP ───>  cmuxLayer  ─── Unix socket ───>  cmux
                         ├── Agent engine (spawn → monitor → teardown)
                         ├── Screen parser (5 agent formats)
                         ├── Mode policy (autonomous vs manual)
                         └── State manager + event log

ソケットクライアントはUnixソケット経由でcmuxに接続します。切断時には自動再接続を行い、ソケットが利用できない場合はCLIサブプロセスにフォールバックします。

接続

レイテンシ

高速化

CLIサブプロセス

~142ms

ベースライン

Unixソケット

~0.1ms

1,423倍

トラブルシューティング

cmuxが実行されていません cmuxLayerには実行中のcmuxインスタンスが必要です。最初にインストールし、cmuxLayerを使用する前にcmuxセッションを開始してください。

Codex CLIまたはT3 Codeにツールが表示されません ~/.codex/config.tomlにcmuxlayerを追加した後、クライアントを再起動してください。カスタムのCodexホームを使用している場合は、$CODEX_HOME/config.tomlに同じmcp_servers.cmuxエントリが含まれていることを確認してください。

Claude Codeにツールが表示されません MCP設定を追加した後、Claude Codeを再起動してください。claude mcp listを実行して、cmuxlayerが接続されていることを確認してください。

ソケット接続に失敗しました cmuxLayerはcmuxソケットを自動検出します(macOS: ~/Library/Application Support/cmux/cmux.sock)。必要に応じてCMUX_SOCKET_PATHで上書きしてください。

テスト

bun run test        # 406 tests via vitest
npm run typecheck   # Type checking

開発

npm install
npm run dev         # Run with tsx (hot reload)
npm run build       # Compile TypeScript
npm start           # Run compiled output

貢献

開発環境のセットアップとPRガイドラインについてはCONTRIBUTING.mdを参照してください。

ライセンス

Apache 2.0 — LICENSEを参照してください。


Golems AIエージェントエコシステムの一部です。cmuxlayer.etanheyman.com | @EtanHeyによって構築されました。

Available Tools

10 tools
close_surfaceA
Destructive

Close one surface, managed agent, or workspace with live-agent guards. scope="agent" stops the agent AND closes its pane, and reports the two halves separately (agent_stopped, surface_closed) so a pane that survives is never reported as closed. The pane close obeys the same live-agent guard as scope="surface": without force:true a still-live agent keeps its pane, and the receipt says so.

Inputs: force, scope, surface, agent_id, +1 more. Returns: ok, pane, force, scope, +12 more

control_healthA
Read-onlyIdempotent

Report terse control-path health by default; pass detail=full for diagnostics.

Inputs: detail. Returns: ok, health, retry_count

list_agentsA

List live-derived agents, including registry-persisted prompt blockage and pause state; filter to blocked agents or children with mine/parent_agent_id. Default summary returns flat addressable scalars and hides close tombstones and failed spawns whose surfaces are absent; request a terminal state or detail=full to include them. Full detail also includes provenance, health diagnostics, the registry record, and up to 20 unresolved or attention delivery receipts.

Inputs: mine, repo, model, state, +5 more. Returns: ok, count, agents, derived_at, +1 more

list_surfacesA
Read-onlyIdempotent

List workspace, pane, and surface topology. Condensed by default; verbose=true adds raw cmux fields.

Inputs: verbose, workspace, preview_lines, include_screen_preview. Returns: ok, surfaces, workspaces, retry_count, +1 more

read_screenA
Read-onlyIdempotent

Read a terminal screen and parsed harness status. Use raw=true for full text or parsed_only=true for monitoring.

Inputs: raw, lines, surface, workspace, +3 more. Returns: ok, parsed, surface, retry_count

report_to_parentA

Raise a short blocker to this managed agent's registry parent. cmuxlayer chooses the parent; callers cannot address arbitrary agents. The blocker is durably appended to the parent's inbox and its pointer is actively delivered. If that wake fails, cmuxlayer alerts the nearest reachable ancestor and returns fallback provenance. A root agent has no parent and receives an error. Workers with collab_path must append there to reach their own parent lead; this tool refuses that upward route.

Inputs: blocker (required). Returns: ok, route, durable, delivery, +6 more

send_toA

Send text or a key through the shared delivery engine. send_to submits new messages. Key-Return supports pickers, menus, permission prompts, and recovery of this caller's exact typed draft on the same agent/session once the displayed unambiguous reset time passes or new harness output confirms recovery; the old refusal may stay visible. Exact /usage, /usage-credits or /rate-limit-options navigation is also guarded. Read the pane and receipt first; never retype or repeat accepted input. Every receipt includes caller_agent_id (null when unknown). Workers with collab_path cannot address their own parent or ancestor leads in any mode; append to that collab file instead. Unknown callers remain allowed. Lead-originated and engine-internal pushes remain allowed. Targets may be one agent, structured agent targeting, or a raw surface in surface/command/key mode; for shell commands use mode:command. Text success requires a verified submit or new matching queue proof. Otherwise ok=false with submit_unverified retains pending verification and ownership for retries without retyping. Verified text success returns only ok, target identity, delivery_id, delivery_state, submitted, caller_agent_id, and queued_behind_turn when applicable. Key success returns its key verification fields. Pass verbose=true for full diagnostics; failures always retain them.

Inputs: mode, text, target, surface, +13 more. Returns: ok, key, model, title, +37 more

spawn_agentA

Spawn a managed agent or terminal, or resume a captured agent on a fresh surface preserving its ID. Resume: {resume_agent_id:"..."}. Omit new-spawn fields: repo, cli, model, effort, cwd, prompt, boot_prompt_path, worktree, mcp_profile, role, placement, authority, collab_path, parent_agent_id, max_cost_per_agent; these cause INVALID_RESUME_SPEC. Optional resume controls such as force, workspace, focus, report_path and verbose remain supported. Resume restores session context; it does not resend a task. For a new task, check current readiness, then use send_to separately. ok:true/state:started means lifecycle started, not ready or task delivered. At a chooser or permission prompt, inspect the current frame with read_screen before acting; never blindly send Return or assume success. pending_verify leaves delivery unverified; follow wait_for guidance in warning when present; do not resend blindly. Placement is deterministic; boot_prompt_timeout_ms also bounds pane placement. Default successes have at most six fields: ok, agent_id, surface_id, state (spawn outcome), delivered (boot prompt), and optional warning. Use verbose:true for contract_path, report_path, done_marker, transport, worktree, and diagnostics; report_path and done_marker are also in the issued contract file. Failures always keep full detail.

Inputs: cli, cwd, repo, role, +25 more. Returns: ok, cwd, role, type, +26 more

update_surfaceB

Move or rename a surface, or adopt_session to rebind an existing managed Claude or Codex identity after a restart using pinned historical evidence and fresh process/topology proof. Adoption changes no pane or input; layout reconciliation follows separately.

Inputs: action (required), surface (required), cwd, pane, +20 more. Returns: ok, pane, title, action, +3 more

wait_forB

Block until one agent_id or every agent in ids reaches a target registry state and return health. Defaults to waiting for completion (done).

Inputs: ids, mine, watch, agent_id, +6 more. Returns: ok, typed, watch, results, +16 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool has a reasonably distinct purpose: spawn, send, list, close, read, wait, health, report. There is mild overlap between list_agents and list_surfaces (agents live on surfaces) and among the surface-touching tools (spawn_agent, update_surface, close_surface), but descriptions clarify the boundaries.

    Naming Consistency4/5

    Nearly all names are snake_case with a verb_noun or verb_prep pattern (control_health, spawn_agent, list_agents, update_surface, close_surface, list_surfaces, read_screen). Minor deviations are the prepositional forms send_to, wait_for, and report_to_parent, which are still readable and consistent in style.

    Tool Count5/5

    Ten tools is well within the ideal range and each covers a distinct facet of agent/surface orchestration. No redundant or filler tools appear; the set feels tightly scoped to the domain.

    Completeness4/5

    The surface covers the full lifecycle: spawn/resume, list, send, read, wait, update/adopt, close, report, and health. Coverage is strong, with only minor gaps such as no dedicated agent-state update beyond update_surface's adoption path.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Terminal MCP server for AI coding agents with persistent PTY sessions, ring-buffer incremental reads, headless xterm screen capture, multi-agent orchestration, and a real-time web dashboard.
      33 npm
      28
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for hyperpanes terminal workspace app, enabling AI agents to compose and launch workspace layouts, inspect and drive terminal panes, stream output, and orchestrate agent hierarchies.
      50
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server to control Onda terminal from AI agents, providing tools for splitting panes, running commands, managing tabs and workspaces, and orchestrating multi-agent workflows across multiple windows.
      39
      5 npm
      MIT