libtmux-mcp 0.1.0a22 · Source
Connect the server using the setup guide, then call
list_sessions from your MCP client.
List sessionsLink to section
This is the params object for an MCP tools/call request. Send it
through the connected client:
{ "name": "list_sessions", "arguments": {}}Use the returned session IDs when choosing a window or pane. The tool reference describes this port’s result and optional arguments.
InternalsLink to section
The following examples are for applications that embed or extend the server. Installing and connecting an MCP client does not require this code.
Use a FastMCP client to inspect the same registered server that the
libtmux-mcp executable serves. This checks the advertised contract
without creating tmux sessions.
Inspect the catalog in PythonLink to section
Run this in an environment containing libtmux-mcp. It uses the
production factory and closes the in-process client when the context ends.
import asyncio
from fastmcp import Clientfrom libtmux_mcp.server import build_mcp_server
async def main() -> None: async with Client(build_mcp_server()) as client: tools = await client.list_tools() for tool in tools: print(tool.name, tool.input_schema)
asyncio.run(main())The production factory registers tools and applies visibility once. The server tests exercise this client/factory pattern. Set selection variables before importing the server in a fresh process.
Run and observe through a clientLink to section
On a disposable session, ask the client to create a pane, run
printf 'ready\n' with run_command, and report its typed exit
status. For subsequent output, seed capture_since and reuse the returned
cursor. Use wait_for_text when waiting for output from a process you did
not launch.
These are workflows for the client to carry out, not literal tool argument objects. Use the tool reference for each operation’s schema.
The upstream quickstart describes command completion and lower-level channel composition.