# list_servers

Source: https://libtmux.org/en/py/latest/mcp/tools/list_servers/

> Discover live tmux servers under the current user's $TMUX_TMPDIR.

tool MCPlatest

MCP is in development

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

* **list_servers**( [extra_socket_paths](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.input%2Fproperties%2Fextra_socket_paths)?: [Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)")> | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/server_tools.py#L367)][¶](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers)

  Discover live tmux servers under the current user’s `$TMUX_TMPDIR`.

  Scans `${TMUX_TMPDIR:-/tmp}/tmux-<uid>/` for socket files — the canonical location where tmux creates per-server sockets (see tmux.c’s `expand_paths` + `TMUX_SOCK` template). Only sockets with a live listener are reported; stale inodes (a common case on long-running systems where `$TMUX_TMPDIR` can carry thousands of orphans) are silently filtered.

  **Scope caveat**: custom `tmux -S /some/path/...` servers that live OUTSIDE `$TMUX_TMPDIR` are not returned by the scan alone — there is no canonical registry for arbitrary socket paths. Supply known paths via `extra_socket_paths` to include them in the result, or pass the path to other tools via their `socket_name` / [`socket_path`](https://libtmux.org/en/tmux/latest/catalog/formats/socket_path/) parameters once known.

  * MCP request method

    `tools/call` Send `list_servers` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.parameters)

  * **[`extra_socket_paths`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.input%2Fproperties%2Fextra_socket_paths)**? = `null` ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)")> | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Additional filesystem paths to probe alongside the `$TMUX_TMPDIR` scan. Each path is checked for liveness (UNIX `connect()`) and queried for server metadata. Paths that do not exist, are not sockets, or have no listener are silently skipped.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`result`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

    * **[Items](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      Serialized tmux server info.

      * **[`is_alive`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems%2Fproperties%2Fis_alive)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

        Whether the server is running

      * **[`session_count`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems%2Fproperties%2Fsession_count)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

        Number of sessions

      * **[`socket_name`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems%2Fproperties%2Fsocket_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

        Socket name

      * **[`socket_path`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems%2Fproperties%2Fsocket_path)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

        Socket path

      * **[`version`](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.output%2Fproperties%2Fresult%2Fitems%2Fproperties%2Fversion)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

        tmux version

  ## Annotations[#](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.annotations)

  * [`destructiveHint`](https://libtmux.org/en/py/latest/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/py/latest/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/py/latest/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/py/latest/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/py/latest/mcp/tools/list_servers/#mcp.tool.list_servers.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "extra_socket_paths": {
        "anyOf": [
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Additional filesystem paths to probe alongside the\n``$TMUX_TMPDIR`` scan. Each path is checked for liveness (UNIX\n``connect()``) and queried for server metadata. Paths that do\nnot exist, are not sockets, or have no listener are silently\nskipped."
      }
    },
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "properties": {
      "result": {
        "items": {
          "description": "Serialized tmux server info.",
          "properties": {
            "is_alive": {
              "description": "Whether the server is running",
              "type": "boolean"
            },
            "session_count": {
              "description": "Number of sessions",
              "type": "integer"
            },
            "socket_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Socket name"
            },
            "socket_path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Socket path"
            },
            "version": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "tmux version"
            }
          },
          "required": [
            "is_alive",
            "session_count"
          ],
          "type": "object"
        },
        "type": "array"
      }
    },
    "required": [
      "result"
    ],
    "type": "object",
    "x-fastmcp-wrap-result": true
  }
  ```
