Tmux Bridge MCP 标志

Tmux Bridge MCP

社区
howardpen9

Standalone MCP server for cross-pane AI agent communication via tmux. Lets Claude Code, Gemini CLI, Codex, and Kimi CLI talk to each other through tmux panes.

发布者howardpen9
代码仓库tmux-bridge-mcp
语言TypeScript
复刻数
12
星标数
100
可用工具
0
传输类型stdio
分类
链接
  • 将工具接入 AI 工作流

    Tmux Bridge MCP 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 100 个星标和 12 个复刻。

tmux-bridge-mcp

English | 简体中文

tmux-bridge-mcp

A standalone MCP server that lets AI agents (Claude Code, Gemini CLI, Codex, Kimi CLI) communicate with each other through tmux panes. It talks directly to tmux -- no external dependencies beyond tmux itself.

🖥️ What is tmux?

tmux is a terminal multiplexer -- it lets you split one terminal window into multiple panes, each running its own process independently. Think of it as "tabs on steroids" for your terminal.

What is tmux

+-------------------------------+
|  Pane 1       |  Pane 2       |
|  Claude Code  |  Codex        |
|  writing code |  reviewing    |
|               |               |
+---------------+---------------+
|  Pane 3       |  Pane 4       |
|  Gemini CLI   |  tail -f logs |
|  researching  |  monitoring   |
+-------------------------------+

Each pane is a full terminal. You can have Claude Code running in one, Codex in another, Gemini in a third -- all visible at the same time, all on the same machine.

The problem: these panes can't talk to each other. An agent in Pane 1 has no idea what's happening in Pane 2.

The Problem

tmux-bridge fixes this. It gives every agent the ability to read, type, and send messages into any other pane.

The Solution

⚡ What can you do with tmux-bridge?

Once installed, your AI agents can:

ActionHowExample
See what another agent is doingtmux_readRead the last 20 lines of Codex's pane
Send a task to another agenttmux_message + tmux_keysTell Claude to review a file
Coordinate multi-agent workflowsChain tool callsGemini researches -> Claude implements -> Codex reviews
Monitor processestmux_read on a shell paneWatch build logs, test output, server status
Label panes by roletmux_nameName panes "claude", "codex", "gemini" for easy targeting

All of this happens through standard MCP tool calls -- your agent doesn't need to learn any new syntax. If it supports MCP, it already knows how.

🤖 Supported Agents

Supported Agents

Tested and documented

AgentConnectionSetup path
Claude CodeNative MCP (stdio)claude mcp add -s user / ~/.claude.json
Codex CLINative MCP (stdio)codex mcp add
OpenCodeNative MCP (stdio)~/.config/opencode/opencode.json(c) (mcp key)
CodeBuddyNative MCP (stdio)codebuddy mcp add -s user / ~/.codebuddy/.mcp.json
GitHub Copilot CLINative MCP (stdio)copilot mcp add / ~/.copilot/mcp-config.json
Grok BuildNative MCP (stdio)grok mcp add -s user / ~/.grok/config.toml
Gemini CLINative MCP (stdio)~/.gemini/settings.json
Kimi CLI v1.26+Native MCP (kimi mcp add)kimi mcp add
Kimi CLI olderLegacy wrapper (kimi-tmux)wrapper binary

Should work (any MCP-compatible agent)

AgentNotes
CursorSupports MCP servers in settings
Windsurf (Codeium)MCP server support
AiderCommunity MCP support
Continue.devMCP server support
ClineVS Code extension with MCP
Roo CodeFork of Cline with MCP
Any shell script or processRead pane output with tmux_read, no MCP needed

tmux-bridge works with any agent that supports MCP over stdio. If your agent isn't listed, try adding the MCP config -- it will likely just work.

💡 Why

When you run multiple AI agents in separate terminals, they work in isolation. You end up copy-pasting context between them, manually relaying questions and answers, or losing track of what each agent is doing.

