# gitwand [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/devlint/GitWand  
**GitHub Stars:** 199  
**npm Downloads (last month):** 2475  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gitwand

## Description
Auto-resolves Git merge conflicts so agents only touch the complex hunks.

## Tools
Capabilities this server exposes over MCP:

- **gitwand_status** — List conflicted files in the current Git repo with their complexity and auto-resolvability. Returns a structured JSON report with conflict counts, types, and confidence scores.
- **gitwand_resolve_conflicts** — Auto-resolve trivial Git merge conflicts using GitWand's pattern-based engine. Returns resolved files, DecisionTrace for each hunk, and pendingHunks for conflicts that need human/LLM review. Writes resolved files to disk unless dry_run is true.
- **gitwand_preview_merge** — Side-effect-free Conflict Predictor. Simulates a merge, rebase, or cherry-pick and reports how many conflicts GitWand can auto-resolve vs. how many need manual/LLM attention, plus an overall risk level (low/medium/high). Does NOT modify the working tree, index, or HEAD.

- operation 'merge' (default): analyzes conflicts already materialized in the working tree (files with conflict markers).
- operation 'rebase': simulates rebasing HEAD onto `onto` (3-way against merge-base(HEAD, onto); HEAD's work is replayed on top of `onto`).
- operation 'cherry-pick': simulates cherry-picking `commit` onto HEAD (3-way with `commit^` as ancestor, HEAD as ours, `commit` as theirs).
- **gitwand_explain_hunk** — Explain why a specific conflict hunk was classified as its type. Returns the DecisionTrace with each evaluation step and the ours/theirs/base content for context.
- **gitwand_apply_resolution** — Apply a custom resolution (provided by the LLM or user) to a specific conflict hunk. Replaces the conflict markers at the given line range with the provided content. Writes WITHOUT validating the result (no marker or syntax check): for an agent's own resolution prefer gitwand_resolve_hunk_llm, which validates before writing.
- **gitwand_resolve_hunk** — Ask the connected AI agent (the caller of this MCP server) to propose a resolution for a single Git merge conflict hunk. Returns a fully-formed prompt with the base/ours/theirs versions and asks the agent to reply with a JSON object { "resolution": "<merged code>", "reasoning": "<short explanation>" }. This tool does NOT call any external LLM — the agent that called the tool IS the LLM. Use it when GitWand (desktop/cli) wants to delegate the resolution of a `complex` hunk to the agent driving the session, instead of calling Anthropic/OpenAI directly. Pair the agent's answer with `gitwand_apply_resolution` to write it to disk.
- **gitwand_resolve_hunk_llm** — Validate and apply an LLM-proposed resolution for a specific conflict hunk. Reads the hunk at the given file+line, replaces it with the proposed resolution, validates the result (no residual markers; for JSON, YAML and TOML, a whole-file parse once no other hunk remains), and writes the file if the validation score meets the threshold. Returns the full audit trail (validation score, accepted/rejected, reason). Workflow: (1) call gitwand_status or gitwand_explain_hunk to see pending complex hunks, (2) propose a resolution, (3) call this tool to validate + apply it.
- **gitwand_create_issue** — File a GitHub issue on the repository in `cwd`, through the `gh` CLI (its login, or GH_TOKEN/GITHUB_TOKEN). PREVIEWS BY DEFAULT: without `dry_run: false` nothing is created, and the tool returns the target repository, the title, labels and assignees it would send, the body's length (the body is sent exactly as given), and what the secrets scan found, and a `previewId`. Show the user that preview with the body you passed; only once they agree, call again with the same arguments plus `dry_run: false` and that `preview_id` (a create without it, with changed arguments, or more than an hour later, is refused; one preview allows one create). If a create returns `create_uncertain`, the issue may exist: check before calling again. Target: the `origin` remote's repository, or its fork parent when issues are disabled (or the repository archived) on `origin`; an explicit `repo` must be one of those two. Title and body are scanned for secrets first: a known secret pattern (high or medium severity) refuses the issue, even with `dry_run: false`; a high-entropy string only warns. Labels should exist on the target repository (GitHub creates a missing one only for someone who can push there).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "gitwand": {
    "command": "npx",
    "args": ["-y","@gitwand/mcp"]
  }
}
```

## Documentation

## What gitwand MCP server does

gitwand MCP server focuses on Git merge-conflict resolution. It identifies conflicted files, measures the complexity of their hunks, and indicates which conflicts can be resolved automatically. The workflow is designed to let an agent process routine conflicts while leaving ambiguous or complex sections available for targeted review.

The server supports both inspection and mutation. An agent can examine the conflict state, simulate a resolution without changing files, request an explanation for a classification, apply a custom resolution, or validate and write an LLM-generated result. This makes it suitable for automated merge workflows that still need traceable decisions and explicit handling of risky hunks.

## How it works

The workflow starts with `gitwand_status`, which lists conflicted files together with each file's complexity and auto-resolvability. `gitwand_preview_merge` provides a dry run with resolution statistics and a risk assessment, allowing an agent to inspect the expected result before writing anything.

`gitwand_resolve_conflicts` handles trivial conflicts and returns a `DecisionTrace` alongside any `pendingHunks`. For a specific pending hunk, `gitwand_explain_hunk` returns the classification reason and surrounding context. An agent can then use `gitwand_resolve_hunk` to propose a resolution from the available ours, theirs, and base versions, or provide its own result through `gitwand_apply_resolution`.

LLM-generated resolutions can be sent to `gitwand_resolve_hunk_llm`. That operation validates the proposed change through a post-merge gate before applying it to disk, adding a validation step between an agent's output and the repository state.

## Tools and capabilities

- `gitwand_status` lists conflicted files, complexity, and automatic-resolution status.
- `gitwand_preview_merge` performs a non-writing merge-resolution preview with statistics and risk assessment.
- `gitwand_resolve_conflicts` resolves trivial conflicts and reports decisions plus unresolved hunks.
- `gitwand_explain_hunk` explains a hunk's classification with trace and context.
- `gitwand_resolve_hunk` asks the connected agent to propose a resolution using ours, theirs, and base.
- `gitwand_apply_resolution` writes a custom resolution for a selected complex hunk.
- `gitwand_resolve_hunk_llm` validates and applies an LLM-proposed resolution through the post-merge gate.

## Limitations and notes

The server is specialized for merge-conflict handling rather than general Git repository management. Automatic resolution is limited to conflicts classified as trivial; complex hunks remain pending for an agent or developer to resolve. Operations that apply resolutions modify files on disk, while the preview operation is intended for inspecting results without writing changes. Decision traces, pending-hunk data, context, and risk information can help an integrating agent keep those changes reviewable.

_Full upstream README: https://allmcps.com/mcp/gitwand/readme_

