semamerge
SemaMerge
An MCP (Model Context Protocol) server that detects semantic merge conflicts between Git branches using AST-level analysis.
When two branches change code in ways that Git merges cleanly but are functionally incompatible, SemaMerge catches it before the merge breaks your app.
What It Detects
Conflict Type | Example |
Type signature change | Branch A changes |
Removed/renamed export | Branch A removes |
Parameter change | Branch A adds required param to function, Branch B calls with old signature |
Interface/contract break | Branch A adds required field to interface, Branch B implements without it |
Enum/constant change | Branch A removes |
Import path change | Branch A moves file, Branch B imports from old path |
Related MCP server: SYKE
Installation
npx semamergeOr install globally:
npm install -g semamergeOr clone and build from source:
git clone https://github.com/vineethwilson15/semamerge.git
cd semamerge
npm install
npm run buildMCP Tools
check_merge_safety
Quick pre-merge check. Returns a risk score (safe/warning/danger).
{
"repoPath": "/path/to/repo",
"sourceBranch": "feature-x",
"targetBranch": "main"
}analyze_branches
Deep analysis with per-file breakdown of all semantic conflicts.
{
"repoPath": "/path/to/repo",
"branchA": "feature-x",
"branchB": "feature-y",
"baseBranch": "main"
}list_semantic_changes
Lists all semantic changes on a branch (functions, exports, types, etc.).
{
"repoPath": "/path/to/repo",
"branch": "feature-x",
"baseBranch": "main"
}analyze_file_pair
Deep-dive into a specific file's semantic diff between two branches.
{
"repoPath": "/path/to/repo",
"filePath": "src/utils.ts",
"branchA": "feature-x",
"branchB": "main"
}Configuration
VS Code (Copilot)
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"semamerge": {
"command": "node",
"args": ["/path/to/semamerge/dist/index.js"]
}
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"semamerge": {
"command": "node",
"args": ["/path/to/semamerge/dist/index.js"]
}
}
}Supported Languages
TypeScript / JavaScript (
.ts,.tsx,.js,.jsx,.mjs,.cjs)Python support planned
How It Works
Git layer — Reads file content from branches without checkout using
git showAST parsing — Parses source code with tree-sitter (WASM) into syntax trees
Semantic extraction — Walks ASTs to extract function signatures, types, exports, imports, enums
Three-way comparison — Computes semantic diffs from common ancestor to each branch
Conflict detection — Cross-references changes to find incompatibilities
Development
npm run build # Compile TypeScript
npm run dev # Watch mode
npm test # Run testsLicense
MIT
Available Tools
4 toolsanalyze_branchesA
Deep semantic analysis between two branches. Returns a detailed per-file report of all semantic changes and conflicts, including cross-file dependency issues.
Inputs: repoPath (required), branchA (required), branchB (required), baseBranch.
analyze_file_pairA
Deep-dive semantic diff of a single file between two branches. Shows exactly what each branch changed and where conflicts arise.
Inputs: repoPath (required), filePath (required), branchA (required), branchB (required).
check_merge_safetyA
Quick pre-merge safety check. Analyzes two branches for semantic conflicts that Git would miss (signature changes, removed exports, parameter mismatches, etc.). Returns a risk score: safe/warning/danger.
Inputs: repoPath (required), sourceBranch (required), targetBranch (required).
list_semantic_changesA
Lists all semantic changes on a branch (function additions/removals, export changes, type changes, etc.) relative to a base. Useful for understanding what semantically changed.
Inputs: repoPath (required), branch (required), baseBranch.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct analysis granularity: quick safety check, deep branch analysis, change listing, and single-file diff. The only minor overlap is between check_merge_safety and analyze_branches, but their quick-vs-detailed distinction is clear.
All tool names consistently follow a verb_noun pattern: check_merge_safety, analyze_branches, list_semantic_changes, analyze_file_pair. The naming style is uniform and predictable.
Four tools is well-scoped for a semantic merge analysis server. Each tool covers a distinct level of analysis without redundancy or unnecessary bloat.
The tools cover the full analysis workflow: quick safety triage, comprehensive branch-level analysis, semantic change listing, and per-file deep dives. No obvious gaps exist for the stated analysis-focused purpose.
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
A MCP server built for developers enabling Git based project management with project and personal…
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Related MCP Servers
- AlicenseCqualityDmaintenanceMCP server providing Git-related functionalities, primarily a tool to generate diffs for Git merge commits against their first parent.4MIT
- AlicenseNot gradedqualityDmaintenanceAI code impact analysis MCP server that monitors file changes, maps dependency graphs, detects cascading breakage, and gates builds before damage spreads.93 npm2Elastic 2.0
- AlicenseNot gradedqualityAmaintenancean MCP server that auto-resolves Git merge conflicts so agents only touch the complex hunks — deterministic pattern engine with confidence scores and a full decision trace, plus merge/rebase preview and hunk-level resolution tools199MIT
- AlicenseNot gradedqualityDmaintenanceMulti-language code intelligence MCP server providing structured code analysis including symbol search, references, hierarchies, and change impact. Supports 25 languages with persistent indexing and LSP integration.52 npmMIT