tmux-bridge solves this by giving every agent the ability to read, type, and send messages into any other terminal pane -- programmatically, through standard MCP tool calls.

Use cases:

  • Code review pipeline -- Claude Code writes code in one pane, Codex reviews it in another, results flow back automatically
  • Multi-model reasoning -- ask Gemini for research, feed the findings to Claude, let Codex verify the implementation
  • Parallel workflows -- multiple Claude Code instances each handling a different part of a large task, coordinating through pane messages
  • Monitoring -- an agent reads log output from a tail -f pane and reacts to errors in real time

What you need:

RequirementWhy
tmuxThe terminal multiplexer that hosts your panes -- this is the communication channel
Node.js 18+Runs the MCP server
At least one MCP-compatible agentClaude Code, Codex, OpenCode, CodeBuddy, Copilot CLI, Grok Build, Gemini CLI, or Kimi CLI v1.26+

If you already use tmux to run multiple agents side by side, tmux-bridge just makes them aware of each other.

😩 Without tmux-bridge

You're running Claude Code in one pane, Codex in another. Claude finishes writing a function and you want Codex to review it. Here's what actually happens:

  1. You read Claude's output. Scroll up. Copy the relevant part.
  2. Switch to Codex's pane. Paste it in. Type "review this code."
  3. Codex gives feedback. You copy that.
  4. Switch back to Claude. Paste Codex's feedback. "Fix these issues."
  5. Repeat for every round of review.

You are the message bus. Every interaction flows through your clipboard. You're not writing code anymore -- you're routing context between agents. With 3+ agents running, this becomes unmanageable within minutes.

🤔 Why not LangChain / CrewAI / A2A?

ApproachWhat it asks you to dotmux-bridge difference
LangChain / CrewAI / AutoGenRewrite your workflow inside their framework. Your agents must be Python objects in their orchestration layer.You keep using Claude Code, Codex, Gemini CLI as-is. No framework, no SDK, no rewrite.
Google A2A ProtocolWait for agents to adopt a new protocol spec. Designed for distributed, networked agents.Works today with any MCP agent. No protocol adoption needed.
Custom WebSocket / HTTP glueBuild and maintain your own IPC layer. Handle serialization, discovery, error handling.Zero infrastructure. tmux is the transport -- it's already running.
Shared files / pipesRoll your own convention. Each agent needs custom tooling to read/write.Standard MCP tools. Any agent that speaks MCP gets cross-pane superpowers instantly.

The key insight: you don't need a multi-agent framework. You need your existing agents to see each other. tmux-bridge adds exactly that -- a thin MCP layer over tmux -- and nothing more.

🚀 Quick Start

Prerequisites: tmux 3.2+ and Node.js 18+ must be installed.

One command to configure all your agents:

bash
npx tmux-bridge-mcp setup

This auto-detects Claude Code, Codex, OpenCode, CodeBuddy, Copilot CLI, Grok Build, Gemini CLI, and Kimi CLI on your machine, then writes the correct MCP config for each one. Done in seconds.

Verify it works:

bash
npx tmux-bridge-mcp --help

You should see the version and available commands. Restart your AI agent to activate the new tools.

See it in action:

bash
npx tmux-bridge-mcp demo

Opens a 3-pane tmux session and runs a live cross-pane communication demo.

1. Install tmux

bash
brew install tmux    # macOS
apt install tmux     # Linux

2. Add to your agent's MCP config

json
{
  "mcpServers": {
    "tmux-bridge": {
      "command": "npx",
      "args": ["-y", "tmux-bridge-mcp"]
    }
  }
}

Restart your agent. It now has 9 MCP tools for cross-pane communication.

🔄 Updating

bash
# If installed globally
npm update -g tmux-bridge-mcp

# If using npx (auto-updates, but to force latest)
npx tmux-bridge-mcp@latest

# Check your current version
npx tmux-bridge-mcp --version

After updating, restart your agents to pick up the new version. If you use npx in your MCP config, it caches the package — run npx --yes tmux-bridge-mcp@latest once to pull the latest, then your agents will use it on next startup.

