# tmux-mcp [Health: Active]

**Category:** 🖥️ Command Line  
**Repository:** https://github.com/fr1sk/tmux-mcp.git  
**GitHub Stars:** 1  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/tmux-mcp

## Description
MCP server for tmux — browse sessions, capture output, send commands.

## Tools
Capabilities this server exposes over MCP:

- **list_sessions** — Lists all active tmux sessions. No parameters.
- **list_windows** — Lists windows inside a session.
- **list_panes** — Lists panes inside a session or window.
- **capture_pane** — Captures the current terminal output of a pane.
- **send_keys** — Sends a command or key sequence to a pane and captures the result.
- **new_session** — Creates a new detached tmux session.
- **new_window** — Creates a new window inside an existing session.
- **split_pane** — Splits a pane into two.
- **kill_session** — Kills a session and all its windows and panes. **Destructive — cannot be undone.**
- **kill_window** — Kills a window and all its panes. **Destructive.**
- **kill_pane** — Kills a single pane and its running process. **Destructive.**
- **rename_session**
- **rename_window**

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/fr1sk/tmux-mcp.git), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install -g @fr1sk/tmux-mcp
```

## Documentation

## What the tmux-mcp MCP server does

tmux-mcp MCP server exposes local tmux control through MCP. An assistant can inspect active sessions, identify their windows and panes, read visible terminal output and scrollback, then send commands or key sequences to a selected pane. It can also create detached sessions, add windows, split panes, rename sessions or windows, and terminate sessions, windows, or panes.

The server is suited to development workflows involving persistent processes such as test runs, development servers, log viewers, or interactive shells. It lets an agent check output after starting a command instead of relying only on a direct shell invocation. The destructive termination tools should be treated as explicit cleanup operations: killing a session removes its windows and panes, while killing a pane also stops its running process.

## How it works

The tmux-mcp MCP server uses tmux's standard target notation. A session can be addressed by name, a window by `session:window`, and a pane by `session:window.pane`. A typical discovery sequence is `list_sessions`, followed by `list_windows`, then `list_panes`; the resulting target can be passed to `capture_pane` or `send_keys`.

`capture_pane` returns raw terminal text and accepts a requested scrollback length, with a maximum of 5,000 lines. `send_keys` can submit a shell command or tmux key notation such as `C-c`, `Escape`, or `Up`. It can optionally press Enter, wait before reading the pane, and return captured output. The wait setting is useful for commands that need time to produce results.

With `TMUX_MCP_ALWAYS_USE` set to `true`, the server can provide instructions for routing shell commands through a configured tmux session rather than direct Bash. `TMUX_MCP_DEFAULT_SESSION` identifies that session when this behavior is enabled.

## Setup and configuration

Install the package globally with:

```bash
npm install -g @fr1sk/tmux-mcp
```

The runtime requires Node.js 18 or newer and `tmux` available on `$PATH`. Configure an MCP client to launch the `tmux-mcp` executable as a local server. The supplied examples cover OpenCode, Claude Code, Cursor, and Windsurf. For clients using JSON MCP configuration, the command is generally represented as `tmux-mcp`; the exact configuration file depends on the client.

Optional environment settings can be placed in the client's server configuration:

- `TMUX_MCP_ALWAYS_USE`: set to `true` to route shell commands through tmux.
- `TMUX_MCP_DEFAULT_SESSION`: names the session used for that routing behavior.

Both settings are optional for ordinary tool use. When both are present, the server's configuration information includes instructions for using `send_keys` with the selected session.

## Tools and capabilities

The tool set includes:

- `list_sessions`, `list_windows`, and `list_panes` for discovering tmux state.
- `capture_pane` for reading terminal output.
- `send_keys` for commands and raw key sequences.
- `new_session`, `new_window`, and `split_pane` for creating terminal layout.
- `rename_session` and `rename_window` for stable labels.
- `kill_session`, `kill_window`, and `kill_pane` for cleanup.

Creation tools accept working directories, and session, window, or pane creation can start an initial command. Pane splits support horizontal or vertical direction and an optional percentage size.

## Limitations and notes

The tmux-mcp MCP server provides unrestricted local shell access through tmux. Commands sent to panes run with the user's shell permissions, and command parameters used during creation are passed to tmux without validation or sandboxing. Do not expose it to network-accessible MCP hosts or untrusted assistants.

Captured output may include secrets printed by terminal programs, including environment values, tokens, passwords, or private keys. Use the server only in trusted local development environments. Invalid targets and a missing tmux server are reported as readable errors rather than causing the server to crash, but those responses do not remove the need to verify targets before sending commands or using destructive tools.

_Full upstream README: https://allmcps.com/mcp/tmux-mcp/readme_

