# io.github.libtmux.mcp.Main.Main

- **Module:** io.github.libtmux.mcp.Main
- **Package:** libtmux-mcp
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux-mcp/src/main/java/io/github/libtmux/mcp/Main.java#L27
- **Page:** https://libtmux.org/en/java/latest/mcp/reference/io-github-libtmux-mcp-main-main/

Runs the tmux MCP server over stdin and stdout.

An MCP client launches this as a subprocess and speaks JSON-RPC over its standard streams, so
**nothing may write to stdout but the protocol**. Diagnostics go to stderr, which the
client is free to log or discard.

Which tmux server to expose is chosen the same way the library chooses it: a socket path, a
socket name, or tmux's own default.

The unordered toolset and named-tool environment variables resolve one immutable surface
before tmux is opened. A tool outside it is neither listed nor callable.

## Example

```java
libtmux-mcp --socket /run/user/1000/tmux/default
libtmux-mcp --socket-name work --tmux /usr/local/bin/tmux
```

## Members

- `main` (method): Serves a tmux server over stdin and stdout until the client closes them.
- `configure` (method)
