Skip to content

hegner123/conflicts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conflicts

Merge conflict parser MCP tool. Reads files with git conflict markers (<<<<<<< / ======= / >>>>>>>) and outputs structured JSON with each conflict's ours/theirs content, line numbers, branch refs, and surrounding context.

Supports standard and diff3 (|||||||) conflict styles.

Installation

go build -o conflicts
codesign -s - conflicts
sudo cp conflicts /usr/local/bin/

Or with just:

just install

Usage

CLI

conflicts --cli --file path/to/conflicted.txt
conflicts --cli --file file1.go,file2.go --context 3

MCP Server

Add to your Claude config:

{
  "mcpServers": {
    "conflicts": {
      "command": "conflicts"
    }
  }
}

Output

{
  "files": [
    {
      "file": "path/to/file.go",
      "conflicts": [
        {
          "file": "path/to/file.go",
          "line": 10,
          "end_line": 16,
          "ours_ref": "HEAD",
          "theirs_ref": "feature-branch",
          "ours": "our version of the code",
          "theirs": "their version of the code",
          "context_above": "line before conflict",
          "context_below": "line after conflict"
        }
      ],
      "count": 1
    }
  ],
  "total": 1,
  "has_diff3": false,
  "summary": "Found 1 conflict in 1 file"
}

Parameters

Parameter Type Required Default Description
file string/array yes - File path(s) to parse
context_lines int no 1 Context lines above/below each conflict

License

MIT

About

Merge conflict parser MCP tool. Structured JSON output from git conflict markers

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors