tmux-mcp
Allows executing shell commands in a persistent tmux session from GitHub Copilot CLI, including reading terminal output and sending control signals.
Click on "Install 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-mcprun the smoke test suite and show results"
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.
Project BareMetal-Tmux
A decoupled, stateful, interactive MCP (Model Context Protocol) Tmux tool.
It exposes a persistent host tmux session to MCP clients — GitHub Copilot CLI,
ForgeCode, VS Code — over the stdio transport. No containers, no network: raw
JSON-RPC text streams straight into bare-metal shell execution.
Interactive terminal state survives agent crashes, context compaction reloads,
and framework restarts, because the shell lives in a detached tmux session
(local_agent_workspace) owned by the host — not by the agent process.
Architecture
Upstream Client (Copilot CLI / ForgeCode / VS Code)
│ spawns subprocess, speaks JSON-RPC over stdio
▼
Local MCP Server (server.py — Python 3.11+, fastmcp)
│ validates schemas, applies SR-01 safety checks, strips ANSI
▼
Host OS Shell (persistent detached tmux session, 20k-line scrollback)Related MCP server: Ryan's Tmux MCP Server
MCP Tools
Tool | Arguments | Purpose |
|
| Dispatch a literal shell command into the persistent pane, followed by a carriage return ( |
|
| Capture trailing scrollback from the pane, with ANSI/OSC/control sequences stripped so payloads always encode cleanly into JSON-RPC. |
|
| Send |
The session is created lazily on first tool invocation (FR-01) with a 20,000-line history limit.
Safety Guardrails (SR-01)
Execution is un-sandboxed on the host, so the server refuses destructive commands before they reach the tmux buffer:
Recursive
rmaimed at/or top-level system roots (/usr,/etc, …), includingsudo-wrapped and&&/;-chained variants--no-preserve-root,mkfs.*,dd of=/dev/..., redirects onto block devices, fork-bomb signatures
Workspace-scoped destruction (e.g. rm -rf ./build, /tmp/...) passes through.
Requirements
Windows host: WSL distro
Ubuntu-24.04withtmuxinstalled (the server runs inside WSL; clients launch it viawsl.exe)Linux/macOS host: just
tmuxonPATH— drop thewsl.exewrapper and runuv run python server.pydirectlyuv (installed user-locally, e.g.
curl -LsSf https://astral.sh/uv/install.sh | sh)Python ≥ 3.11 (resolved by uv)
Setup
Dependencies are isolated in a uv-managed venv. On WSL, keep the venv on ext4
(not /mnt/c) for speed:
cd /mnt/c/Users/troll/Python/tmux-harness
export UV_PROJECT_ENVIRONMENT="$HOME/.venvs/tmux-harness"
uv syncRun the smoke test (28 checks: ANSI stripping, SR-01 guardrails, live tmux round-trips against a throwaway session):
TMUX=harness_smoke_test uv run python tests/smoke_test.pyClient Integration
GitHub Copilot CLI
Two options:
Custom agent (recommended) — .github/agents/tmux.agent.md is a self-contained agent profile: it defines the MCP server in its frontmatter and allowlists only the three harness tools (no shell, no file edits, no web). Use it with:
/agent # pick "tmux" interactively copilot --agent=tmux -p "run the test suite and watch for failures"Global MCP server — merge mcp-config.copilot.json into
~/.copilot/mcp-config.jsonto expose the harness tools in every session (all built-in tools remain available).
ForgeCode
.mcp.json sits at the project root and is picked up automatically when ForgeCode runs from this directory.
VS Code
Add the same server block from .mcp.json to .vscode/mcp.json.
Configuration
Variable | Default | Effect |
|
| Name of the persistent tmux session |
|
| Venv location (keep on ext4 under WSL) |
Project Layout
server.py MCP server (tools, SR-01 checks, ANSI stripping)
pyproject.toml uv project: mcp[cli] + fastmcp
tests/smoke_test.py 28-check verification suite
.github/agents/tmux.agent.md Copilot CLI custom agent (harness tools only)
mcp-config.copilot.json Copilot CLI global MCP config
.mcp.json ForgeCode project-root MCP configAvailable Tools
3 toolsexecute_commandA
Dispatch a raw shell command string into the persistent background workspace pane (FR-02). The text is sent literally, then a carriage return (C-m) is appended to ensure statement completion.
By default output is NOT returned — poll read_terminal_buffer to observe
results. Pass wait_s > 0 to sleep that many seconds (capped at 30.0)
after dispatch and get the trailing buffer back in the same call —
ideal for quick commands. Long jobs should still dispatch, then poll.
| Name | Required | Description | Default |
|---|---|---|---|
| wait_s | No | ||
| command | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully carries the burden. It discloses that output is not returned by default, carriage return appended, wait_s capped at 30s, and the persistent pane. It doesn't mention destructiveness but shell commands inherently imply that.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured but slightly verbose. Each sentence adds value: purpose, mechanics, default behavior, and alternatives. Could be trimmed slightly but still clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters, no annotations, and an output schema (not shown), the description covers behavior, usage patterns, and alternatives. It references the workspace pane and provides complete guidance for using the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must compensate. It explains command is sent literally with carriage return, and wait_s allows sleeping and returning trailing buffer, adding meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Dispatch a raw shell command string into the persistent background workspace pane (FR-02)', using a specific verb and resource. It distinguishes from siblings like read_terminal_buffer (for reading output) and send_control_signal (for signals).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells when to use wait_s (>0 for quick commands) and when to poll (long jobs). It names the alternative tool read_terminal_buffer for observing results, giving clear usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_terminal_bufferA
Capture trailing scrollback from the active tmux pane (FR-03).
Hard-wrapped rows are joined and trailing blank viewport padding is
trimmed before the payload is returned.
Args:
lines: Number of trailing scrollback lines to capture (default 100,
max 20000).
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that hard-wrapped rows are joined, trailing blank viewport padding is trimmed, and the 'lines' parameter has default 100 and max 20000. It lacks statements about auth or rate limits, but as a read operation, the behavior is well-covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise: one sentence for purpose, one paragraph for processing details. Every sentence adds value, and it avoids redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional parameter, output schema present), the description is fully complete. It covers purpose, processing, parameter meaning, and bounds. No gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description adds significant meaning: it explains that 'lines' is the number of trailing scrollback lines to capture, with default 100 and max 20000. This compensates for the schema's minimal information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'capture' and resource 'trailing scrollback from the active tmux pane', clearly distinguishing it from siblings like execute_command and send_control_signal. It also details processing steps (joining rows, trimming padding) for precision.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly state when to use this tool vs alternatives, but the context of siblings (execute_command, send_control_signal) makes usage implied. No explicit when-not or alternatives are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_control_signalA
Issue a control signal keystroke to the persistent pane (FR-04), e.g. SIGINT (Ctrl+C) to break out of a blocking process without killing the harness. Supported: SIGINT, SIGTSTP, SIGQUIT, EOF.
| Name | Required | Description | Default |
|---|---|---|---|
| signal | No | SIGINT |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description solely handles transparency. It lists supported signals and notes that SIGINT avoids killing the harness, but does not disclose that SIGQUIT may cause a core dump or other potential side effects. The description is missing behavioral details like authentication needs or error handling, earning a 3.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no superfluous words. The first sentence states the action, and the second lists supported signals. The description is perfectly front-loaded and efficiently uses space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool, the description covers the essential aspects: what it does, when to use it, and supported values. It references 'persistent pane (FR-04)' which may be assumed context. An output schema exists, so return values are not required. Minor gaps (e.g., error handling) prevent a 5.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has only one parameter with no description (0% coverage). The description adds value by listing supported signal values and explaining their effects (e.g., Ctrl+C for SIGINT). This compensates for the schema gap, though it could include an explicit allowed values list.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly specifies the action ('issue a control signal keystroke'), the target ('persistent pane (FR-04)'), and provides concrete examples. It distinguishes itself from siblings (execute_command, read_terminal_buffer) by focusing on sending signals rather than executing commands or reading output.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear use case 'break out of a blocking process without killing the harness', implying when to use it. However, it does not explicitly contrast with alternatives or state when not to use it, but the context with sibling tools makes the distinction clear.
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.
3 tool updates
v0.1.0- First observed
execute_command - First observed
read_terminal_buffer - First observed
send_control_signal
TDQS
Each tool addresses a distinct action: sending commands, reading output, and sending control signals. There is no overlap in functionality.
All tool names follow a consistent verb_noun pattern in snake_case (execute_command, read_terminal_buffer, send_control_signal), with no deviations.
Three tools cover the essential interactions with a tmux pane (write, read, signal). This is well-scoped for a minimal but functional MCP server.
The tools cover the core workflow of dispatching commands and retrieving output. Missing operations like pane management or clearing the buffer are minor gaps given the focused scope.
Maintenance
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
Run commands and read/write files on your servers over Termalin's keyless tunnels (hosted MCP).
The official MCP Server for the Mux API
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
MCP server for Superserve sandboxes: create, exec, and manage Firecracker microVMs
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server for SSH and local terminal access. Supports interactive commands, long-running processes, and TUI apps like tmux/zellij63MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for tmux operations that provides comprehensive control over tmux sessions, windows, and panes.1-
- AlicenseBqualityBmaintenanceA 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.711MIT
- AlicenseAqualityDmaintenanceMCP server for orchestrating multiple Claude Code instances via tmux, enabling spawning, reading, sending, listing, and killing sessions.5182MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/trolleydodger1988/tmux-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server