# get_sessions

Source: https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/

> List all tmux sessions.

resource templateMCPlatest

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

* `tmux://sessions{?socket_name}`

  resource template[¶](https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/#mcp.resource-template.tmux%3A%2F%2Fsessions%7B%3Fsocket_name%7D)

  List all tmux sessions.

  * MCP request method

    `resources/read` Send the resource URI shown above.

  * MIME type

    `application/json`

  ## URI parameters[#](https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/#mcp.resource-template.tmux%3A%2F%2Fsessions%7B%3Fsocket_name%7D.parameters)

  * `socket_name`[#](https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/#mcp.resource-template.tmux%3A%2F%2Fsessions%7B%3Fsocket_name%7D.parameter.socket_name)

    tmux socket name. Defaults to LIBTMUX_SOCKET env var.

    * Binding

      Query variable

  ## Result[#](https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/#mcp.resource-template.tmux%3A%2F%2Fsessions%7B%3Fsocket_name%7D.result)

  Returns resource contents for the requested URI with MIME type `application/json`.

  str JSON array of session objects (MIME: `application/json`).

  ## Protocol data[#](https://libtmux.org/en/py/latest/mcp/resources/templates/get_sessions/#mcp.resource-template.tmux%3A%2F%2Fsessions%7B%3Fsocket_name%7D.schemas)

  Use the complete advertised contract for validation and client integration.

  Registration

  ```json
  {
    "_meta": {
      "fastmcp": {
        "tags": []
      }
    },
    "description": "List all tmux sessions.\n\nParameters\n----------\nsocket_name : str, optional\n    tmux socket name. Defaults to LIBTMUX_SOCKET env var.\n\nReturns\n-------\nstr\n    JSON array of session objects (MIME: ``application/json``).",
    "mimeType": "application/json",
    "name": "get_sessions",
    "title": "All Sessions",
    "uriTemplate": "tmux://sessions{?socket_name}"
  }
  ```

Source revision: [tmux-python/libtmux-mcp@4daddc0dfca96c43bf521d818bf91564e1434760](https://github.com/tmux-python/libtmux-mcp/tree/4daddc0dfca96c43bf521d818bf91564e1434760).
