Skip to main content
Glama

SemaMerge

npm version License: MIT semamerge MCP server

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 getUser() return type, Branch B calls getUser().address

Removed/renamed export

Branch A removes export function validate(), Branch B adds import { validate }

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 Status.PENDING, Branch B uses Status.PENDING

Import path change

Branch A moves file, Branch B imports from old path

Related MCP server: SYKE

Installation

npx semamerge

Or install globally:

npm install -g semamerge

Or clone and build from source:

git clone https://github.com/vineethwilson15/semamerge.git
cd semamerge
npm install
npm run build

MCP 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

  1. Git layer — Reads file content from branches without checkout using git show

  2. AST parsing — Parses source code with tree-sitter (WASM) into syntax trees

  3. Semantic extraction — Walks ASTs to extract function signatures, types, exports, imports, enums

  4. Three-way comparison — Computes semantic diffs from common ancestor to each branch

  5. Conflict detection — Cross-references changes to find incompatibilities

Development

npm run build    # Compile TypeScript
npm run dev      # Watch mode
npm test         # Run tests

License

MIT

Available Tools

4 tools
analyze_branchesA

Deep semantic analysis between two branches. Returns a detailed per-file report of all semantic changes and conflicts, including cross-file dependency issues.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoPathYesAbsolute path to the Git repository
branchAYesFirst branch to compare
branchBYesSecond branch to compare
baseBranchNoCommon base branch (auto-detected if not provided)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description provides some behavioral context (returns detailed report, includes conflicts and cross-file issues), but lacks details on potential side effects, performance, or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: one stating purpose and one describing output. No unnecessary words; efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately explains the return value (per-file report of changes and conflicts). However, it could mention prerequisites like branch existence or edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, and the description does not add new meaning beyond the schema's parameter descriptions. It only reiterates the general purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it performs deep semantic analysis between two branches and returns a per-file report of changes and conflicts, distinguishing it from sibling tools like 'analyze_file_pair' and 'check_merge_safety'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for semantic comparison but does not provide explicit guidance on when to use this tool versus alternatives like 'list_semantic_changes' or 'check_merge_safety'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

analyze_file_pairA

Deep-dive semantic diff of a single file between two branches. Shows exactly what each branch changed and where conflicts arise.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoPathYesAbsolute path to the Git repository
filePathYesPath to the file within the repository
branchAYesFirst branch
branchBYesSecond branch

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It discloses the tool 'shows' results, implying a read-only operation, but does not explicitly state it has no side effects or any performance considerations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is a single sentence that is direct and front-loaded with the purpose. While concise, a second sentence on usage or output could improve completeness without harming conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and 4 parameters, the description explains the tool's purpose and high-level output (changes and conflicts), but lacks details on return format or how results are presented, which is important for a diff tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all parameters. The description adds no extra meaning beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs a 'deep-dive semantic diff of a single file between two branches' and shows changes and conflicts. This distinguishes it from siblings like analyze_branches which likely covers multiple files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives (e.g., analyze_branches for broader diffs). The context is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoPathYesAbsolute path to the Git repository
sourceBranchYesThe branch being merged (source)
targetBranchYesThe branch being merged into (target)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must bear the full burden. It discloses the return risk score (safe/warning/danger), but does not mention side effects (e.g., read-only nature) or execution time. Adequate but could add more detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, concise and well-structured. No unnecessary words, and the key information is front-loaded (quick pre-merge safety check).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 3 required parameters and no output schema, the description provides a clear purpose and return risk score. It lacks details on the exact format of the risk score or any additional output, but is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (all three parameters have descriptions). The description adds that the tool analyzes branches for semantic conflicts, but this is implied by the overall purpose and does not significantly enhance parameter understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: a quick pre-merge safety check analyzing two branches for semantic conflicts. It specifies what it catches (signature changes, etc.) and distinguishes it from sibling tools like analyze_branches and list_semantic_changes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use before merging by stating 'Quick pre-merge safety check'. It mentions conflicts Git would miss, but does not explicitly state when not to use it or compare with alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoPathYesAbsolute path to the Git repository
branchYesBranch to analyze
baseBranchNoBase branch to compare against (defaults to merge-base with HEAD)

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must carry the burden. It states 'Lists all semantic changes' suggesting read-only behavior, but lacks details on return structure, pagination, side effects, or error conditions. Incomplete for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with action and examples. No wasted words, efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters, no output schema, and no annotations, the description explains purpose and examples but lacks details on return format, error handling, or performance. Adequate but with gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (3 parameters all described). The description adds little beyond the schema: it mentions 'relative to a base' which aligns with baseBranch, but no deeper semantics. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool lists semantic changes on a branch relative to a base, with specific examples like function additions/removals, export changes, type changes. Distinguishes itself from sibling tools (analyze_branches, analyze_file_pair, check_merge_safety) which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says 'Useful for understanding what semantically changed,' implying when to use it, but no explicit guidance on alternatives or when not to use it. No exclusions or comparisons with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.1
    • First observedanalyze_branches
    • First observedanalyze_file_pair
    • First observedcheck_merge_safety
    • First observedlist_semantic_changes

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a distinct aspect of semantic merge analysis: branch-wide comparison, single-file deep dive, quick safety check, and listing changes. No overlap in purpose.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (analyze_branches, analyze_file_pair, check_merge_safety, list_semantic_changes), making them predictable.

Tool Count5/5

With 4 tools, the server is well-scoped for its purpose. Each tool covers a core operation needed for semantic merge analysis without redundancy or bloat.

Completeness4/5

The set covers key operations: overview, file-level diff, safety check, and change listing. Missing a tool for cross-branch summary comparison, but the domain is analysis, not execution, so minor gap.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    AI code impact analysis MCP server that monitors file changes, maps dependency graphs, detects cascading breakage, and gates builds before damage spreads.
    137
    2
    Elastic 2.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    an 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 tools
    167
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Multi-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.
    71
    MIT

Latest Blog Posts

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/vineethwilson15/semamerge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server