MCPconceptHome

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Edit this page on GitHub

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 ~/.local

Then register:

$ claude mcp add tmux -- /absolute/path/to/libtmux-mcp-server

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.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 ~/.local

Then register:

$ claude mcp add tmux --scope user -- /absolute/path/to/libtmux-mcp-server

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.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 ~/.local

Then register:

$ claude mcp add tmux --scope project -- /absolute/path/to/libtmux-mcp-server

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: .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 ~/.local

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp-server"
        }
    }
}

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 ~/.local

Then register:

$ codex mcp add tmux -- /absolute/path/to/libtmux-mcp-server

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

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 ~/.local

Then register:

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

[mcp_servers.tmux]
command = "/absolute/path/to/libtmux-mcp-server"

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 ~/.local

Then register:

$ gemini mcp add --scope user tmux /absolute/path/to/libtmux-mcp-server

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/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 ~/.local

Then register:

$ gemini mcp add --scope project tmux /absolute/path/to/libtmux-mcp-server

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/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 ~/.local

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp-server"
        }
    }
}

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 ~/.local

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp-server"
        }
    }
}

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 ~/.local

Then register:

$ grok mcp add --scope user tmux -- /absolute/path/to/libtmux-mcp-server

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: ~/.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 ~/.local

Then register:

$ grok mcp add --scope project tmux -- /absolute/path/to/libtmux-mcp-server

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: ./.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 ~/.local

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp-server"
        }
    }
}

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 ~/.local

Then register:

$ opencode mcp add tmux -- /absolute/path/to/libtmux-mcp-server

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: ~/.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.

Executable and platform contract.

Esc

Type to search.

Reference preview Open reference