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 分