Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Monitors origin/main for new commits, analyzes conflict risk with local AI (Ollama), and syncs your working branch via rebase or merge with automatic stash/unstash and conflict resolution options.

README.md

Git Sync Guardian

MCP Server that watches main for new commits and keeps your working branch in sync — powered by local AI (Ollama).

What it does

When you're working on a feature branch, main keeps moving. Git Sync Guardian:

  1. Monitors origin/main at regular intervals
  2. Analyzes incoming changes with Ollama (local LLM) to assess conflict risk
  3. Notifies you via macOS native dialogs with risk level and recommended strategy
  4. Syncs your branch (rebase or merge) with automatic stash/unstash
  5. Handles conflicts — offers manual resolution, AI-assisted (Claude Code), or abort

Requirements

  • Node.js >= 18
  • Claude Code (MCP host)
  • Ollama running locally (optional — falls back to heuristics if unavailable)
  • macOS (notifications use osascript)

Installation

Automatic (recommended)

curl -fsSL https://raw.githubusercontent.com/Mamisedra/git-sync-guardian/main/install.sh | bash

This will clone to ~/.git-sync-guardian, build, and register the MCP server in Claude Code automatically.

To install in a custom directory:

curl -fsSL https://raw.githubusercontent.com/Mamisedra/git-sync-guardian/main/install.sh | bash -s -- /path/to/install

Manual

git clone https://github.com/Mamisedra/git-sync-guardian.git
cd git-sync-guardian
npm install
npm run build

Then add to your ~/.claude.json:

{
  "mcpServers": {
    "git-sync-guardian": {
      "command": "node",
      "args": ["/absolute/path/to/git-sync-guardian/dist/index.js"]
    }
  }
}

Restart Claude Code to load the server.

Usage

Git Sync Guardian exposes 4 tools in Claude Code:

init-sync — Start monitoring

> Use init-sync on /path/to/my-repo

| Parameter | Default | Description | |-----------|---------|-------------| | repoPath | required | Absolute path to the git repo | | baseBranch | main | Branch to watch | | remoteName | origin | Git remote name | | intervalMinutes | 30 | Check interval in minutes |

Note: You must be on a feature branch (not main) to start monitoring.

status — Check current state

> Check git-sync-guardian status

Shows: monitoring state, divergence info, last analysis (strategy, risk level, conflict probability).

sync-now — Immediate sync

> Run sync-now

| Parameter | Default | Description | |-----------|---------|-------------| | strategy | auto | rebase, merge, or auto (uses AI recommendation) |

Performs: fetch → stash → rebase/merge → unstash. Detects conflicts and offers resolution options.

stop-sync — Stop monitoring

> Stop git-sync-guardian

How the AI analysis works

When divergence is detected, the diff is sent to a local Ollama model which returns:

  • Strategy: rebase (clean history) or merge (safer for conflicts)
  • Risk level: low / medium / high
  • Conflict likelihood: 0–100%
  • Reasoning: Short explanation

If Ollama is unavailable, a heuristic fallback kicks in:

  • No common files modified → rebase, low risk
  • Common files modified → risk assessment based on overlap
  • Many commits behind (>20) → merge preferred

Configuration

Environment variables:

| Variable | Default | Description | |----------|---------|-------------| | GSG_OLLAMA_URL | http://localhost:11434 | Ollama API endpoint | | GSG_OLLAMA_MODEL | qwen2.5vl | Ollama model for analysis | | GSG_LOG_LEVEL | info | Log level: debug, info, warn, error |

Architecture

src/
  index.ts              # MCP server entry point
  server.ts             # Tool registration (4 tools)
  core/
    sync-monitor.ts     # Main monitoring loop & sync orchestration
    git-operations.ts   # Git commands (fetch, rebase, merge, stash)
    diff-analyzer.ts    # Ollama AI analysis + heuristic fallback
    notifier.ts         # macOS native notifications (osascript)
  types/
    index.ts            # TypeScript interfaces & enums
  utils/
    config.ts           # Default configuration
    logger.ts           # Structured stderr logger

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Developer Tools servers.