Skip to main content
Glama
GrigoriLab

claude-mux-iterm

by GrigoriLab

claude-mux-iterm

MCP server enabling communication between Claude Code sessions in iTerm2 panes.

Primary use case: Notify other sessions when PR is merged to main so they can pull latest changes.

Installation

pip install claude-mux-iterm

Or with uv:

uv pip install claude-mux-iterm

Related MCP server: claude-context-sync

Configuration

Add to your Claude Code MCP settings (~/.claude/settings.json or project-level):

{
  "mcpServers": {
    "claude-mux-iterm": {
      "command": "uvx",
      "args": ["claude-mux-iterm"]
    }
  }
}

Or if installed with pip:

{
  "mcpServers": {
    "claude-mux-iterm": {
      "command": "claude-mux-iterm"
    }
  }
}

Tools

register_session(task_id)

Register the current iTerm2 session with a task ID. This allows other sessions to find and communicate with this session.

register_session("task-a")

list_sessions()

List all registered active sessions.

list_sessions()

send_message(target_task_id, content, source_task_id)

Send a message to a specific session.

send_message("task-b", "PR merged to main, please pull latest", "task-a")

broadcast_message(content, source_task_id)

Send a message to all other active sessions.

broadcast_message("PR #123 merged to main, please pull latest", "task-a")

list_messages(current_task_id, unread_only)

List messages received by this session.

list_messages("task-a", unread_only=True)

acknowledge_message(message_id, current_task_id)

Mark a message as read/acknowledged.

acknowledge_message("msg_abc123", "task-a")

Usage Example

Pane 1 (working on feature branch):

# Register this session
register_session("feature-auth")

# Check for messages periodically
list_messages("feature-auth", unread_only=True)

Pane 2 (just merged a PR):

# Register this session
register_session("main-work")

# Notify all other sessions about the merge
broadcast_message("PR #42 merged to main with auth changes - please pull latest", "main-work")

Message Format

Messages are injected into sessions using a wire format:

[CLAUDE-MUX-ITERM-MESSAGE]{"message_id":"msg_abc123",...}[/CLAUDE-MUX-ITERM-MESSAGE]

Claude Code sessions can parse this format to extract the message content.

Storage

Session registrations and messages are stored in:

~/.claude-mux-iterm/
├── sessions/
│   └── {task_id}.json           # Session registrations
└── messages/
    └── {task_id}/
        ├── inbox/               # Received messages
        ├── outbox/              # Sent messages
        └── delivered/           # Acknowledged messages

Requirements

  • macOS (uses iTerm2 AppleScript)

  • iTerm2 running

  • Python 3.10+

Development

# Clone the repo
git clone https://github.com/GrigoriLab/claude-mux-iterm
cd claude-mux-iterm

# Install with dev dependencies
uv pip install -e ".[dev]"

# Run tests
uv run pytest

# Run type checking
uv run mypy src

# Run linting
uv run ruff check src tests

License

MIT License - see LICENSE file.

Available Tools

6 tools
acknowledge_messageA

Mark a message as read/acknowledged.

Use this after you've processed a message to remove it from your unread messages.

Args: message_id: The ID of the message to acknowledge. current_task_id: Your current task ID.

Returns: Result indicating whether acknowledgement succeeded.

Example: >>> acknowledge_message("msg_abc123", "task-a") AcknowledgeMessageResult(success=True, ...)

ParametersJSON Schema
NameRequiredDescriptionDefault
message_idYes
current_task_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYesHuman-readable status message
successYesWhether the acknowledgement succeeded
message_idNoThe acknowledged message ID

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden of disclosing behavior. It states the key side effect (removing from unread messages) and mentions that a result is returned indicating success. It does not cover idempotency or error cases, but the disclosed behavior is sufficiently clear for a simple mutation tool.

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 well-structured with a clear opening purpose, Args, Returns, and an Example. It is concise, front-loaded, and every section adds value. The example is illustrative without being verbose.

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 tool's simplicity, the description is complete: it explains purpose, when to use, parameter semantics, return type, and provides an example. The presence of an output schema means the return details need not be fully explained. It covers everything necessary for an agent to select and invoke this tool correctly.

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?

The input schema has 0% description coverage, but the description compensates by providing an Args section with meaningful explanations: 'The ID of the message to acknowledge' and 'Your current task ID.' It also includes a usage example, giving the parameters practical context beyond their names and types.

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 opens with 'Mark a message as read/acknowledged,' which clearly states a specific action on a resource. It further explains the effect ('remove it from your unread messages') and distinguishes the tool from sibling tools like list_messages, send_message, and broadcast_message, which have different purposes.

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 explicitly says 'Use this after you've processed a message to remove it from your unread messages,' giving clear context for when the tool should be invoked. However, it does not mention when not to use it or explicitly name alternatives, though the sibling tools are implicitly different.

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

broadcast_messageA

Broadcast a message to all other active Claude Code sessions.

Use this to notify all other sessions about important events, like when a PR is merged to main.

