wtp-mcp-rs
Manages Git worktrees via the wtp CLI, including listing, creating, removing, resolving paths, and preparing merge commands.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
wtp-mcp-rs
A Model Context Protocol (MCP) server for wtp (Worktree Plus), written in Rust. It lets AI assistants manage Git worktrees via the wtp CLI.
For:
Rust users who want
cargo installand a native CLI.npm users who want
npm 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).
Highlights
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.
Related MCP server: hop-mcp
Installation
Cargo (crates.io)
cargo install wtp-mcp-rsHomebrew
brew install bnomei/wtp-mcp/wtp-mcp-rsGitHub Releases
Download a prebuilt archive from the GitHub Releases page, extract it, and place wtp-mcp-rs on your PATH.
From source
git clone https://github.com/bnomei/wtp-mcp.git
cd wtp-mcp
cargo build --releaseQuick Start
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.Ensure
wtpis installed and onPATH(or set--wtp-path/ config).Optional: run
init-configonce to generate.wtp.yml, then editdefaults.base_dirand hooks before usingadd-worktree.
Usage
MCP Configuration
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-root because wtp-mcp-rs defaults to the current working directory.
CLI Options
Option | Description | Default |
| Repository root directory | Current working directory |
| Override path to wtp binary | Auto-detect |
| Path to TOML configuration file | None |
Worktree Configuration (.wtp.yml)
wtp controls worktree layout and hooks via .wtp.yml in 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 are blocked by default in this server unless
security.allow_hooks = true.If
.wtp.ymlis missing,add-worktreecreates a minimal config withdefaults.base_dir = .worktreesand no hooks.
Minimal example:
version: "1.0"
defaults:
base_dir: .worktreesMerging changes from worktrees
Typical flow:
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/xor open a PR and merge on GitHub.
Sample Configuration (config.toml)
# 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 = falseSecurity 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 = trueTools
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)
Resources
The server exposes the following MCP resources:
URI | Description |
| List of all worktrees (raw) |
| List of worktrees with resolved absolute paths |
| Details for a specific worktree |
| Repository overview with worktrees and security settings |
| Worktrees grouped by branch prefix (feature/, bugfix/, etc.) |
Skill
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.
Development
Running Tests
Unit tests (no wtp required):
cargo test --libIntegration tests (requires wtp installed; tests skip if missing):
cargo test --test integrationLicense
MIT License - see LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Manage WordPress blogs and WooCommerce shops from Claude, ChatGPT, Cursor and other MCP apps.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA git worktree manager that enables AI agents to work on different branches simultaneously with automatic coordination, locking, and merge management. Supports creating, managing, and merging git worktrees with setup automation and conflict resolution.5 npm6MIT
- AlicenseBqualityDmaintenanceManages parallel Git worktrees, enabling work on multiple branches simultaneously without stashing or context switching.141MIT
- AlicenseAqualityDmaintenanceEnables Claude to create, manage, and clean up git worktrees automatically, including dependency installation and GitHub PR creation.5MIT
- AlicenseNot gradedqualityDmaintenanceA complete Git CLI wrapper for the Model Context Protocol (MCP), enabling AI assistants to perform all git operations through MCP tools.MIT