Labsco
MCP SERVER

WTP - Worktree Plus

by bnomei

Manages Git worktrees through the wtp CLI, with hooks and branch deletion off until you turn them on.

Local Version Control
Summary
It hands back the merge command instead of running it.

That one decision tells you how the whole thing is built: the destructive operations are either off by default — hooks and branch deletion both need an explicit opt-in in the config — or handed back as text for you to run. Creating and listing worktrees is safe and immediate, which is the part you actually want automated when an agent is juggling several branches at once.

What it is

A Rust server that drives wtp (Worktree Plus) so an assistant can create, list and remove Git worktrees. It works in any Git repository and shells out to the wtp binary rather than reimplementing worktree handling. Alongside the tools it publishes resources — raw and resolved worktree lists, a repo overview, worktrees grouped by branch prefix — that a client can read without a tool call.

What you get
  • `list-worktrees` lists every worktree in the repository
  • `add-worktree` creates one for an existing or new branch
  • `remove-worktree` removes a worktree, and optionally its branch
  • `merge-worktree` returns the git merge command for a worktree's branch rather than running it
  • `get-worktree-path` resolves a worktree name to an absolute path
  • `init-config` runs `wtp init` to generate `.wtp.yml`
  • `shell-hook` and `shell-init` return bash, zsh or fish scripts
  • Resources at `wtp://worktrees`, `wtp://overview` and `wtp://worktrees/by-branch-prefix`
Requirements

The `wtp` binary has to be installed and on PATH, or named with `--wtp-path`. Install the server with `cargo install wtp-mcp-rs`, Homebrew, or a prebuilt archive from Releases; register it as the `wtp-mcp-rs` command. Run your client from the repository root, or pin one with `--repo-root`. Hooks and branch deletion are refused unless you set `allow_hooks` and `allow_branch_delete` under `[security]` in the config file.

Setup effort

One command — cargo install wtp-mcp-rs