Semamerge

io.github.vineethwilson15由 GitHub 帳號 vineethwilson15 發布v0.1.2更新於 Nov 3, 2026

Detects semantic merge conflicts between Git branches using AST-level analysis

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 伺服器,透過 AST 層級分析偵測 Git 分支之間的語意合併衝突,目前支援 TypeScript 與 JavaScript。

可以做什麼
  • 在來源分支與目標分支之間做快速的合併前安全檢查,回傳 safe/warning/danger 風險評分
  • 以共同祖先為基準深入分析兩個分支,並依檔案列出所有語意衝突
  • 列出某個分支上的語意變更,例如函式、匯出、型別、匯入與列舉
  • 檢視單一檔案在兩個分支之間的語意差異
  • 辨識型別簽章、參數、匯出、介面、列舉與匯入路徑等不相容變更
適用情境
適合在 TypeScript 或 JavaScript 儲存庫中審查或合併功能分支時,找出 Git 能乾淨合併但會破壞呼叫端、契約或匯入的改動。適用於合併前檢查與分支差異的程式碼審查。
執行需求
以本機 stdio 程序執行,通常透過 npx 或全域 npm 安裝,因此需要 Node.js 與 npm。每次工具呼叫需提供本機 Git 儲存庫路徑,且該儲存庫需可被程序讀取。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
工具接收儲存庫路徑與分支名稱,會讀取該儲存庫的 Git 歷史與檔案內容,請只指向你願意讓助理存取的儲存庫。說明中稱其為唯讀分析,但在自動化合併流程中依賴前請自行確認。僅支援 TypeScript 與 JavaScript,Python 支援仍在規劃中。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Semamerge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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 TypeExample
Type signature changeBranch A changes getUser() return type, Branch B calls getUser().address
Removed/renamed exportBranch A removes export function validate(), Branch B adds import { validate }
Parameter changeBranch A adds required param to function, Branch B calls with old signature
Interface/contract breakBranch A adds required field to interface, Branch B implements without it
Enum/constant changeBranch A removes Status.PENDING, Branch B uses Status.PENDING
Import path changeBranch A moves file, Branch B imports from old path

Installation

bash
npx semamerge

Or install globally:

bash
npm install -g semamerge

Or clone and build from source:

bash
git clone https://github.com/vineethwilson15/semamerge.gitcd semamergenpm installnpm run build

MCP Tools

check_merge_safety

Quick pre-merge check. Returns a risk score (safe/warning/danger).

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

analyze_branches

Deep analysis with per-file breakdown of all semantic conflicts.

json
{  "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.).

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

analyze_file_pair

Deep-dive into a specific file's semantic diff between two branches.

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

Configuration

VS Code (Copilot)

Add to your VS Code settings.json:

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

Claude Desktop

Add to claude_desktop_config.json:

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

bash
npm run build    # Compile TypeScriptnpm run dev      # Watch modenpm test         # Run tests

License

MIT

來源:README.md,提交 f01682b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分