Skip to content

Add a split-window tool to the MCP server #87

Open

Description

@tony

Summary

The MCP server advertises no tool that splits a tmux window into panes. An agent can read panes (tmux_snapshot), capture and send to them, and create and close entities, but it cannot ask for a second pane next to or below an existing one.

Motivation

libtmux/docs#239 turned the MCP worked example on libtmux.org into a replay: an agent chat beside a tmux preview that draws the panes the recorded results describe. The ports that have a split tool (TypeScript, Rust, Go, Python, Java, C#, C++ and Swift) replay a worked example that splits the window, reads the layout, runs a command in each pane and removes the session. Ruby replays a single-pane example only, because its server has nothing to split with. The replay needs the tool, and so does any agent task that wants a test run beside a log.

Proposal

Add a split-window tool to the MCP server, in the tier of the other tools that create tmux objects, taking the pane to split and a direction (above, below, left, right) and optionally a size, and returning the new pane's id and the window it is in. The window's layout should be readable through an existing or new read, as the other ports return it, so a client can place the panes.

When it exists, add the split worked example for Ruby to the docs site's EXAMPLES and record it with scripts/gen-mcp-transcript.mjs --port ruby.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions