About Tmux MCP
Tmux MCP is an MCP server published by yuki-yano in the Developer Tools category: mCP server: Tmux MCP.
The repository has 1 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/yuki-yano/tmux-mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Tmux MCP
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- !No dynamic code executionSource scan found eval or shell execution. Review how tool inputs reach it before granting credentials.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
Tmux MCP Server
A Bun/Node-compatible TypeScript toolkit that exposes tmux pane context and logs through the Model Context Protocol (MCP). It lets MCP-compatible assistants inspect and troubleshoot your live tmux session.
Requirements
- Node.js 20+
- Bun 1.2+
- tmux installed on the host machine
Configure MCP Agents
MCP-capable tools should launch the server themselves. Configure each agent to run bunx @yuki-yano/tmux-mcp@latest (or npx @yuki-yano/tmux-mcp@latest) as a command provider; there is no need to start the server manually.
MCP Tool Reference
All tools live under the tmux namespace. Validation is handled with Zod; requests outside these shapes are rejected and surface as tool call failed errors.
tmux.describe-context
- Purpose: identify the most relevant tmux pane and provide ranked alternatives.
- Request fields (optional):
paneHint: string matched against pane id/title/session/window/command.tags: string[] placeholder for future tagged panes (accepted but unused).
- Response:
{ primaryPane, candidates }where each pane includes{ id, title, session, window, command? }.
tmux.fetch-log
- Purpose: take a one-off log snapshot from a tmux pane or file.
- Required field:
modemust be"capture"or"file". - When to use: choose
mode: "capture"for panes,mode: "file"for local log files. Usetmux.stream-logfor anything that needs to keep streaming.
Capture mode (pane snapshot)
paneId— tmux pane id (for example"%305").lines— positive integer ≤ 10_000; defaults toTMUX_CONTEXT_CAPTURE_LINES(2000 if unset).filters— optionaltimeRange,keywords,levelsfilters.maskPatterns— strings or regex fragments replaced with***.summary— include{ totalLines, errorCount, firstErrorLine? }.
{ "mode": "capture", "paneId": "%305", "lines": 400 }
File mode (log tail)
filePath— absolute path to the log file; response exposes a readable stream.
{ "mode": "file", "filePath": "/var/log/app.log" }
Info: Passing
mode: "tail"ormode: "stream"triggers a validation error. For live streaming calltmux.stream-log.
tmux.stream-log
- Purpose: manage a live
pipe-panestream. - Start:
{ "mode": "stream", "paneId": "%1" }(the optionalaction: "start"is ignored). - Stop:
{ "mode": "stream", "action": "stop", "streamId": "...", "stopToken": "..." }using theidandstopTokenreturned when you started the stream. - Responses:
{ id, stopToken }for both start and stop. - Errors:
paneId is required,Stream not found: ...,Invalid stop token.
Typical Failure Scenarios
- Missing required fields (
paneId is required,filePath is required). - Unsupported
modestrings supplied tofetch-log(the error message includes the valid options). - Using a stale or incorrect
stopTokenwhen stopping a stream.
Example Calls
tmux.describe-context { "paneHint": "%3" }
// Start then stop a live stream (generic MCP JSON-RPC)
{
"name": "tmux.stream-log",
"arguments": { "mode": "stream", "paneId": "%1" }
}
{
"name": "tmux.stream-log",
"arguments": { "mode": "stream", "action": "stop", "streamId": "…", "stopToken": "…" }
}
Optional Local Installation
If you need to bundle the server with other tooling:
npm install @yuki-yano/tmux-mcp
# or
bun add @yuki-yano/tmux-mcp
Once installed locally, the executable name is tmux-mcp, so npx tmux-mcp or bunx tmux-mcp will resolve to the same CLI.
Configuration
Environment variables tweak runtime behaviour:
| Variable | Description |
|---|---|
TMUX_CONTEXT_TMUX_PATH |
Absolute path to the tmux binary (falls back to $TMUX or tmux). |
TMUX_CONTEXT_CAPTURE_LINES |
Default capture-pane line count (defaults to 2000). |
TMUX_CONTEXT_AUDIT_PATH |
File destination for JSON Lines audit logs (defaults to STDOUT). |
NODE_ENV |
When test, suppresses info logs for cleaner test output. |
Developer Notes (for contributors)
- Source lives in
src/and follows a functional style (no classes or interfaces). src/index.tswires dependencies;src/sdk-server.tsregisters MCP tools via@modelcontextprotocol/sdk.- Supporting modules handle tmux integration, log formatting, file tailing, configuration, and auditing.
- Tests in
tests/mock external processes/files so they run without tmux. bun run ciexecutes formatting, type checks, lint, and tests before publishing.
README fetched from the repository 7 days ago. The original is authoritative.