MCPconceptGuides

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

Edit this page on GitHub

Connect a C++ MCP client

mcp_tools consumer 0.1.0 · Source

Build the optional MCP executable from the C++ repository, then configure the client to launch it. This guide targets POSIX tmux. Native Windows has separate psmux prerequisites and command-dependent support.

Build the executable

Use a toolchain supported by the repository’s C++23 or C++20 build. Enable the server and its JSON dependency:

Terminal window
$ cmake \
-S . \
-B build/mcp \
-DLIBTMUX_BUILD_MCP_SERVER=ON \
-DLIBTMUX_FETCH_DEPS=ON \
-DLIBTMUX_BUILD_TESTS=OFF \
-DLIBTMUX_BUILD_EXAMPLES=OFF

Build it:

Terminal window
$ cmake --build build/mcp

Install into the user’s local prefix:

Terminal window
$ cmake --install build/mcp \
--prefix ~/.local

Select the endpoint

Make the installed binary directory available to the MCP client. For clients using mcpServers:

{
"mcpServers": {
"tmux-cpp": {
"command": "libtmux-mcp-server",
"args": ["--socket-name", "docs-agent"]
}
}
}

Use --socket-path for an explicit POSIX socket path. Without a selector, the executable uses the dedicated libtmux-mcp socket and minimal configuration. Use --socket inherit to select an inherited TMUX route.

Verify the catalog

Have the client list tools, then call list_sessions. Retain the returned session, window, and pane identities for later calls.

Use LIBTMUX_TOOLSETS=inspect for discovery and reads. Read tmux://capabilities to inspect the startup selection; see Topics for exact tool inclusions and exclusions.

Build instructions and selector implementation.

Esc

Type to search.

Reference previewOpen reference