MCP server for WTP - Git Worktree Plus. Exposes wtp commands as tools and resources for managing isolated git worktrees (folders per branch) in a repository.
The WTP MCP server defines 8 tools with generally clear naming and reasonable descriptions. Tool names follow verb-noun convention (list-worktrees, add-worktree, remove-worktree, etc.), which is good for agent comprehension. Descriptions are present and mostly actionable, ranging from 100-400+ characters. However, there are significant gaps: (1) input schemas are visible in the code but parameter descriptions lack some detail about constraints and expected formats; (2) output schemas are mentioned in descriptions but not formally documented in JSON Schema format; (3) error handling guidance is minimal, tools describe what they do but not what happens on failure or how to recover; (4) some descriptions are verbose and could be tightened; (5) parameter descriptions could be more explicit about mutually exclusive options and validation rules. The security-conscious design (allow_hooks, allow_branch_delete flags) is a strength, but the rubric expects clearer guidance on permission requirements and scope declarations.
Create a new isolated worktree folder for a branch. Provide 'branch' for an existing branch or 'new_branch' (+ optional 'from') to create one. Intended flow: run init-config, inspect and configure .wtp.yml (defaults.base_dir and optional hooks), then call add-worktree. If .wtp.yml is missing, this tool creates a minimal one with defaults.base_dir=.worktrees and no hooks. Hooks are optional post-create actions that can copy files (e.g., .env), symlink shared dirs, or run setup commands; when configured, wtp runs them after add-worktree completes. They improve new worktree readiness but are blocked unless allow_hooks=true. Consider asking the user if they want to set the workdir to the new worktree. Returns JSON { name, path, branch, hint }.
Resolves an absolute path for a worktree selector.
Initialize wtp configuration in the repository. No parameters; runs wtp init to create .wtp.yml in the repo root. The generated file includes example hooks (copy files, symlink dirs, run setup commands) that run after add-worktree and a default base_dir; review and edit it before add-worktree.
List worktrees (isolated folders per branch) in this repo so an agent can pick a target directory. Paths are returned as printed by wtp and may be relative or abbreviated; use get-worktree-path to resolve absolute paths. Returns JSON { worktrees: [ { name, path, branch, head, is_main } ] }.
Output schemas not formally documented in JSON Schema format. Tool descriptions mention what is returned (e.g., 'Returns JSON { worktrees: [...] }'), but there is no structured schema definition visible in the code that documents field types, required fields, and nested structure for downstream tool chaining.
Error handling and recovery guidance is absent. Tools do not document what error conditions are possible, what the LLM should do on failure (retry, ask user, abandon), or how to self-correct. E.g., 'add-worktree' could fail if branch already exists or if hooks fail, but the description does not say so or guide recovery.
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 53 | 2025-06-18+ | v2 |
| 2026-03-09 | F | 42 | - | v1 |
Resolves the worktree branch and returns a git merge command.
Remove a worktree folder by name (from list-worktrees). Use 'force' to discard uncommitted changes. Use 'with_branch'/'force_branch' to delete the branch (requires allow_branch_delete=true). If hooks are configured for removal, wtp runs them during remove-worktree for cleanup, but they are blocked unless allow_hooks=true is set.
Get shell hook script for the specified shell. Returns shell integration script content.
Get shell initialization script for the specified shell. Returns shell integration script content.
Parameter constraint documentation is incomplete. 'merge-worktree' and 'get-worktree-path' have minimal descriptions. 'shell-hook' and 'shell-init' do not formally specify that 'shell' must be one of 'bash', 'zsh', 'fish', they mention it in prose but do not enforce via enum schema. This invites invalid LLM inputs.
Mutually exclusive parameters not clearly enforced in schema. 'add-worktree' documents that 'branch' and 'new_branch' are mutually exclusive, but this constraint is not expressed as JSON Schema (e.g., oneOf). LLMs may pass both parameters despite the description.
Scope and permission declarations missing. Tools reference 'allow_hooks' and 'allow_branch_delete' security policy flags, but the tool definitions do not declare what permissions/scopes each tool requires (e.g., 'scope: write:git', 'scope: admin:hooks'). This prevents least-privilege agent configuration.
Tool chaining support incomplete. 'list-worktrees' returns a 'name' field; 'add-worktree' returns a 'name' field; downstream tools accept 'name' as a parameter. This is consistent. However, the output schema is not formally documented, so an LLM cannot be certain which field names to extract for the next call.
Verbose descriptions reduce clarity. 'add-worktree' description is ~370 chars and includes extensive flow guidance. Descriptions should be 10 - 1024 chars with the most critical info first. Move flow guidance (init-config → inspect .wtp.yml → add-worktree) to a separate 'prerequisites' or 'examples' field if the tool definition supports it.