WTP - Worktree Plus

by bnomei

Not rated
GitHub

About

Let agents manage Git worktrees via the wtp CLI.

Details

Author
bnomei
Categories
Developer Tools, Other

Setup

Install WTP - Worktree Plus in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/bnomei/wtp-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server forwtp(Worktree Plus), written in Rust. It lets AI assistants manage Git worktrees via the wtp CLI.

- Rust users who wantcargo installand a native CLI.
- npm users who wantnpm install -gwith prebuilt platform binaries.
- Git users who want safe, scriptable worktree automation.

Works in any Git repo. The wtp binary is required and must be on PATH (or set via--wtp-path/ config).

- Safety defaults: Hooks and branch deletion are disabled by default and must be explicitly enabled.
- Rich resources: Query worktree lists, resolved paths, grouped views, and repo overview.

Download a prebuilt archive from the GitHub Releases page, extract it, and placewtp-mcp-rson yourPATH.

git clone https://github.com/bnomei/wtp-mcp.git cd wtp-mcp cargo build --release

- Add this MCP configuration. Examples for common MCP clients (pick one):

# Claude Code claude mcp add --transport stdio --scope project wtp -- wtp-mcp-rs # Codex CLI codex mcp add wtp -- wtp-mcp-rs # OpenCode (interactive) opencode mcp add # Amp (workspace) amp mcp add --workspace wtp -- wtp-mcp-rs
{ "mcpServers": { "wtp": { "command": "wtp-mcp-rs" } } }

- Run the MCP client from your repo root (or pass--repo-root/--configif you want to pin a different path). For Codex CLI, MCP config is global; usecodex --cd /path/to/repoif you want to set the working root without changing directories.
- Ensurewtpis installed and onPATH(or set--wtp-path/ config).
- Optional: runinit-configonce to generate.wtp.yml, then editdefaults.base_dirand hooks before usingadd-worktree.

Add the Quick Start snippet to your MCP client configuration. Example below includes all supported args (remove the ones you don't need):

{ "mcpServers": { "wtp": { "command": "wtp-mcp-rs", "args": [ "--wtp-path", "/usr/local/bin/wtp", "--config", "/path/to/config.toml" ] } } }

If your MCP client launches servers from the repository root (project/workspace scope), you can omit--repo-rootbecausewtp-mcp-rsdefaults to the current working directory.

wtpcontrols worktree layout and hooks via.wtp.ymlin the repo root.

- init-configrunswtp initto generate.wtp.yml. The default template usually setsdefaults.base_dirto../worktreesand includes example hooks.
- Edit the file to choose your worktree base directory (e.g.,.worktreesfor in-repo worktrees).
- Hooks are optional post-create/remove actions (copy files, symlink dirs, run setup commands). They areblocked by defaultin this server unlesssecurity.allow_hooks = true.
- If.wtp.ymlis missing,add-worktreecreates a minimal config withdefaults.base_dir = .worktreesand no hooks.

version: "1.0" defaults: base_dir: .worktrees

- Each worktree is a branch checkout in its own directory.
- Commit in that worktree.
- Merge into your target branch from any worktree (usually the "main" one):

- git merge feature/x
- or open a PR and merge on GitHub.

# Repository root (optional, defaults to cwd) repo_root = "/path/to/repo" [wtp] # Path to wtp binary (optional, auto-detected from PATH) path = "/usr/local/bin/wtp" [security] # Allow execution of wtp hooks (default: false) allow_hooks = false # Allow branch deletion with worktree removal (default: false) allow_branch_delete = false

Security defaults (why destructive actions are blocked)

By default, potentially destructive operations are disabled:

- Hook execution: Disabled by default. Hooks can execute arbitrary code.
- Branch deletion: Disabled by default. The--with-branchand--force-branchflags onremove-worktreerequire explicit enablement.

To enable these features, add to your configuration file:

[security] allow_hooks = true allow_branch_delete = true

- list-worktrees- List all worktrees in the repository
- add-worktree- Create a new worktree for an existing or new branch
- remove-worktree- Remove a worktree (optionally with its branch)
- merge-worktree- Return a git merge command for a worktree branch
- init-config- Initialize wtp configuration in the repository
- get-worktree-path- Get the absolute path to a worktree
- shell-hook- Get shell hook script (bash/zsh/fish)
- shell-init- Get shell initialization script (bash/zsh/fish)

The server exposes the following MCP resources:

skills/git-worktree-plus-with-mcp/SKILL.md: Use this skill when the user wants to manage Git worktrees through the wtp MCP server (list, create, remove, resolve paths, init .wtp.yml, or prepare merge commands), especially when safety defaults around hooks and branch deletion matter.

Integration tests (requires wtp installed; tests skip if missing):

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Anchor is local repo and org memory for AI coding agents. It indexes GitHub PR history, current code, tests, regressions, architecture, and cross-repo impact locally, then exposes concise cited context through MCP and CLI workflows. Local-first. Read-only GitHub access. No CLI telemetry. No SaaS. No remote LLM calls.

Design system MCP server — query tokens, components, icons, and WCAG contrast data from Git-backed design systems.

Provides code context from local git repositories.

Local-first documentation for AI agents. Indexes docs from any git repo into SQLite for offline, instant, private access to up-to-date library documentation.

DOS is a small open-source kernel that doesn't believe your AI agents: it verifies what actually shipped from git evidence, arbitrates file collisions between parallel agents, and refuses with structured reasons.

Prevents regression by providing Blast Radius data to AI based on your git history

Fabrx is a no-code platform where users can setup custom document processing workflows

Model Context Protocol (MCP) server for GitLab — exposes 1006 GitLab REST & GraphQL API operations as MCP tools (28 meta-tools / 43 enterprise), 24 resources, 38 prompts, and 17 completion types for AI assistants. Written in Go, single static binary, stdio and HTTP transport.

kemdiCode MCP is a Model Context Protocol server that gives AI agents and IDE assistants access to 124 specialized tools for code analysis, generation, git operations, file management, AST-aware editing, project memory, cognition & self-improvement, multi-board kanban, and multi-agent coordination.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.