tmux-bridge
Provides tools for managing and interacting with host tmux terminal multiplexer sessions, including session discovery, creation, termination, sending keystrokes, and capturing terminal buffers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tmux-bridgeinspect my tmux sessions and summarize what's running"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LibreChatTmuxBridge
Universal bidirectional bridge between LibreChat and host tmux terminal multiplexers. The bridge provides zero-token terminal streaming and FastMCP agent orchestration for persistent command line sessions and AI agent interfaces.
Technical Overview
Operating terminal sessions from mobile devices using standard SSH clients presents operational constraints:
On-screen keyboards obstruct terminal display area.
Control key combinations require complex secondary menus.
Mobile operating systems terminate background SSH connections during app switches.
Running agent processes in cold headless subprocesses discards conversational context.
LibreChatTmuxBridge resolves these constraints:
Direct Terminal Streaming: Uses an OpenAI-compatible
/v1/chat/completionsendpoint to send commands directly to tmux panes with zero token cost.Dynamic Session Discovery: Queries
tmux list-sessionsto populate the LibreChat model selector with running sessions.Session Management: Creates and terminates detached tmux sessions through interactive slash commands.
Agentic Copilot: Provides FastMCP tools (
/mcp/sse) allowing reasoning models to inspect terminal buffers and supervise processes.Desktop SSH Parity: Maintains native host tmux sessions, allowing instant attachment from desktop workstations over SSH.
Related MCP server: mcp-tmux
System Topology
flowchart TD
subgraph Mobile ["Mobile Client"]
LC["LibreChat Interface (:8451)<br/>(Browser or PWA)"]
end
subgraph Bridges ["Bridge Layer"]
OAI_BRIDGE["Tmux-OpenAI Bridge (:8035)<br/>(/v1/models, /v1/chat/completions)"]
TMUX_MCP["FastMCP Server (:8035/mcp)<br/>(Streamable HTTP / SSE)"]
end
subgraph Multiplexer ["Host Terminal Multiplexer"]
SESS_AGY["tmux: agy-work<br/>(Antigravity TUI)"]
SESS_OC["tmux: opencode<br/>(OpenCode TUI)"]
SESS_SHELL["tmux: infra<br/>(Host Shell)"]
end
subgraph Workstation ["Desktop Workstation"]
FZF["Host Terminal Client<br/>(tmux attach via fzf)"]
end
LC -->|"Direct Mode: /v1/chat/completions"| OAI_BRIDGE
LC -->|"Agentic Mode: MCP Tool Calls"| TMUX_MCP
OAI_BRIDGE -->|"tmux send-keys and capture-pane"| Multiplexer
TMUX_MCP -->|"tmux control commands"| Multiplexer
FZF -->|"tmux attach-session"| MultiplexerQuick Start
1. Installation
git clone git@github.com:spelech/LibreChatTmuxBridge.git
cd LibreChatTmuxBridge
uv sync2. Start the Daemon
uv run librechat-tmux-bridge start --host 0.0.0.0 --port 80353. Connect LibreChat
Add the configuration block to librechat.yaml:
endpoints:
custom:
- name: "Tmux Terminal"
apiKey: "sk-tmux"
baseURL: "http://10.0.0.10:8035/v1"
models:
default:
- tmux:new
fetch: true
titleConvo: true
modelDisplayLabel: "Host Tmux"
dropParams:
- stop
- temperature
mcpSettings:
allowedAddresses:
- 10.0.0.10:8035
mcpServers:
tmux-bridge:
type: sse
url: http://10.0.0.10:8035/mcp/sseRestart the LibreChat service:
docker compose restart librechatBuilt-In Slash Commands
Command | Usage | Description |
|
| Display active sessions with window counts and status |
|
| Create a detached session on the host |
|
| Terminate a tmux session |
|
| Send control keys ( |
|
| Display command reference list |
Test Coverage and Simulation
Code Coverage: Maintained at $\ge 94%$ statement coverage enforced through
pytest-cov.Simulation Harness: 50-turn closed-loop stress test with disturbance injection.
Integration Testing: Direct execution against the host
/usr/bin/tmuxbinary.
Run the test suite:
uv run pytestTechnical Documentation
Interactive documentation is hosted on the Agent Preview Hub:
Documentation Portal: https://spelech.github.io/LibreChatTmuxBridge/
ARCHITECTURE.md— Architectural specifications and pipeline designREQUIREMENTS.md— Traceability matrix and operational constraintsCHANGELOG.md— Version history and release notesROADMAP.md— Implementation roadmap
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
StremAI MCP: shared memory for AI coding agents. Connected agents can recall. OAuth + local stdio.
Docs for agent-manager, the terminal UI that runs AI coding agents as live tmux sessions.
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to manage local tmux sessions, including creating and controlling sessions, windows, and panes, sending commands, and capturing terminal output.166 npmDo What The F*ck You Want To Public
- AlicenseBqualityCmaintenanceA comprehensive MCP server for driving tmux sessions, windows, panes, sending keystrokes, and reading pane output locally or over SSH, enabling real-time collaborative pairing with AI.713MIT
- FlicenseAqualityDmaintenanceEnables AI agents to spawn, interact with, and orchestrate multiple concurrent terminal sessions via tmux.9-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to create and interact with isolated tmux terminal sessions in real time, supporting command execution, output capture, and session management.-