Skip to content

MCP Server ​

GitWand ships an MCP (Model Context Protocol) server that exposes its conflict resolution engine to AI agents. Any MCP-compatible client can use it — Claude Code, Claude Desktop, Cursor, Windsurf, Continue, and others.

The server runs over stdio and requires no API keys or network access. It works entirely with local Git repositories.

Installation ​

Use directly via npx (no install needed):

bash
npx -y @gitwand/mcp

Or install globally:

bash
npm install -g @gitwand/mcp

Or register with Claude Code in a single command:

bash
claude mcp add gitwand -- npx -y @gitwand/mcp

@gitwand/mcp is listed in the MCP Registry and ships with npm provenance attestations — you can verify that every release was built from the public devlint/GitWand repo in CI.

Install from the Desktop App (v2.10) ​

The easiest way to install @gitwand/mcp — or any other MCP server — is from Settings > MCP in the GitWand desktop app. It detects every AI client config file on your machine, shows which servers are already installed where, and writes the correct JSON fragment in one click.

The @gitwand/mcp card is pinned at the top of the list. If you have a repo open, the install fragment is pre-filled with --cwd /path/to/your/repo. Select the target config files and click Install — no terminal, no JSON editing.

If you prefer to configure manually, see below.

Configuration ​

Claude Desktop ​

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your OS:

json
{
  "mcpServers": {
    "gitwand": {
      "command": "npx",
      "args": ["@gitwand/mcp", "--cwd", "/path/to/your/repo"]
    }
  }
}

Claude Code ​

Global — add to ~/.claude.json:

json
{
  "mcpServers": {
    "gitwand": {
      "command": "npx",
      "args": ["-y", "@gitwand/mcp", "--cwd", "/path/to/your/repo"]
    }
  }
}

Per-project — add to .claude/settings.json in your repo:

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

Claude Code also ships with dedicated slash commands — see Slash Commands below.

Cursor / Windsurf / Other MCP Clients ​

Use the same command + args pattern. Refer to your client's MCP documentation for the configuration file location.

Tools ​

The MCP server exposes the tools below. The LLM resolution pair (gitwand_resolve_hunk, gitwand_resolve_hunk_llm) is described in the collaboration loop.

gitwand_status ​

List conflicted files in the current repo with their complexity and auto-resolvability.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory. Defaults to server cwd.

Returns: JSON with file count, total conflicts, auto-resolvable count, and per-file breakdown by conflict type.

gitwand_resolve_conflicts ​

Auto-resolve trivial merge conflicts using GitWand's pattern-based engine. Writes resolved files to disk unless dry_run is true.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory
filesstring[]NoSpecific files to resolve. Omit to auto-discover.
dry_runbooleanNoAnalyze without writing. Default: false.
policystringNoMerge policy: prefer-ours, prefer-theirs, prefer-merge, prefer-safety, strict

Returns: Summary + per-file results with resolutions (what was auto-resolved) and pendingHunks (what needs human/LLM attention). Each resolution includes confidence scores and a full DecisionTrace.

gitwand_preview_merge ​

Dry-run resolution on all conflicted files. Shows stats and a risk assessment (low / medium / high) without modifying any files.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory

Returns: Risk level, summary (total/resolvable/remaining), auto-resolve percentage, and full per-file detail.

gitwand_explain_hunk ​

Explain why a specific conflict hunk was classified as its type. Returns the full DecisionTrace with evaluation steps and the ours/theirs/base content.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory
filestringYesPath to the conflicted file (relative to cwd)
linenumberYesStart line of the hunk to explain

Returns: Classification type, explanation, confidence (score + dimensions + boosters/penalties), trace steps, and the raw ours/theirs/base content.

gitwand_apply_resolution ​

Apply a custom resolution to a specific conflict hunk. Replaces the conflict markers at the given line with the provided content, then re-checks for remaining conflicts.

It does not validate what it writes: no residual-marker or syntax check. For a resolution an agent wrote itself, gitwand_resolve_hunk_llm validates before writing.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory
filestringYesPath to the conflicted file
linenumberYesStart line of the conflict (the <<<<<<< line)
contentstringYesResolved content to replace the conflict block

Returns: Confirmation + remaining conflict count in the file.

gitwand_create_issue ​

File a GitHub issue on the repository the agent works in. It 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 goes exactly as the agent passed it), and what the secrets scan found. The agent is told to show you that preview and to create only once you agree; a create must carry the preview's previewId, so it can only send what was previewed, once. When your MCP client supports elicitation, GitWand also asks you directly to confirm the issue before creating it; without it, showing you the preview is up to the agent.