🏗️ How It Works

Layered Architecture

tmux-bridge runs as an MCP server over stdio. It calls tmux directly (capture-pane, send-keys, list-panes, etc.) -- no intermediate CLI layer.

MCP path (Gemini, Claude Code, Codex, any MCP client):
+--------------+  MCP/stdio  +---------------+  tmux API  +--------------+
|  MCP Agent   |<----------->|  tmux-bridge  |<---------->|  tmux panes  |
+--------------+             |  MCP server   |            +--------------+
                             +---------------+

CLI path (Kimi):
+--------------+  --print    +---------------+  tmux API  +--------------+
|  Kimi CLI    |<----------->|  kimi-tmux    |<---------->|  tmux panes  |
+--------------+  tool parse |  adapter      |            +--------------+
                             +---------------+

Architecture

All cross-pane interactions follow the read-act-read workflow:

Read-Act-Read Workflow

StepActionPurpose
1tmux_readRead target pane (satisfies read guard)
2tmux_message / tmux_typeType your message or command
3tmux_readVerify text landed correctly
4tmux_keysPress Enter to submit
--STOPDon't poll. The other agent replies directly into your pane.

The read guard is enforced at the MCP layer: tmux_type, tmux_message, and tmux_keys will fail unless you call tmux_read on the target pane first.

⚙️ Setup Per Agent

Gemini CLI (native MCP)

Add to ~/.gemini/settings.json:

json
{
  "mcpServers": {
    "tmux-bridge": {
      "command": "npx",
      "args": ["tmux-bridge-mcp"]
    }
  }
}

Claude Code (native MCP)

Add to your project's .mcp.json or global MCP config:

json
{
  "mcpServers": {
    "tmux-bridge": {
      "command": "npx",
      "args": ["tmux-bridge-mcp"]
    }
  }
}

Codex (native MCP)

Add to your MCP config following the Codex MCP setup docs:

json
{
  "mcpServers": {
    "tmux-bridge": {
      "command": "npx",
      "args": ["tmux-bridge-mcp"]
    }
  }
}

OpenCode

opencode mcp add is interactive. tmux-bridge-mcp setup writes directly to ~/.config/opencode/opencode.json (or .jsonc):

json
{
  "mcp": {
    "tmux-bridge": {
      "type": "local",
      "command": ["npx", "-y", "tmux-bridge-mcp"],
      "enabled": true
    }
  }
}

CodeBuddy (Tencent)

bash
codebuddy mcp add -s user tmux-bridge -- npx -y tmux-bridge-mcp

Fallback config path: ~/.codebuddy/.mcp.json (standard mcpServers JSON).

GitHub Copilot CLI

bash
copilot mcp add tmux-bridge -- npx -y tmux-bridge-mcp

Fallback config path: ~/.copilot/mcp-config.json:

json
{
  "mcpServers": {
    "tmux-bridge": {
      "type": "local",
      "command": "npx",
      "args": ["-y", "tmux-bridge-mcp"],
      "tools": ["*"]
    }
  }
}

Grok Build

bash
grok mcp add -s user tmux-bridge -- npx -y tmux-bridge-mcp

Fallback TOML in ~/.grok/config.toml:

toml
[mcp_servers.tmux-bridge]
command = "npx"
args = [
    "-y",
    "tmux-bridge-mcp",
]
enabled = true

Kimi CLI

bash
# Check your Kimi version
kimi --version
# v1.26+ → use native MCP (recommended)
# older  → use kimi-tmux wrapper

Native MCP (recommended, v1.26+):

bash
kimi mcp add tmux-bridge -- npx tmux-bridge-mcp

Once added, Kimi uses all tmux-bridge tools directly -- no adapter needed.

Legacy wrapper (older versions):

For Kimi CLI versions without native MCP, kimi-tmux bridges the gap by injecting the system instruction as a prompt, running Kimi in --print mode, parsing tool-call blocks from output, and executing them via tmux.

