tmux MCP for C++
Install
Choose your client and configuration scope, then run the command or paste the configuration.
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ claude mcp add tmux -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.claude.json (this project)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ claude mcp add tmux --scope user -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.claude.json (all projects)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ claude mcp add tmux --scope project -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: .mcp.json (in repo, version-controlled)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen use this config:
The MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: claude_desktop_config.json
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ codex mcp add tmux -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.codex/config.toml
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
The MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: .codex/config.toml (in repo)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ gemini mcp add --scope user tmux /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.gemini/settings.json
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ gemini mcp add --scope project tmux /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: .gemini/settings.json (in repo)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen use this config:
The MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: .cursor/mcp.json (in repo)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen use this config:
The MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.cursor/mcp.json
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ grok mcp add --scope user tmux -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.grok/config.toml
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ grok mcp add --scope project tmux -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ./.grok/config.toml (in repo)
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen use this config:
The MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.gemini/config/mcp_config.json
Build or install the server first:
$ cmake -S . -B build/mcp -DLIBTMUX_BUILD_MCP_SERVER=ON -DLIBTMUX_FETCH_DEPS=ON && cmake --build build/mcp && cmake --install build/mcp --prefix ~/.localThen register:
$ opencode mcp add tmux -- /absolute/path/to/libtmux-mcp-serverThe MCP server is a build option rather than a second package, off by default because it is the only component that needs the JSON dependency. The install above puts libtmux-mcp-server in ~/.local/bin; use its full path.
Config file: ~/.config/opencode/opencode.jsonc
libtmux-mcp-server is a native executable that exposes tmux through
MCP over standard input and output. It is an optional consumer of the C++
library, enabled separately in the CMake build.
The catalog exposes discovery, creation, capture, input, search, and bounded text waits. Native Windows advertises the same catalog, with unsupported psmux operations failing explicitly at dispatch.
Start here¶
- Install points an MCP client at this server.
- Tools lists the MCP operations, arguments, and results.
- Guides build the executable and select an endpoint.
- Topics explain platform coverage, identifiers, and failures.
- Examples call a tool, then explore server internals.
- Language API documents embedding and implementation types.
Toolsets and exact tool names select the startup surface. The static
tmux://capabilities resource reports it; workflow prompts and dynamic
resource templates are absent.
The Workspace Manager is another source consumer. Its configuration types are not part of the installed core API, and the MCP server does not include a workspace-file operation.