{
  "markdown": "# SemaMerge\n\n<!-- mcp-name: io.github.vineethwilson15/semamerge -->\n\n[![npm version](https://img.shields.io/npm/v/semamerge.svg)](https://www.npmjs.com/package/semamerge)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![semamerge MCP server](https://glama.ai/mcp/servers/vineethwilson15/semamerge/badges/score.svg)](https://glama.ai/mcp/servers/vineethwilson15/semamerge)\n\nAn MCP (Model Context Protocol) server that detects **semantic merge conflicts** between Git branches using AST-level analysis.\n\nWhen two branches change code in ways that Git merges cleanly but are functionally incompatible, SemaMerge catches it before the merge breaks your app.\n\n## What It Detects\n\n| Conflict Type | Example |\n|---|---|\n| **Type signature change** | Branch A changes `getUser()` return type, Branch B calls `getUser().address` |\n| **Removed/renamed export** | Branch A removes `export function validate()`, Branch B adds `import { validate }` |\n| **Parameter change** | Branch A adds required param to function, Branch B calls with old signature |\n| **Interface/contract break** | Branch A adds required field to interface, Branch B implements without it |\n| **Enum/constant change** | Branch A removes `Status.PENDING`, Branch B uses `Status.PENDING` |\n| **Import path change** | Branch A moves file, Branch B imports from old path |\n\n## Installation\n\n```bash\nnpx semamerge\n```\n\nOr install globally:\n\n```bash\nnpm install -g semamerge\n```\n\nOr clone and build from source:\n\n```bash\ngit clone https://github.com/vineethwilson15/semamerge.git\ncd semamerge\nnpm install\nnpm run build\n```\n\n## MCP Tools\n\n### `check_merge_safety`\nQuick pre-merge check. Returns a risk score (safe/warning/danger).\n\n```json\n{\n  \"repoPath\": \"/path/to/repo\",\n  \"sourceBranch\": \"feature-x\",\n  \"targetBranch\": \"main\"\n}\n```\n\n### `analyze_branches`\nDeep analysis with per-file breakdown of all semantic conflicts.\n\n```json\n{\n  \"repoPath\": \"/path/to/repo\",\n  \"branchA\": \"feature-x\",\n  \"branchB\": \"feature-y\",\n  \"baseBranch\": \"main\"\n}\n```\n\n### `list_semantic_changes`\nLists all semantic changes on a branch (functions, exports, types, etc.).\n\n```json\n{\n  \"repoPath\": \"/path/to/repo\",\n  \"branch\": \"feature-x\",\n  \"baseBranch\": \"main\"\n}\n```\n\n### `analyze_file_pair`\nDeep-dive into a specific file's semantic diff between two branches.\n\n```json\n{\n  \"repoPath\": \"/path/to/repo\",\n  \"filePath\": \"src/utils.ts\",\n  \"branchA\": \"feature-x\",\n  \"branchB\": \"main\"\n}\n```\n\n## Configuration\n\n### VS Code (Copilot)\n\nAdd to your VS Code `settings.json`:\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"semamerge\": {\n        \"command\": \"node\",\n        \"args\": [\"/path/to/semamerge/dist/index.js\"]\n      }\n    }\n  }\n}\n```\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"semamerge\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/semamerge/dist/index.js\"]\n    }\n  }\n}\n```\n\n## Supported Languages\n\n- TypeScript / JavaScript (`.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`)\n- Python support planned\n\n## How It Works\n\n1. **Git layer** — Reads file content from branches without checkout using `git show`\n2. **AST parsing** — Parses source code with tree-sitter (WASM) into syntax trees\n3. **Semantic extraction** — Walks ASTs to extract function signatures, types, exports, imports, enums\n4. **Three-way comparison** — Computes semantic diffs from common ancestor to each branch\n5. **Conflict detection** — Cross-references changes to find incompatibilities\n\n## Development\n\n```bash\nnpm run build    # Compile TypeScript\nnpm run dev      # Watch mode\nnpm test         # Run tests\n```\n\n## License\n\nMIT\n",
  "bytes": 3643,
  "sha": "09cfd5f33e7f99e50062f9bfc52402904167b4eaebdd7506b8bbf6108689c80e",
  "repo_slug": "vineethwilson15/semamerge",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_vineethwilson15_semamerge_81b70586/readme"
}