A server that lets AI agents interact with tmux sessions via MCP using stdio
Configuration
View docs{
"mcpServers": {
"lox-tmux-mcp-server": {
"command": "go",
"args": [
"run",
"./cmd/tmux-mcp-server"
]
}
}
}You can run a dedicated MCP server that lets AI agents control and interact with tmux terminal sessions. This server communicates over standard input/output, exposing a set of tools to start, control, view, and close tmux sessions in a programmable way. It is useful when you want automated agents to manage terminal workflows, run commands, and capture screen content from any tmux session.
You will run the MCP server locally and connect to it from an MCP client. The server exposes a set of actions to manage tmux sessions: create a new session, send commands and keystrokes, capture the current screen, list all active sessions, join an existing session, and close a session. Use these actions in sequence to automate terminal tasks such as editing files, running commands, or performing interactive workflows inside tmux.
Prerequisites: Node, Python, or other runtime environments are not required for this server itself, but you must have Go installed to run it.
Install Go (1.22+ is sufficient for most environments). If you do not have Go installed, install it from the official source for your platform.
Install tmux on your system since the server relies on tmux to create and manage terminal sessions.
Run the MCP server locally using Go. Use the exact command shown to start the server.
To start the server, run:
go run ./cmd/tmux-mcp-serverCreate a new tmux session with a given name and optional initial command.
Send a sequence of commands and keystrokes to a specified tmux session, enabling interactive workflows.
Capture the current screen content of a tmux session for display or analysis.
List all active tmux sessions currently managed by the server.
Attach to or join an existing tmux session by name.
Terminate a tmux session and clean up resources.