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

libtmux_mcp.server.mcp

Python
  • Python
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

libtmux_mcp.server.mcp = FastMCP( name="tmux", version=__version__, instructions=_build_instructions( toolsets=_toolsets, suppress_history=_suppress_history, ), website_url="https://libtmux-mcp.git-pull.com/", lifespan=_lifespan, # Middleware runs outermost-first. Order rationale: # 1. TimingMiddleware — neutral observer; start clock as early # as possible so timing captures middleware cost too. # 2. TailPreservingResponseLimitingMiddleware — bounds the final # tool result on the way back out. Tool errors may already be # ToolResult(is_error=True) here, so truncation preserves that # flag instead of turning expected failures into schema errors. # 3. ToolErrorResultMiddleware — converts tool-call failures to # rich ToolResult(is_error=True) results and transforms # resource errors to MCP code -32002. Must stay OUTSIDE the # audit + toolset pair: both depend on exception semantics # (audit catches to record outcome=error, and toolset denials # must propagate as exceptions for audit to record them), so # converting the exception to a result any deeper would # silently break both. # 4. AuditMiddleware — outside ToolsetMiddleware so refusal # events (which raise ExpectedToolError before call_next inside # Toolset) are still logged with outcome=error. Without this # ordering, denied access attempts would silently bypass the # audit log — a security-observability gap. # 5. ToolsetMiddleware — innermost gate (fail-closed). Refusals # never reach the tool, but the audit record above captures # them for forensic review. middleware=[ TimingMiddleware(), TailPreservingResponseLimitingMiddleware( max_size=DEFAULT_RESPONSE_LIMIT_BYTES, tools=_RESPONSE_LIMITED_TOOLS, ), ToolErrorResultMiddleware(transform_errors=True), AuditMiddleware(), ToolsetMiddleware(_toolsets, _extra_tools, _excluded_tools), ], on_duplicate="error", )
constant [source]
constant [source]
libtmux_mcp.server.mcp
Esc

Type to search.