bash
kimi-tmux "list all tmux panes"
kimi-tmux "ask the agent in codex pane to review src/auth.ts"
kimi-tmux "read what claude is working on"
kimi-tmux --rounds 3 "send a message to gemini and wait for the result"

Kimi CLI Bridging

🔧 Tools Reference

ToolDescription
tmux_listList all panes with target ID, process, label, and working directory
tmux_readRead last N lines from a pane (satisfies read guard)
tmux_typeType text into a pane without pressing Enter (requires prior read)
tmux_messageSend message with auto-prepended sender info (requires prior read)
tmux_keysSend special keys -- Enter, Escape, C-c, etc. (requires prior read)
tmux_nameLabel a pane for easy targeting (e.g., "claude", "gemini")
tmux_resolveLook up pane ID by label
tmux_idPrint current pane's tmux ID
tmux_doctorDiagnose tmux connectivity issues

Targets can be a pane ID (%0), session:window.pane (main:0.1), or a label (claude).

📖 Examples

Ask Claude to review a file (from Gemini)

tmux_list()
tmux_read(target="claude", lines=20)
tmux_message(target="claude", text="Please review src/auth.ts for security issues")
tmux_read(target="claude", lines=5)
tmux_keys(target="claude", keys=["Enter"])

Multi-agent coordination (from Kimi)

bash
kimi-tmux "tell the claude pane to run the test suite"
kimi-tmux "ask gemini to summarize the test results in claude's pane"

Multi-agent layout

+-----------------------------------------------------------+
| tmux session                                              |
|                                                           |
| +------------+ +------------+ +----------+ +-----------+  |
| | Claude Code | |   Codex    | | Gemini   | |   Kimi    | |
| |  (MCP)     | |  (MCP)     | |  (MCP)   | |(kimi-tmux)| |
| |            | |            | |          | |           |  |
| | label:     | | label:     | | label:   | | label:    |  |
| | claude     | | codex      | | gemini   | | kimi      |  |
| +-----+------+ +-----+------+ +----+-----+ +-----+-----+ |
|       +---------------+-----------+--------------+        |
|           tmux-bridge (direct tmux IPC, no deps)          |
+-----------------------------------------------------------+

🌐 Environment Variables

VariableDescriptionDefault
TMUX_BRIDGE_SOCKETOverride tmux server socket pathAuto-detected from $TMUX
KIMI_PATHPath to kimi binary (kimi-tmux only)kimi (in PATH)

🔒 Security Model

tmux-bridge is designed for local development on a single machine. It assumes all connected MCP agents are trusted:

  • Any agent can read from or write to any pane in the tmux server — there is no per-pane access control.
  • The read guard (must tmux_read before tmux_type/tmux_keys) is a sequencing aid to prevent blind typing. It is not a security boundary.
  • Pane labels set via tmux_name are not authenticated — any agent can label or relabel any pane.
  • There is no encryption or authentication between agents. Communication happens through tmux's own IPC (Unix socket).

Do not use tmux-bridge in multi-tenant environments or expose the tmux socket over a network. It is built for the common case: one developer running multiple AI agents side by side on their own machine.

📝 System Instruction

For agents that support custom system prompts, use system-instruction/smux-skill.md. It teaches the read-act-read workflow and documents all available MCP tools.

🔗 Related Projects

ProjectApproachFocus
smuxtmux skill + bash CLIAgent-agnostic tmux setup
agent-bridgeWebSocket daemon + MCP pluginClaude Code <-> Codex
tmux-bridge-mcp (this)Standalone MCP server + direct tmuxAny agent, zero deps beyond tmux

smux vs tmux-bridge-mcp

