# libtmux_mcp.tools.server_tools.list_sessions

- **Module:** libtmux_mcp.tools.server_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/server_tools.py#L40
- **Page:** https://libtmux.org/en/py/latest/mcp/reference/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.

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.