Args: content: The message content to broadcast. source_task_id: Your current task ID (the sender). priority: Message priority: "normal", "high", or "urgent".

Returns: Result indicating how many sessions received the message.

Example: >>> broadcast_message("PR #123 merged to main, please pull latest", "task-a") SendMessageResult(success=True, delivered_to=["task-b", "task-c"], ...)

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
priorityNonormal
source_task_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYesHuman-readable status message
successYesWhether the message was sent
message_idNoID of the sent message
delivered_toNoList of task IDs message was delivered to
target_task_idNoTarget task ID

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the disclosure burden. It explains that the message goes to all other active sessions and returns a result indicating success and delivery targets. It also describes the priority parameter. However, it does not cover potential edge cases like failure behavior or rate limits, which keeps it from a 5.

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 well-organized with clear sections for intro, usage, arguments, return value, and an example. It is front-loaded with the core purpose and adds no filler or redundant information.

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 tool's moderate complexity, the description provides sufficient context: when to use it, what it does, parameter details, and a concrete usage example. The return format is described and the presence of an output schema further completes the picture.

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?

The input schema provides only type/title information with 0% description coverage, so the description fully compensates. It explains the meaning of each parameter: content, source_task_id, and priority, including the allowed priority values ('normal', 'high', 'urgent'). The example also demonstrates the parameter values in context.

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 'Broadcast a message to all other active Claude Code sessions' — a specific verb ('broadcast'), resource ('message'), and scope ('all other active sessions'). It distinguishes from the sibling tool 'send_message', which likely targets a specific 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?

The description explicitly says 'Use this to notify all other sessions about important events, like when a PR is merged to main', providing a clear usage context. It does not directly mention when not to use it or alternatives, but the broadcast vs. direct messaging distinction is implied by the wording.

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

list_messagesA

List messages received by this session.

Use this to see what other sessions have communicated to you.

Args: current_task_id: Your current task ID. unread_only: Only show messages not yet acknowledged.

Returns: List of messages with metadata.

Example: >>> list_messages("task-a", unread_only=True) ListMessagesResult(messages=[...], unread_count=3, ...)

ParametersJSON Schema
NameRequiredDescriptionDefault
unread_onlyNo
current_task_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYesHuman-readable status message
messagesNo
unread_countNo

TDQS

A4.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains the return type and the unread_only flag, implicitly indicating a read operation, but does not explicitly state whether listing messages has side effects (e.g., marking them as read) or any other behavioral nuances.

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 well-structured with distinct sections for summary, usage, arguments, return value, and an example. It is concise without unnecessary repetition, and every section serves a clear purpose.

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?

The description gives all necessary context: purpose, usage, parameter meanings, return format, and a concrete example. With an output schema available, the description doesn't need to detail return structure further, so the coverage is fully adequate.

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 description coverage is 0%, but the description compensates fully by documenting each parameter in the Args section. current_task_id is explained as 'Your current task ID' and unread_only as 'Only show messages not yet acknowledged,' adding meaningful semantics beyond the schema's bare type definitions.

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 explicitly states 'List messages received by this session' with a specific verb and resource. It clearly differentiates from siblings like send_message and acknowledge_message, making the tool's unique purpose unambiguous.

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 sentence 'Use this to see what other sessions have communicated to you' provides direct guidance on when to use the tool. While it doesn't explicitly mention alternatives or exclusions, the use case is clear and logically distinct from sibling tools.

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

list_sessionsA

List all registered active iTerm2 sessions.

Use this to discover which other Claude Code sessions you can communicate with.

Returns: List of active sessions with their task IDs.

Example: >>> list_sessions() ListSessionsResult( sessions=[ Session(task_id="task-a", ...), Session(task_id="task-b", ...), ], total_count=2, ... )

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageNoHuman-readable status message
sessionsNoList of active sessions
total_countNoTotal number of sessions

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden. It discloses the return format via an example, mentions that it lists only active sessions, and indicates a list with total_count. It does not explicitly state that the operation is read-only, but the tool's name and 'list' semantics imply it. The example gives useful transparency into the result structure.

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 appropriately sized: a single clear summary line, a short usage note, and a structured example. Every sentence earns its place without fluff. The front-loaded main purpose makes it easy to scan.

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 zero-parameter list tool with an output schema, the description is complete. It explains what is listed, why to use it, and what the return looks like. There is no missing critical information for an agent to invoke and interpret the result.

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?

The tool has zero parameters, so the schema fully covers this aspect. The description does not need to add parameter details, and the baseline of 4 applies. The description's focus on the return value 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 tool lists all registered active iTerm2 sessions, using the specific verb 'list' with a well-defined resource. It also explains the purpose ('discover which other Claude Code sessions you can communicate with'), which distinguishes it from sibling tools like register_session or send_message.

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 when to use the tool ('Use this to discover which other Claude Code sessions you can communicate with'), implying it is the initial discovery step before communication. However, it does not explicitly mention alternatives or when not to use it, though the zero-parameter nature makes this less critical.

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

