|
| 1 | +(troubleshooting)= |
| 2 | + |
| 3 | +# Troubleshooting |
| 4 | + |
| 5 | +Symptom-based guide. Find your problem, follow the steps. |
| 6 | + |
| 7 | +## Server doesn't appear in client |
| 8 | + |
| 9 | +**Symptoms**: Client shows no libtmux tools, or "server not found" errors. |
| 10 | + |
| 11 | +**Check**: |
| 12 | + |
| 13 | +1. Verify the server starts manually: |
| 14 | + |
| 15 | + ```console |
| 16 | + $ uvx libtmux-mcp |
| 17 | + ``` |
| 18 | + |
| 19 | + You should see no output (it's waiting for stdio input). Press Ctrl+C to stop. |
| 20 | + |
| 21 | +2. Check your client config points to the right command. Common issues: |
| 22 | + - `uvx` not in PATH — install [uv](https://docs.astral.sh/uv/) |
| 23 | + - Typo in `"command"` or `"args"` in JSON config |
| 24 | + - TOML config syntax errors (Codex CLI) |
| 25 | + |
| 26 | +3. Restart your MCP client after config changes. |
| 27 | + |
| 28 | +## Tools fail with "no sessions found" |
| 29 | + |
| 30 | +**Symptoms**: `list_sessions` returns empty, other tools can't find targets. |
| 31 | + |
| 32 | +**Check**: |
| 33 | + |
| 34 | +1. Is tmux running? |
| 35 | + |
| 36 | + ```console |
| 37 | + $ tmux list-sessions |
| 38 | + ``` |
| 39 | + |
| 40 | +2. Are you on the right socket? If `LIBTMUX_SOCKET` is set, the server only sees sessions on that socket: |
| 41 | + |
| 42 | + ```console |
| 43 | + $ tmux -L ai_workspace list-sessions |
| 44 | + ``` |
| 45 | + |
| 46 | +3. Create a session on the expected socket: |
| 47 | + |
| 48 | + ```console |
| 49 | + $ tmux -L ai_workspace new-session -d -s test |
| 50 | + ``` |
| 51 | + |
| 52 | +## Wrong tmux socket |
| 53 | + |
| 54 | +**Symptoms**: Server sees different sessions than expected, or sees nothing. |
| 55 | + |
| 56 | +**Cause**: `LIBTMUX_SOCKET` in the MCP config isolates the server to a specific socket. Your personal sessions are on the default socket. |
| 57 | + |
| 58 | +**Fix**: Either remove `LIBTMUX_SOCKET` from the config to use the default socket, or ensure sessions exist on the configured socket. |
| 59 | + |
| 60 | +## Pane targeting mismatch |
| 61 | + |
| 62 | +**Symptoms**: Tool targets the wrong pane, or "pane not found" errors. |
| 63 | + |
| 64 | +**Cause**: Using ambiguous targeting (session name + window name) instead of direct IDs. |
| 65 | + |
| 66 | +**Fix**: Use `pane_id` (e.g. `%1`) for unambiguous targeting. Pane IDs are globally unique within a tmux server. Run `list_panes` first to discover IDs. |
| 67 | + |
| 68 | +## Command works in shell but not via MCP |
| 69 | + |
| 70 | +**Symptoms**: `send_keys` sends the command but output isn't what you expect. |
| 71 | + |
| 72 | +**Check**: |
| 73 | + |
| 74 | +1. **Enter key**: `send_keys` sends Enter by default (`enter=true`). If you're sending a partial command, set `enter=false`. |
| 75 | + |
| 76 | +2. **Special characters**: tmux interprets some key names (e.g. `C-c`, `Enter`). If sending literal text, use `literal=true`. |
| 77 | + |
| 78 | +3. **Timing**: After `send_keys`, use `wait_for_text` to wait for the command to complete before capturing output. Don't `capture_pane` immediately — the command may still be running. |
| 79 | + |
| 80 | +## Silent startup failure |
| 81 | + |
| 82 | +**Symptoms**: MCP client says connected but no tools are available. |
| 83 | + |
| 84 | +**Check**: |
| 85 | + |
| 86 | +1. Missing dependency — ensure `fastmcp` is installed: |
| 87 | + |
| 88 | + ```console |
| 89 | + $ uvx libtmux-mcp |
| 90 | + ``` |
| 91 | + |
| 92 | + If using pip install, check: |
| 93 | + |
| 94 | + ```console |
| 95 | + $ python -c "import fastmcp; print(fastmcp.__version__)" |
| 96 | + ``` |
| 97 | + |
| 98 | +2. Python version — requires 3.10+: |
| 99 | + |
| 100 | + ```console |
| 101 | + $ python --version |
| 102 | + ``` |
| 103 | + |
| 104 | +## Safety tier blocking tools |
| 105 | + |
| 106 | +**Symptoms**: Some tools are missing from the tool list, or return "blocked by safety tier" errors. |
| 107 | + |
| 108 | +**Cause**: `LIBTMUX_SAFETY` is set to a restrictive tier. |
| 109 | + |
| 110 | +**Fix**: Check the configured tier. Default is `mutating`, which includes most tools. Only `destructive` enables kill commands. See {ref}`safety`. |
| 111 | + |
| 112 | +## How to see logs |
| 113 | + |
| 114 | +The MCP server uses Python's `logging` module. To see debug output, set the log level before starting: |
| 115 | + |
| 116 | +```console |
| 117 | +$ PYTHONUNBUFFERED=1 uvx libtmux-mcp 2>server.log |
| 118 | +``` |
| 119 | + |
| 120 | +For Claude Desktop on macOS, MCP server logs are at: |
| 121 | +`~/Library/Logs/Claude/mcp-server-libtmux.log` |
0 commit comments