What it does
gitcleanplan is an MCP server for planning cleanup of stale and merged branches. You supply branch data (name, days since the last commit, and flags for merged, upstream gone, protected and current), and it returns a plan that sorts each branch into keep, review or delete, with the reason for each decision. It deletes nothing.
It suits a repository whose branch list has grown and where you want a reviewed cleanup rather than deletions made on a guess. Decisions follow a fixed rule order: the default branch, protected branches and the checked-out branch are kept; merged branches whose upstream is gone, or that have been stale for at least stale_days (default 90), are marked for deletion; merged-but-recent branches and unmerged candidates go to review. The output groups branch names by action, gives counts, and lists a git branch -d command for each branch planned for deletion, in name order.
Running it means exposing the plan_branch_cleanup tool through an MCP client configuration. The tool requires a branches array with at least one entry, and accepts optional stale_days and default_branch values (default "main"). The computation is local, with no network access and no files read beyond the input. Malformed input returns a validation error naming the offending path, and no partial plan is produced. The listed commands are never executed; you decide what to run.
Limitations and requirements
The server does not read repositories or run git, so the caller must supply the branch data. Malformed input is rejected: empty or duplicate branch names, missing or negative day counts, wrongly typed flags, and invalid stale_days or default_branch values all cause a validation error and no partial plan. The tool never executes the suggested delete commands.
Safety
Our team has not reviewed this resource. Only automated rules checked it; resources with high-risk signals are not published. These are signals, not a guarantee that installing it is safe. Try it in a sandbox project first.
- Runs code or changes an assistant's behaviour
Sources
- Official MCP Registry first seen 13 Nov 2026 · last seen 13 Nov 2026 · its page on the source
io.github.CloudCorpRecords/gitcleanplan
Plan stale and merged branch cleanup: keep / review / delete per branch, with reasons.
v0.1.0As shown on registry.modelcontextprotocol.io when we last read it