libtmux_mcp.tools.server_tools.list_servers
- libtmux_mcp.tools.server_tools.list_servers ( extra_socket_paths: list[str] | None = None, ) list[Server
Info ] -
Discover live tmux servers under the current user's
$TMUX_TMPDIR.Description#
Scans
${TMUX_TMPDIR:-/tmp}/tmux-<uid>/for socket files — the canonical location where tmux creates per-server sockets (see tmux.c'sexpand_paths+TMUX_SOCKtemplate). Only sockets with a live listener are reported; stale inodes (a common case on long-running systems where$TMUX_TMPDIRcan carry thousands of orphans) are silently filtered.Scope caveat: custom
tmux -S /some/path/...servers that live OUTSIDE$TMUX_TMPDIRare not returned by the scan alone — there is no canonical registry for arbitrary socket paths. Supply known paths viaextra_socket_pathsto include them in the result, or pass the path to other tools via theirsocket_name/socket_pathparameters once known.- Parameters
-
-
extra_socket_paths(list[str] | None) # – Additional filesystem paths to probe alongside the$TMUX_TMPDIRscan. Each path is checked for liveness (UNIXconnect()) and queried for server metadata. Paths that do not exist, are not sockets, or have no listener are silently skipped.
-
- Returns
-
list[ServerInfo] One entry per live tmux server found. Canonical-directory results come first, followed by successful
extra_socket_pathsprobes in the supplied order. Empty when nothing lives under$TMUX_TMPDIRand no extras are supplied or reachable.