MCPAPI Reference

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

LibTmux.Mcp.TmuxConnectionAccessor

API reference · Markdown

class LibTmux.Mcp.TmuxConnectionAccessor
class [source]

Holds the tmux servers this process talks to, one per socket.

Description#

A conversation outlives any single tool call, so connecting once and keeping the handle costs one process launch instead of one per call. Sockets are cached separately because a machine runs several tmux servers at once — a user's own, a test rig's, a sandbox's — and they are different servers with the same commands, not one server addressed two ways.

When no template is supplied, the tmux binary comes from LIBTMUX_TMUX. An explicit template is already a pinned route and wins over later process-environment changes.

Members

TmuxConnectionAccessor

TmuxConnectionAccessor ( template : ServerConnectionOptions? , defaultSocketName : string? , logger : ILogger? ) ( server : Server )
methodoverload2 overloads [source]

Initializes the accessor.

Parameters
  • template ( ServerConnectionOptions? ) – How to reach tmux, or null for the ambient server. (for TmuxConnectionAccessor(template, defaultSocketName, logger))

  • defaultSocketName ( string? ) – The socket used when a call names none. (for TmuxConnectionAccessor(template, defaultSocketName, logger))

  • logger ( ILogger? ) – Records connection failures. (for TmuxConnectionAccessor(template, defaultSocketName, logger))

  • server ( Server ) – The server every call reaches. (for TmuxConnectionAccessor(server))

DefaultSocketName

DefaultSocketName : string?
property [source]

Gets the socket used when a call names none.

Dispose

Dispose ( ) → void
method [source]

GetAsync

GetAsync ( socketName : string? , cancellationToken : CancellationToken ) → Task<Server>
methodasync [source]

Answers a server, connecting on the first ask for that socket.

Parameters
  • socketName ( string? ) – The socket, or null for the configured default.

  • cancellationToken ( CancellationToken ) – Cancels the tmux command.

Returns

The server.

Raises

Invalidate

Invalidate ( socketName : string? ) → void
method [source]

Forgets a cached server so the next call reconnects.

Description#

A materialized handle names one tmux <em>process</em>. Killing the server and starting another gives the same socket a different process, and the old handle then refuses to be used rather than quietly answering for a server that no longer exists.

Parameters
  • socketName ( string? ) – The socket, or null for the configured default.

Esc

Type to search.