MCPpre-alphaTools

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.

tool MCPstable

list_servers

list_servers( extra_socket_paths?: Array<string> | null, )
tool [source]

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 parameters once known.

MCP request method
tools/call Send list_servers as the tool name, with the arguments below.

Arguments#

  • extra_socket_paths? = null (Array<string> | null) #

    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#

Returns object

Annotations#

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Protocol data#

Use the complete advertised contract for validation and client integration.

Input schema
{
"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
{
"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
}
Esc

Type to search.

Reference preview Open reference