register_sessionA

Register the current iTerm2 session with a task ID.

This allows other Claude Code sessions to find and communicate with this session using the task ID.

Args: task_id: Unique identifier for this session (e.g., "task-a", "feature-auth"). Must be alphanumeric with hyphens/underscores, max 64 chars.

Returns: Result indicating whether registration succeeded.

Example: >>> register_session("task-a") RegisterSessionResult(success=True, task_id="task-a", ...)

ParametersJSON Schema
NameRequiredDescriptionDefault
task_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYesHuman-readable status message
successYesWhether the registration succeeded
task_idNoThe registered task ID
session_idNoThe iTerm2 session ID

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the core behavior (registration, enabling communication, return result) but omits potential side effects such as overwrite behavior, idempotency, or failure modes. This is moderately transparent but not deeply detailed.

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 well-organized with purpose, args, returns, and an example. Every sentence adds value without redundancy. It is front-loaded with the main purpose and then provides structured details, making it easy to parse.

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 single-parameter tool, the description covers the essential aspects: what it does, why it is used, the parameter specification, and an example result. An output schema exists, so return-value explanation is not strictly needed but is included. Minor gaps remain regarding edge cases, but overall it is complete.

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 coverage is 0%, but the description fully compensates by specifying task_id's purpose, allowed characters, maximum length, and giving concrete examples. This is exactly the information an agent needs beyond the bare schema type.

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 uses a specific verb ('Register') and clearly identifies the resource ('current iTerm2 session'). It distinguishes from sibling tools like list_sessions and send_message by explaining that registration enables other sessions to find and communicate with this 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?

The description states that it registers the current session, implying it is a prerequisite for inter-session communication. It does not explicitly mention when not to use it or name alternatives, but the context is clear. It also provides format constraints for task_id, which aids correct usage.

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

send_messageA

Send a message to a specific Claude Code session.

Use this to communicate with another Claude instance working on a related task. The message will be injected into the target session.

Args: target_task_id: Task ID of the target session (e.g., "task-b"). content: The message content to send. source_task_id: Your current task ID (the sender). priority: Message priority: "normal", "high", or "urgent".

Returns: Result indicating whether the message was sent.

Example: >>> send_message("task-b", "PR merged to main, please pull latest", "task-a") SendMessageResult(success=True, message_id="msg_abc123", ...)

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
priorityNonormal
source_task_idYes
target_task_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYesHuman-readable status message
successYesWhether the message was sent
message_idNoID of the sent message
delivered_toNoList of task IDs message was delivered to
target_task_idNoTarget task ID

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It states that the message will be injected into the target session and that a result is returned, which is useful. However, it omits potential side effects, failure modes (e.g., if the target session doesn't exist), or any delivery guarantees. This is adequate but not rich.

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 well-structured with a clear purpose sentence, a brief usage note, an Args section, a Returns note, and an example. Every section earns its place without excess verbosity. The front-loaded purpose sentence gives immediate clarity.

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?

The tool has four parameters and an output schema, and the description covers all parameters and the return type. It includes a realistic example. While it does not address edge cases like invalid session IDs or priority handling, the given information is sufficient for an agent to select and invoke the tool correctly in most scenarios.

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 description coverage is 0%, but the description compensates by documenting all four parameters: target_task_id, content, source_task_id, and priority. It adds meaning beyond the schema by providing an example task ID, explaining source_task_id as the sender, and specifying allowed priority values ('normal', 'high', 'urgent'). The example call also illustrates correct parameter order.

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 opens with a specific verb+resource: 'Send a message to a specific Claude Code session.' This clearly distinguishes it from siblings like broadcast_message by emphasizing targeted delivery. The additional context about communicating with another Claude instance reinforces the tool's unique role.

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 clear usage context: 'Use this to communicate with another Claude instance working on a related task.' It implies the targeted nature versus broadcast, and the sibling list includes broadcast_message, signaling alternatives. However, it does not explicitly state when not to use this tool or mention alternative tools by name, so it narrowly misses a 5.

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. Dates show when Glama detected each change.

  1. 6 tool updatesv0.1.0
    • First observedacknowledge_message
    • First observedbroadcast_message
    • First observedlist_messages
    • First observedlist_sessions
    • First observedregister_session
    • First observedsend_message

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: registration, listing sessions, unicast, broadcast, listing messages, and acknowledging. No two tools could be confused, even though send_message and broadcast_message share the sending concept, their targets differ.

Naming Consistency5/5

All tool names follow the verb_noun pattern with snake_case, using consistent verbs like register, list, send, broadcast, and acknowledge. The naming is predictable and readable.

Tool Count5/5

Six tools is well-scoped for a session management and messaging system. Each tool contributes to the core workflow without redundancy or bloat.

Completeness4/5

The core lifecycle is covered: register, discover, send, broadcast, read, and acknowledge. A notable gap is the lack of an unregister_session or cleanup mechanism, which could leave stale sessions, but agents can work around this in practice.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GrigoriLab/claude-mux-iterm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server