MCPpre-alphaAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

libtmux_mcp.tools.server_tools.list_sessions

libtmux_mcp.tools.server_tools.list_sessions ( socket_name: str | None = None, filters: dict[str, str] | str | None = None, ) → list[SessionInfo]

List tmux sessions (terminal workspaces) on a tmux server.

Description#

Use for tmux multiplexer sessions — 'this session', 'my workspace', 'the dev session' — not login sessions or HTTP sessions. The starting point for discovery — call this before targeting specific sessions, windows, or panes.

Parameters
  • socket_name (str | None) # – tmux socket name. Defaults to LIBTMUX_SOCKET env var.

  • filters (dict[str, str] | str | None) # – Django-style filters as a dict (e.g. {"session_name__contains": "dev"}) or as a JSON string. Some MCP clients require the string form.

Returns

list[SessionInfo] List of session objects.

Discussed in Connect a Python MCP client

Esc

Type to search.

Reference preview Open reference