|
2 | 2 |
|
3 | 3 | # Quickstart |
4 | 4 |
|
5 | | -## Requirements |
| 5 | +One happy path from zero to a working tool invocation. |
6 | 6 |
|
7 | | -- Python 3.10+ |
8 | | -- tmux >= 3.2a |
9 | | -- [uv](https://docs.astral.sh/uv/) (recommended) or pip |
10 | | - |
11 | | -## Installation |
12 | | - |
13 | | -### One-liner with uvx |
14 | | - |
15 | | -**Claude Code:** |
| 7 | +## 1. Install |
16 | 8 |
|
17 | 9 | ```console |
18 | 10 | $ claude mcp add libtmux -- uvx libtmux-mcp |
19 | 11 | ``` |
20 | 12 |
|
21 | | -**Codex CLI:** |
| 13 | +Using a different client? See {ref}`installation` and {ref}`clients`. |
22 | 14 |
|
23 | | -```console |
24 | | -$ codex mcp add libtmux -- uvx libtmux-mcp |
25 | | -``` |
| 15 | +## 2. Verify |
26 | 16 |
|
27 | | -**Gemini CLI:** |
| 17 | +Ask your LLM: |
28 | 18 |
|
29 | | -```console |
30 | | -$ gemini mcp add libtmux uvx -- libtmux-mcp |
31 | | -``` |
| 19 | +> List all my tmux sessions and show me what's running in each pane. |
32 | 20 |
|
33 | | -### pip / uv pip |
| 21 | +The agent will call `list_sessions`, then `list_panes` and `capture_pane` to inspect your workspace. You should see your tmux sessions, windows, and pane contents in the response. |
34 | 22 |
|
35 | | -```console |
36 | | -$ uv pip install libtmux-mcp |
37 | | -``` |
| 23 | +## 3. Try it |
38 | 24 |
|
39 | | -```console |
40 | | -$ pip install libtmux-mcp |
41 | | -``` |
| 25 | +Here are a few things to try: |
42 | 26 |
|
43 | | -### Development install |
| 27 | +> Create a new tmux session called "workspace" with a window named "build". |
44 | 28 |
|
45 | | -```console |
46 | | -$ git clone https://github.com/tmux-python/libtmux-mcp.git |
47 | | -``` |
| 29 | +> Send `make test` to the pane in my build window, then wait for it to finish and capture the output. |
48 | 30 |
|
49 | | -```console |
50 | | -$ cd libtmux-mcp |
51 | | -``` |
52 | | - |
53 | | -```console |
54 | | -$ uv pip install -e "." |
55 | | -``` |
56 | | - |
57 | | -## Configuration |
58 | | - |
59 | | -### JSON config (all MCP clients) |
60 | | - |
61 | | -```json |
62 | | -{ |
63 | | - "mcpServers": { |
64 | | - "libtmux": { |
65 | | - "command": "uvx", |
66 | | - "args": ["libtmux-mcp"], |
67 | | - "env": { |
68 | | - "LIBTMUX_SOCKET": "ai_workspace" |
69 | | - } |
70 | | - } |
71 | | - } |
72 | | -} |
73 | | -``` |
74 | | - |
75 | | -| Tool | Config file | Format | |
76 | | -|------|-------------|--------| |
77 | | -| Claude Code | `.mcp.json` (project) or `~/.claude.json` (global) | JSON | |
78 | | -| Claude Desktop | `claude_desktop_config.json` | JSON | |
79 | | -| Codex CLI | `~/.codex/config.toml` | TOML | |
80 | | -| Gemini CLI | `~/.gemini/settings.json` | JSON | |
81 | | -| Cursor | `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global) | JSON | |
82 | | - |
83 | | -### Local checkout setup |
| 31 | +> Search all my panes for the word "error". |
84 | 32 |
|
85 | | -Point your tool at a local checkout for live development: |
| 33 | +## Next steps |
86 | 34 |
|
87 | | -**Claude Code:** |
88 | | - |
89 | | -```console |
90 | | -$ claude mcp add --scope user libtmux -- uv --directory ~/work/python/libtmux-mcp run libtmux-mcp |
91 | | -``` |
92 | | - |
93 | | -**Codex CLI:** |
94 | | - |
95 | | -```console |
96 | | -$ codex mcp add libtmux -- uv --directory ~/work/python/libtmux-mcp run libtmux-mcp |
97 | | -``` |
98 | | - |
99 | | -**Gemini CLI:** |
100 | | - |
101 | | -```console |
102 | | -$ gemini mcp add --scope user libtmux uv -- --directory ~/work/python/libtmux-mcp run libtmux-mcp |
103 | | -``` |
104 | | - |
105 | | -**Cursor** — add to `~/.cursor/mcp.json`: |
106 | | - |
107 | | -```json |
108 | | -{ |
109 | | - "mcpServers": { |
110 | | - "libtmux": { |
111 | | - "command": "uv", |
112 | | - "args": [ |
113 | | - "--directory", "~/work/python/libtmux-mcp", |
114 | | - "run", "libtmux-mcp" |
115 | | - ] |
116 | | - } |
117 | | - } |
118 | | -} |
119 | | -``` |
120 | | - |
121 | | -## Environment variables |
122 | | - |
123 | | -| Variable | Purpose | |
124 | | -|----------|---------| |
125 | | -| `LIBTMUX_SOCKET` | tmux socket name (`-L`). Isolates the MCP server to a specific socket. | |
126 | | -| `LIBTMUX_SOCKET_PATH` | tmux socket path (`-S`). Alternative to socket name. | |
127 | | -| `LIBTMUX_TMUX_BIN` | Path to tmux binary. Useful for testing with different tmux versions. | |
128 | | -| `LIBTMUX_SAFETY` | Safety tier: `readonly`, `mutating` (default), or `destructive`. | |
129 | | - |
130 | | -## Running the server |
131 | | - |
132 | | -```console |
133 | | -$ libtmux-mcp |
134 | | -``` |
135 | | - |
136 | | -Or via Python module: |
137 | | - |
138 | | -```console |
139 | | -$ python -m libtmux_mcp |
140 | | -``` |
141 | | - |
142 | | -## Testing with MCP Inspector |
143 | | - |
144 | | -```console |
145 | | -$ npx @modelcontextprotocol/inspector |
146 | | -``` |
| 35 | +- {ref}`concepts` — Understand the tmux hierarchy and how tools target panes |
| 36 | +- {ref}`configuration` — Environment variables and socket isolation |
| 37 | +- {ref}`safety` — Control which tools are available |
| 38 | +- {ref}`tools <tools-overview>` — Browse all available tools |
0 commit comments