C# MCP examples
LibTmux.Mcp 0.0.0-alpha.20 · Source
List sessions through MCP
Verify tool discovery, read the capability resource, and check structured session metadata.
Run a command through MCP
Discover a pane, check shell completion and output, and clean up the owned server.
Each example includes its project file, complete program, pinned tool installation, run command, and expected output. The programs create private tmux servers and attempt cleanup after successful and failed requests.
List sessions¶
List sessions through MCP uses an inspection-only
connection. It checks the advertised tools, reads tmux://capabilities, and
verifies the session name and window count in structured content.
Run a command¶
Run a command through MCP discovers the pane ID, submits a bounded shell command, and checks its exit status separately from the MCP result. It also checks whether the captured output is complete.
For an existing server, follow the connection guide and keep its ownership separate from the private servers in these examples. See Waits and captured output before adding retries or cancellation to a client that controls long-running processes.