# tmux MCP for Go

Source: https://libtmux.org/en/go/latest/mcp/

> Connect an MCP client to tmux and read structured results from complete Go programs.

**MCP concept example** A working example of the core library. It can change without notice.

[`github.com/libtmux/libtmux-go/mcp`](https://github.com/libtmux/libtmux-go/blob/6e7420927f4cb717fe089a710328e44e8d551025/mcp/README.md)
is a separate Go module that exposes
tmux through MCP. Its executable is `libtmux-mcp`. Installing the core
tmux module does not install this server or its protocol dependencies.

The server requires Go 1.26 or newer to build and tmux 3.3a or newer to run.
The MCP client launches `libtmux-mcp` and exchanges messages over stdin and
stdout. The server selects one tmux endpoint and its offered tools at startup.
Reconnect after changing that configuration.

## Start here

- [Install](https://libtmux.org/en/go/latest/mcp/#install) points an MCP client at this server.
- [Tools](https://libtmux.org/en/go/latest/mcp/tools/) lists the MCP operations, arguments, and results.
- [Guides](https://libtmux.org/en/go/latest/mcp/guides/) install the command and diagnose its connection.
- [Topics](https://libtmux.org/en/go/latest/mcp/topics/) explain toolsets, command waits, and capability discovery.
- [Examples](https://libtmux.org/en/go/latest/mcp/examples/) include complete client programs and their setup.
- [Language API](https://libtmux.org/en/go/latest/mcp/reference/) documents embedding and implementation types.

Read [`tmux://capabilities`](<https://libtmux.org/en/go/latest/mcp/resources/tmux-capabilities/>) for the effective startup selection. The
[Workspace Manager](https://libtmux.org/en/go/latest/workspace/) is a separate module; the current MCP
catalog does not include a workspace-file operation.

[Module contract](https://github.com/libtmux/libtmux-go/blob/6e7420927f4cb717fe089a710328e44e8d551025/mcp/README.md).

- [Connect a client](https://libtmux.org/en/go/latest/mcp/guides/connect-client/): Install the executable, select a socket, and diagnose startup.
- [Tool selection](https://libtmux.org/en/go/latest/mcp/topics/tool-selection/): Choose toolsets, individual tools, and exclusions.
- [List sessions](https://libtmux.org/en/go/latest/mcp/examples/inspect-sessions/): Run a complete SDK client against its own tmux server.
- [Run a command](https://libtmux.org/en/go/latest/mcp/examples/run-command/): Check command completion, exit status, and captured output.