Dimensionsmuxtmux-bridge-mcp (this)
🔌 How agents connectAgent runs bash commands (tmux-bridge read/type/keys)Agent uses MCP tool calls (tmux_read/tmux_type/tmux_keys)
🚀 Agent onboardingInstall skill or inject system prompt to teach bash commandsAdd MCP config JSON -- agent auto-discovers 9 tools
📦 Prerequisitescurl | bash installs tmux + tmux.conf + CLI scriptJust tmux + Node.js, npx to run
⚙️ tmux configurationShips full tmux.conf (keybindings, mouse, status bar)Doesn't touch tmux.conf -- no config conflicts
🛡️ Read guardBash CLI layer (/tmp file lock)MCP server layer (/tmp file lock, same concept)
💻 LanguageBash (~300 LOC)TypeScript (~600 LOC)
📥 Installcurl | bash, writes to ~/.smux/npm install -g or npx
🤝 Agent compatibilityAny agent that can run bash (needs skill/prompt)Any agent with MCP support (standard protocol)

👉 When to use smux: You want a complete tmux setup (keybindings, mouse support, status bar) and your agents support the skills system or you're comfortable injecting system prompts.

👉 When to use tmux-bridge-mcp: You want a drop-in MCP server that works with any MCP-compatible agent out of the box, without touching your tmux configuration.

tmux-bridge (/tmb) vs Claude Code Native (subagent + /codex + /gemini)

Dimensiontmux-bridgeClaude Code Native
Context isolationEach pane has its own full conversation context, persists across interactionssubagent spawns fresh each time, gone when it finishes
PersistencePane stays alive, accumulates conversation historyFire-and-forget, must re-provide context next time
ParallelismTruly independent processes, no interferenceAgent tool can parallelize, but shares billing/rate limits
Model diversityEach pane can run a different CLI (Codex, Gemini, Kimi)/codex /gemini can do this too -- not a real differentiator
Communication overheadGoes through tmux read/send, has latency, messages may get truncatedNative tool calls, structured returns, high reliability
Result integrationYou must read pane output, parse, and synthesize manuallysubagent returns structured results directly, ready to use
Operational complexityExtra layer of tmux management (labels, pane IDs)One tool call, done
CostEach pane consumes its own token budget independentlysubagent shares the same session's token pool

Verdict

tmux-bridge's real advantage comes down to one thing: persistent context. If you need an agent that remembers the last 30 turns of conversation and keeps following up on the same task, a tmux pane can do that -- a subagent cannot.

But for most tasks, native is better:

  • Communication is more reliable (no tmux buffer truncation)
  • Results are structured -- no need to parse terminal output
  • Simpler to operate, one less layer of abstraction

Practical guidance:

  • Short-lived, one-off tasks → native subagent / /codex / /gemini
  • Long-running sessions that need accumulated context (e.g., a reviewer continuously following the same PR) → tmux-bridge adds real value
  • A multi-pane multi-role layout only pays off if each role genuinely needs cross-conversation state -- otherwise the overhead outweighs the benefit

📄 License

MIT

安装

TypingMind
{
  "mcpServers": {
    "tmux-bridge-mcp": {
      "command": "npx",
      "args": [
        "@anthropic-fans/tmux-bridge"
      ]
    }
  }
}

将 Tmux Bridge MCP MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Tmux Bridge MCP 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 Tmux Bridge MCP 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Tmux Bridge MCP MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "tmux-bridge-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@anthropic-fans/tmux-bridge"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Tmux Bridge MCP MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Tmux Bridge MCP MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Tmux Bridge MCP 帮我完成这项任务吗?
Tmux Bridge MCP
当然,我看过了。
以下是我使用 Tmux Bridge MCP 得到的结果。

常见问题

Tmux Bridge MCP MCP 服务器有什么用途?

Tmux Bridge MCP 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Tmux Bridge MCP MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 Tmux Bridge MCP。

为什么在 TypingMind 中使用 Tmux Bridge MCP MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 Tmux Bridge MCP 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Tmux Bridge MCP MCP 连接到 TypingMind?

Tmux Bridge MCP 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Tmux Bridge MCP MCP 在 TypingMind 中提供哪些工具?

Tmux Bridge MCP 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Tmux Bridge MCP MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 Tmux Bridge MCP 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