| Crates.io | wtp-mcp-rs |
| lib.rs | wtp-mcp-rs |
| version | 0.1.0 |
| created_at | 2026-01-24 12:27:57.084679+00 |
| updated_at | 2026-01-24 12:27:57.084679+00 |
| description | MCP server for WTP - Git Worktree Plus |
| homepage | https://github.com/bnomei/wtp-mcp |
| repository | https://github.com/bnomei/wtp-mcp |
| max_upload_size | |
| id | 2066603 |
| size | 179,518 |
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:
cargo install and a native CLI.npm install -g with prebuilt platform binaries.Works in any Git repo. The wtp binary is required and must be on PATH (or set via --wtp-path / config).
cargo install wtp-mcp-rs
brew install bnomei/wtp-mcp/wtp-mcp-rs
npm install -g @bnomei/wtp-mcp-rs
npx -y @bnomei/wtp-mcp-rs@latest --repo-root /path/to/repo
Download a prebuilt archive from the GitHub Releases page, extract it, and place wtp-mcp-rs on your PATH.
git clone https://github.com/bnomei/wtp-mcp.git
cd wtp-mcp
cargo build --release
# 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"
}
}
}
--repo-root / --config if you want to pin a different path). For Codex CLI, MCP config is global; use codex --cd /path/to/repo if you want to set the working root without changing directories.wtp is installed and on PATH (or set --wtp-path / config).init-config once to generate .wtp.yml, then edit defaults.base_dir and hooks before using add-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-root because wtp-mcp-rs defaults to the current working directory.
| Option | Description | Default |
|---|---|---|
--repo-root <path> |
Repository root directory | Current working directory |
--wtp-path <path> |
Override path to wtp binary | Auto-detect |
--config <path> |
Path to TOML configuration file | None |
wtp controls worktree layout and hooks via .wtp.yml in the repo root.
init-config runs wtp init to generate .wtp.yml. The default template usually sets defaults.base_dir to ../worktrees and includes example hooks..worktrees for in-repo worktrees).security.allow_hooks = true..wtp.yml is missing, add-worktree creates a minimal config with defaults.base_dir = .worktrees and no hooks.Minimal example:
version: "1.0"
defaults:
base_dir: .worktrees
Typical flow:
git merge feature/x# 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
By default, potentially destructive operations are disabled:
--with-branch and --force-branch flags on remove-worktree require explicit enablement.To enable these features, add to your configuration file:
[security]
allow_hooks = true
allow_branch_delete = true
The server exposes the following MCP resources:
| URI | Description |
|---|---|
wtp://worktrees |
List of all worktrees (raw) |
wtp://worktrees/resolved |
List of worktrees with resolved absolute paths |
wtp://worktree/{name} |
Details for a specific worktree |
wtp://overview |
Repository overview with worktrees and security settings |
wtp://worktrees/by-branch-prefix |
Worktrees grouped by branch prefix (feature/, bugfix/, etc.) |
Unit tests (no wtp required):
cargo test --lib
Integration tests (requires wtp installed; tests skip if missing):
cargo test --test integration
MIT License - see LICENSE for details.