Git Sync Guardian
Provides AI-powered analysis of git diffs using local Ollama models to assess conflict risk and recommend sync strategies.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Git Sync GuardianStart monitoring my repo at /Users/me/my-project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
Monitors
origin/mainat regular intervalsAnalyzes incoming changes with Ollama (local LLM) to assess conflict risk
Notifies you via macOS native dialogs with risk level and recommended strategy
Syncs your branch (rebase or merge) with automatic stash/unstash
Handles conflicts — offers manual resolution, AI-assisted (Claude Code), or abort
Related MCP server: Git Workflow MCP Server
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 | bashThis 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/installManual
git clone https://github.com/Mamisedra/git-sync-guardian.git
cd git-sync-guardian
npm install
npm run buildThen 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-repoParameter | Default | Description |
| required | Absolute path to the git repo |
|
| Branch to watch |
|
| Git remote name |
|
| 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 statusShows: monitoring state, divergence info, last analysis (strategy, risk level, conflict probability).
sync-now — Immediate sync
> Run sync-nowParameter | Default | Description |
|
|
|
Performs: fetch → stash → rebase/merge → unstash. Detects conflicts and offers resolution options.
stop-sync — Stop monitoring
> Stop git-sync-guardianHow the AI analysis works
When divergence is detected, the diff is sent to a local Ollama model which returns:
Strategy:
rebase(clean history) ormerge(safer for conflicts)Risk level:
low/medium/highConflict 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 |
|
| Ollama API endpoint |
|
| Ollama model for analysis |
|
| Log level: |
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 loggerLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceEnables automated GitHub Pull Request reviews using local Ollama, Cursor CLI, or Gemini CLI as AI providers. Supports customizable review prompts, comprehensive PR analysis, and optional auto-posting of reviews to GitHub.Last updated315MIT
- Flicense-quality-maintenanceEnables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.Last updated
- AlicenseAqualityDmaintenanceEnables AI assistants to create conventional Git commits, update changelogs, and optionally push changes to remote repositories.Last updated22MIT
- Alicense-qualityBmaintenanceProvides AI agents with persistent, branch-aware context memory by storing summaries per Git branch and automatically enriching them with recent commits and divergence from main. Enables agents to maintain coherent state across sessions without mixing contexts from different branches.Last updated8MIT
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mamisedra/git-sync-guardian'
If you have feedback or need assistance with the MCP directory API, please join our Discord server