Core LibraryalphaHome

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.

Java

Drive a real tmux from Java.

io.github.libtmux:libtmux

You are reading the latest documentation. Use the version control in the header to move between releases, or the port dropdown to find a corresponding page in another language.

Install

Library io.github.libtmux:libtmux

dependencies {
    implementation(platform("io.github.libtmux:libtmux-bom:0.0.1-alpha.12"))

    implementation("io.github.libtmux:libtmux")
    testImplementation("io.github.libtmux:libtmux-junit5")
}

The platform BOM names the version once and every other coordinate follows it, which is what stops a project mixing two releases of modules built against each other.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.github.libtmux</groupId>
      <artifactId>libtmux-bom</artifactId>
      <version>0.0.1-alpha.12</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependency>
  <groupId>io.github.libtmux</groupId>
  <artifactId>libtmux</artifactId>
</dependency>

Workspace Manager libtmux-workspace-cli

The workspace package is separate from the core library.

$ ./gradlew \
    --max-workers=2 \
    --no-parallel \
    :libtmux-workspace-cli:installDist

Run from a libtmux-java checkout with JDK 25 or newer. The launcher is libtmux-workspace-cli/build/install/tmux-workspace/bin/tmux-workspace; keep its adjacent libraries.

MCP libtmux-mcp

Choose your client and configuration scope, then run the command or paste the configuration.

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ claude mcp add tmux -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.claude.json (this project)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ claude mcp add tmux --scope user -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.claude.json (all projects)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ claude mcp add tmux --scope project -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: .mcp.json (in repo, version-controlled)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp"
        }
    }
}

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: claude_desktop_config.json

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ codex mcp add tmux -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.codex/config.toml

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

[mcp_servers.tmux]
command = "/absolute/path/to/libtmux-mcp"

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: .codex/config.toml (in repo)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ gemini mcp add --scope user tmux /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.gemini/settings.json

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ gemini mcp add --scope project tmux /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: .gemini/settings.json (in repo)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp"
        }
    }
}

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: .cursor/mcp.json (in repo)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp"
        }
    }
}

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.cursor/mcp.json

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ grok mcp add --scope user tmux -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.grok/config.toml

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ grok mcp add --scope project tmux -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ./.grok/config.toml (in repo)

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then use this config:

{
    "mcpServers": {
        "tmux": {
            "command": "/absolute/path/to/libtmux-mcp"
        }
    }
}

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.gemini/config/mcp_config.json

Build or install the server first:

$ ./gradlew :libtmux-mcp:installDist

Then register:

$ opencode mcp add tmux -- /absolute/path/to/libtmux-mcp

Nothing publishes this server as a binary yet. The build writes a launcher at libtmux-mcp/build/install/libtmux-mcp/bin/libtmux-mcp; use its absolute path.

Config file: ~/.config/opencode/opencode.jsonc

Packages and integrations

API references

All Java versions and install instructions

Esc

Type to search.

Reference preview Open reference