Skip to main content
Glama

SemaMerge

npm version License: MIT

AST 수준 분석을 사용하여 Git 브랜치 간의 **의미론적 병합 충돌(semantic merge conflicts)**을 감지하는 MCP(Model Context Protocol) 서버입니다.

두 브랜치가 Git 상으로는 깔끔하게 병합되지만 기능적으로는 호환되지 않는 방식으로 코드를 변경할 때, SemaMerge는 병합으로 인해 앱이 중단되기 전에 이를 포착합니다.

감지 항목

충돌 유형

예시

타입 시그니처 변경

브랜치 A가 getUser() 반환 타입을 변경하고, 브랜치 B가 getUser().address를 호출

내보내기(export) 제거/이름 변경

브랜치 A가 export function validate()를 제거하고, 브랜치 B가 import { validate }를 추가

매개변수 변경

브랜치 A가 함수에 필수 매개변수를 추가하고, 브랜치 B가 이전 시그니처로 호출

인터페이스/계약 중단

브랜치 A가 인터페이스에 필수 필드를 추가하고, 브랜치 B가 이를 구현하지 않음

열거형(Enum)/상수 변경

브랜치 A가 Status.PENDING을 제거하고, 브랜치 B가 Status.PENDING을 사용

가져오기(import) 경로 변경

브랜치 A가 파일을 이동하고, 브랜치 B가 이전 경로에서 가져오기 시도

Related MCP server: SYKE

설치

npx semamerge

또는 전역 설치:

npm install -g semamerge

또는 소스에서 복제 및 빌드:

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

MCP 도구

check_merge_safety

빠른 병합 전 검사. 위험 점수(안전/경고/위험)를 반환합니다.

{
  "repoPath": "/path/to/repo",
  "sourceBranch": "feature-x",
  "targetBranch": "main"
}

analyze_branches

모든 의미론적 충돌에 대한 파일별 분석을 포함한 심층 분석.

{
  "repoPath": "/path/to/repo",
  "branchA": "feature-x",
  "branchB": "feature-y",
  "baseBranch": "main"
}

list_semantic_changes

브랜치의 모든 의미론적 변경 사항(함수, 내보내기, 타입 등)을 나열합니다.

{
  "repoPath": "/path/to/repo",
  "branch": "feature-x",
  "baseBranch": "main"
}

analyze_file_pair

두 브랜치 간 특정 파일의 의미론적 차이에 대한 심층 분석.

{
  "repoPath": "/path/to/repo",
  "filePath": "src/utils.ts",
  "branchA": "feature-x",
  "branchB": "main"
}

설정

VS Code (Copilot)

VS Code의 settings.json에 추가하세요:

{
  "mcp": {
    "servers": {
      "semamerge": {
        "command": "node",
        "args": ["/path/to/semamerge/dist/index.js"]
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json에 추가하세요:

{
  "mcpServers": {
    "semamerge": {
      "command": "node",
      "args": ["/path/to/semamerge/dist/index.js"]
    }
  }
}

지원 언어

  • TypeScript / JavaScript (.ts, .tsx, .js, .jsx, .mjs, .cjs)

  • Python 지원 예정

작동 원리

  1. Git 계층git show를 사용하여 체크아웃 없이 브랜치에서 파일 내용을 읽습니다.

  2. AST 파싱 — tree-sitter(WASM)를 사용하여 소스 코드를 구문 트리로 파싱합니다.

  3. 의미론적 추출 — AST를 탐색하여 함수 시그니처, 타입, 내보내기, 가져오기, 열거형 등을 추출합니다.

  4. 3방향 비교 — 공통 조상에서 각 브랜치까지의 의미론적 차이를 계산합니다.

  5. 충돌 감지 — 변경 사항을 상호 참조하여 비호환성을 찾습니다.

개발

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

라이선스

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.

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

TDQS

A4/5.0

Scored across 4 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

Four tools is well-scoped for a semantic merge analysis server. Each tool covers a distinct level of analysis without redundancy or unnecessary bloat.

Completeness5/5

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.

Maintenance

ActivityInactive
ResponsivenessNo issues

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.
    113 npm
    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
    175
    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.
    32 npm
    MIT