MCPpre-alphaTools

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

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

tool MCP

list_servers

list_servers( extra_socket_paths?: Array<string> | null, )

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

Advertised by the server

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Capability

Toolset
Inspect Request tmux state and terminal output.

Every Python tool advertises the same annotations, so a host that approves by annotation cannot tell tools apart. The capability row is what tells them apart.

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
Search in

Type to search.

Reference previewOpen reference