tmux MCP, built in Julia
tmux terminal control for AI agents, built on libtmux for Julia and ModelContextProtocol.jl. This server maps tmux's object hierarchy — sessions, windows, panes — into MCP tools. It offers only the tools selected when it starts.
tmux through MCP
tmux before the first call.
tmux after create_session.
tmux after send_keys.
tmux after list_panes: unchanged, the call only reads.
tmux after send_keys_and_wait.
tmux after send_keys_and_wait.
tmux after teardown_session.
Create a tmux session called checks, split its window into two panes, run pytest -q in one and show checks.log in the other, show me the results, then remove the session.
AgentCreate the session.
Result
{ "completed": true, "panes": [ { "paneId": "%1", "generation": "3f9a1c" } ], "sessionId": "$1", "generation": "3f9a1c", "ownership": "application"}AgentThis server has no split tool, so split from inside the pane the create result returned (%1) with tmux itself.
send_keys Execute {"target":{"paneId":"%1","generation":"3f9a1c"},"keys":["tmux split-window -h sh","Enter"]} Result
{ "completed": true, "generationGuarantee": "best_effort", "target": { "paneId": "%1", "generation": "3f9a1c" }}AgentList the panes of the session the create result returned ($1); each carries its position and size.
Result
{ "coverage": "session_scope", "contextsCoverage": "selected_session", "terminalContent": "data", "nextOffset": null, "pagination": "verified_discovery_facets", "generationGuarantee": "best_effort", "panes": [ { "contextsTruncated": false, "width": 40, "caller": false, "contexts": [ { "sessionName": "checks", "windowName": "sh", "windowIndex": 0, "sessionId": "$1", "windowId": "@1" } ], "height": 24, "fieldsTruncated": false, "title": "host", "active": false, "dead": false, "command": "sh", "target": { "paneId": "%1", "generation": "3f9a1c" } }, { "contextsTruncated": false, "width": 39, "caller": false, "contexts": [ { "sessionName": "checks", "windowName": "sh", "windowIndex": 0, "sessionId": "$1", "windowId": "@1" } ], "height": 24, "fieldsTruncated": false, "title": "host", "active": true, "dead": false, "command": "sh", "target": { "paneId": "%2", "generation": "3f9a1c" } } ], "total": 2, "nextPageToken": null, "truncated": false}AgentRun the tests in the pane the create result returned (%1) and wait for the summary.
send_keys_and_wait Execute {"target":{"paneId":"%1","generation":"3f9a1c"},"keys":["pytest -q","Enter"],"text":"2 passed"} Result
{ "matched": true, "source": "output", "terminalContent": "data", "evidence": "literal_text", "continuity": "stream", "text": "2 passed", "generationGuarantee": "best_effort", "keysSent": true, "target": { "paneId": "%1", "generation": "3f9a1c" }}AgentShow the log in the new pane the list returned (%2) and wait for its last line.
send_keys_and_wait Execute {"target":{"paneId":"%2","generation":"3f9a1c"},"keys":["cat checks.log","Enter"],"text":"checks finished"} Result
{ "matched": true, "source": "output", "terminalContent": "data", "evidence": "literal_text", "continuity": "stream", "text": "checks finished", "generationGuarantee": "best_effort", "keysSent": true, "target": { "paneId": "%2", "generation": "3f9a1c" }}AgentRemove the session by the id the create result returned ($1).
Result
{ "completed": true, "sessionId": "$1", "generation": "3f9a1c"}pytest printed 2 passed and checks.log ends with checks finished. I removed the checks session.
Install
Choose your client and configuration scope, then run the command or paste the configuration.
$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
--scope user \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
--scope project \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ codex mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'[mcp_servers.tmux]
command = "/absolute/path/to/project/bin/libtmux-mcp"
args = ["--socket", "/absolute/path/to/tmux.sock"]$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ gemini mcp add \
--scope user \
tmux /absolute/path/to/project/bin/libtmux-mcp \
-- --socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ gemini mcp add \
--scope project \
tmux /absolute/path/to/project/bin/libtmux-mcp \
-- --socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ grok mcp add \
--scope user \
tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ grok mcp add \
--scope project \
tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "0e761d353bc0606f69ad87994958d09a92c7f7d1"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ opencode mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sockWrites ~/.claude.json (this project).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.claude.json (all projects).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes .mcp.json (in repo, version-controlled).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.codex/config.toml.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.gemini/settings.json.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes .gemini/settings.json (in repo).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.grok/config.toml.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ./.grok/config.toml (in repo).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.config/opencode/opencode.jsonc.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
LibTmuxMCP serves a local tmux endpoint over standard input and output.
Select an existing server explicitly and configure the tools the client
may use. The application leaves the borrowed daemon and existing sessions
running when it closes.
The server guide covers package installation, launcher creation, endpoint selection and tool permissions. The API reference documents the Julia embedding surface.
Tools by tier
The Julia server groups its tools by what they request. A tier badge tells you how far a call reaches before you approve it.
Inspect
Request tmux state and terminal output.
-
capture_paneInspect Capture bounded UTF-8 pane text and truncation metadata. -
list_panesInspect Discover unique physical panes using generation-bound session/window scopes, native inert criteria and scalar columns. -
wait_for_textInspect Wait for a literal UTF-8 string.
Manage
Change tmux structure or presentation.
-
resize_paneManage Request pane width or height in cells.
Execute
Start or drive pane processes, or store state that can control later execution.
-
create_sessionExecute Start an argv command in a new application-owned session. -
paste_textExecute Paste UTF-8 text through a temporary owned buffer without adding Enter. -
send_keysExecute Send explicit key tokens or literal text to one captured target. -
send_keys_and_waitExecute Send explicit keys and wait for literal text.
Teardown
Delete tmux objects or retained scrollback. Not reversible.
-
kill_paneTeardown Destroy one explicitly authorized pane and its running process. -
run_operationsTeardown Run up to eight enabled tool calls sequentially after validating every item. -
teardown_sessionTeardown Destroy an exact generation-bound session created by this application.
Browse every tool, with its arguments, result and protocol data.