The issue goes to origin, or to its fork parent when issues are turned off (or the repository archived) on origin, as in the desktop app. It goes through the GitHub CLI (gh api, the whole issue as JSON on stdin, so nothing of it appears on a command line): signed in with gh auth login, or with GH_TOKEN/GITHUB_TOKEN in the server's environment; a GitHub Enterprise origin must be a host gh is signed in to (gh auth login --hostname …, or the host GH_HOST names — an enterprise token is only ever sent there), and an SSH alias from ~/.ssh/config is resolved to the host it connects to. Title, body, labels and assignees are scanned first with the repository's .gitwandrc secrets settings: a known secret pattern refuses the issue, even with dry_run: false, and secrets.ignore does not apply (a cloned repository cannot allow-list a value out of a public issue); a high-entropy string only warns.

Parameters:

ParameterTypeRequiredDescription
cwdstringNoWorking directory
titlestringYesIssue title (1–256 characters)
bodystringNoMarkdown body (at most 65,536 characters)
labelsstring[]NoLabels (GitHub creates a missing one only for someone who can push there); need triage rights on the target
assigneesstring[]NoLogins to assign (@me for yourself); need triage rights on the target
repostringNoowner/repo: origin's repository or its fork parent
dry_runbooleanNoDefault true (preview). false creates the issue
preview_idstringWith dry_run: falseThe previewId of a preview of this very issue: a create without it, or with other arguments, is refused

Returns: the preview (with the host and repo it goes to), or { created, confirmedBy, host, repo, number, url }: confirmedBy is user when GitWand asked you through the client, agent when the client cannot ask and the agent's preview stood for your yes.

Errors are { error, message } with a stable code:

CodeWhen
invalid_title, invalid_body, invalid_list, invalid_dry_runAn argument is malformed (nothing ran)
not_a_repo, no_origin, unsupported_remotecwd is not a repository, has no origin, or origin is not a host/owner/repo URL
gh_missing, gh_auth_failedgh is not installed, or its sign-in was refused
not_githuborigin is on another forge, or on a host gh is not signed in to
target_lookup_failedgh could not read the repository (or your rights on the fork parent)
repo_not_allowed, issues_disabled, no_issue_targetrepo is not origin or its parent, takes no issues, or none does
cannot_triageLabels or assignees without triage rights on the target
secrets_foundA known secret pattern is in the issue
scan_failed, scan_unavailableThe scan with the repository's own patterns overran, or could not start
preview_required, preview_used, preview_expiredNo matching preview, its one create is used, or it is over an hour old
declined, confirm_failed, cancelledYou said no, you could not be asked, or the call was cancelled: nothing was created
create_failedGitHub refused it, or the connection never opened: nothing was created
create_uncertainThe create failed in a way that may still have filed it (a 5xx, a connection lost mid-way, an error gh never gave before): check before trying again

Resources ​

The server exposes 3 resources that clients can read for context:

URIDescription
gitwand://repo/conflictsCurrent conflict state — file list, counts, types, auto-resolvability
gitwand://repo/policyActive .gitwandrc configuration (or defaults if none exists)
gitwand://hunk/{file}/{line}Raw hunk content for a specific conflict — ours/theirs/base + trace

The collaboration loop ​

The MCP server enables a workflow where GitWand handles the trivial conflicts and the LLM tackles the complex ones:

  1. Preview — The agent calls gitwand_preview_merge to understand the conflict landscape: how many files, how many conflicts, what percentage GitWand can handle, and the overall risk level.

  2. Auto-resolve — The agent calls gitwand_resolve_conflicts. GitWand resolves the trivial patterns (same_change, one_side_change, whitespace_only, etc.) and returns pendingHunks for everything it couldn't handle.

  3. Understand — For each pending hunk, the agent has the ours/theirs/base content, the classification trace explaining why GitWand flagged it as complex, and the confidence dimensions showing where the uncertainty lies.

  4. Resolve — The agent writes its own resolution and calls gitwand_resolve_hunk_llm to apply it. GitWand checks it (no residual markers, valid JSON/YAML/TOML), writes it, and reports remaining conflicts.

  5. Verify — The agent can call gitwand_status to confirm all conflicts are resolved, or read gitwand://repo/conflicts for a final check.

This loop means the LLM never starts from scratch — it gets pre-triaged conflicts with full context, and only needs to handle the genuinely ambiguous cases.

Slash Commands ​

GitWand ships .claude/commands/ for Claude Code users:

/resolve ​

Full conflict resolution workflow:

  1. Checks conflict status with gitwand status
  2. Auto-resolves trivial conflicts with gitwand resolve --ci
  3. Interprets the JSON output
  4. Handles remaining complex conflicts with LLM reasoning
  5. Verifies the result

/preview ​

Merge preview and risk assessment:

  1. Simulates a merge with git merge --no-commit --no-ff
  2. Analyzes conflicts with gitwand resolve --ci --dry-run
  3. Assesses risk level
  4. Recommends whether to proceed or abort
  5. Cleans up the simulated merge

CLI flag ​

The --cwd flag lets you point the server at a specific repository:

bash
npx @gitwand/mcp --cwd /path/to/repo

If omitted, the server uses the current working directory.

Released under the MIT License.