Skip to main content
Glama
Git Insight MCP

Git Insight MCP

by HasanJahidul

git-insight-mcp

MCP를 통한 의미론적 git 쿼리. git log를 넘어 모든 라인, 파일 또는 브랜치에 대해 누가/무엇을/언제/왜 했는지 답변합니다.

demo

terminal-history-mcp 및 localhost-mcp와 함께 사용하세요. 함께 사용하면 무엇을 실행했는지, 무엇이 실행 중인지, 무엇을 변경했는지 알 수 있습니다.

왜 필요한가요?

개발자들은 끊임없이 질문하지만 git은 제대로 답변하지 못합니다:

  • "이 함수를 마지막으로 건드린 사람이 누구인가?" — git blame은 라인만 제공하며, 영역별 작성자를 알려주지 않습니다.

  • "이 라인을 도입한 PR은 무엇인가?" — 수동 작업: blame → 커밋 SHA → GH 검색

  • "어떤 파일들이 항상 함께 변경되는가?" — 내장 기능 없음

  • "30일 이상 병합되지 않은 브랜치 표시" — 복잡한 bash 한 줄 명령 필요

  • "지난주에 무엇을 작업했는가?" — 수동 로그 확인

LLM 에이전트가 안전하게 편집하려면 이러한 컨텍스트가 필요합니다. 현재는 git log -n 5만 사용하여 모든 것을 놓치고 있습니다.

Related MCP server: semamerge

설치

npm install -g git-insight-mcp

Claude Code에 연결:

claude mcp add --scope user git-insight -- git-insight-mcp

또는 MCP 호환 클라이언트. stdio MCP 서버로 실행됩니다.

PR / 이슈 조회를 위해 GitHub 토큰을 설정하세요:

export GH_TOKEN=ghp_...

토큰이 없어도 로컬 git 도구는 계속 작동합니다. PR 연결 기능은 건너뜁니다.

도구

도구

목적

who_touched

작성자별로 blame 그룹화. 라인, 커밋, 마지막 수정, 주요 소유자. 선택적으로 라인 범위 지정 가능.

introducing_pr

라인(또는 커밋)을 도입한 PR 찾기. 병합 메시지를 먼저 파싱하고, 실패 시 GitHub API를 사용합니다.

co_change

입력 파일과 가장 자주 함께 변경되는 파일들.

branch_hygiene

앞선/뒤처진 커밋, 마지막 커밋, 병합 상태, 오래된 플래그가 포함된 브랜치 목록.

recent_work

스탠드업 도우미: 특정 기간 동안 작성자의 커밋 + 파일 + 추가/삭제 내역.

commit_context

전체 커밋 컨텍스트: 제목, 본문, 파일, PR, 관련 이슈.

샘플 출력 (who_touched)

{
  "file": "src/auth.ts",
  "total_lines": 124,
  "authors": [
    { "name": "alice", "email": "alice@x.com", "lines": 87, "commits": 12, "last_commit_date": "2026-04-12T10:33:01.000Z" },
    { "name": "bob", "email": "bob@x.com", "lines": 37, "commits": 4, "last_commit_date": "2026-01-03T18:14:55.000Z" }
  ],
  "primary_owner": "alice"
}

CLI 사용법 (정상 작동 확인)

git-insight-mcp who-touched src/auth.ts
git-insight-mcp co-change src/auth.ts
git-insight-mcp branches
git-insight-mcp recent alice
git-insight-mcp commit a3e577e
git-insight-mcp intro-pr src/auth.ts:42
git-insight-mcp intro-pr a3e577e
git-insight-mcp                # MCP stdio server

소스에서 빌드

git clone https://github.com/HasanJahidul/git-insight-mcp.git
cd git-insight-mcp
npm install
npm run build
node dist/cli.js branches

제한 사항 (v0.1)

  • GitHub 전용 (GitLab/Bitbucket은 아직 지원하지 않음).

  • co_change는 O(윈도우 × 커밋당 파일 수)이며, 기본적으로 1000개 커밋으로 제한됩니다.

  • 함수 단위 blame은 AST가 아닌 라인 범위 기준입니다. 이름 변경은 아직 추적되지 않습니다.

  • GH API 속도 제한이 적용됩니다 (인증 시 시간당 5000회). 이번 버전에서는 PR 결과가 캐싱되지 않습니다.

라이선스

MIT

Available Tools

6 tools
branch_hygieneA
Read-onlyIdempotent

Read-only. Inventory of branches with ahead/behind counts versus the default branch, last commit date and author, merged status, and a stale flag (no commits in stale_days days). Use it to find unmerged, abandoned branches. The default branch itself is excluded from the list. Pure local git; no network. Returns { count, branches, default_branch_excluded }.

Inputs: cwd, remote, stale_days. Returns: count, branches, default_branch_excluded

co_changeA
Read-onlyIdempotent

Read-only. Files that historically change together with the input file — answers "if I edit X, what else should I check?". Mines up to window recent commits that touch file, counts how often each other file appears alongside it, and returns those above threshold, with the co-occurrence count and ratio (count / commits-touching-file), capped at limit. Pure local log mining; no network. Cost is O(window × files-per-commit) — keep window ≤ a few thousand on large repos.

Inputs: file (required), cwd, limit, window, +1 more. Returns: file, co_changed, total_commits_touching

commit_contextA
Read-onlyIdempotent

Read-only. Everything about one commit in a single call: subject, body, changed files with per-file insertions/deletions, totals, the linked PR (parsed from the merge message, or via the GitHub API when GH_TOKEN/GITHUB_TOKEN is set), and issue numbers referenced in the message (Fixes #N, Closes #N). Errors if the SHA does not resolve in cwd. May make one outbound GitHub API call for PR enrichment.

Inputs: sha (required), cwd. Returns: pr, sha, body, date, +6 more

introducing_prA
Read-onlyIdempotent

Read-only. Find the pull request that introduced a line or a commit. First resolves the line to a commit via git blame, then reads the local merge-commit message; if that has no PR reference and GH_TOKEN/GITHUB_TOKEN is set, falls back to the GitHub REST API. Without a token the local path still works; pr is null when nothing can be resolved (e.g. rebase-merged with no PR ref). Provide either commit, or both file and line. May make one outbound GitHub API call (subject to the 5000/h authed rate limit).

Inputs: cwd, file, line, commit. Returns: pr, author, commit, source, +2 more

recent_workA
Read-onlyIdempotent

Read-only. Standup / changelog helper: one author's commits in a time window with files touched and insertion/deletion totals. Defaults to the repo's user.name and the last 7 days. Pure local git; no network. Returns { author, since, commit_count, commits[] } where each commit has subject, date, files, insertions, deletions.

Inputs: cwd, limit, since, author. Returns: since, author, commits, commit_count

who_touchedA
Read-onlyIdempotent

Read-only. Code ownership for a file via git blame, aggregated by author. Returns each author's line count, commit count, and most recent commit date, plus the primary_owner (most lines). Pass line_start/line_end to scope to one region (e.g. a single function). Errors if cwd is not a git repo or file is untracked. Cost scales with file size; instant for typical files.

Inputs: file (required), cwd, function, line_end, +1 more. Returns: file, authors, total_lines, primary_owner

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct git analysis task: branches, file co-change, commit details, PR introduction, recent work, and file ownership. No functional overlap is apparent.

    Naming Consistency4/5

    All names use lowercase snake_case and are descriptive compound nouns (e.g., branch_hygiene, who_touched). While not strictly verb_noun, the pattern is consistent and readable.

    Tool Count5/5

    Six tools is a well-scoped set for a git insight server, covering key analyses without being overwhelming or too sparse.

    Completeness3/5

    The set covers branch analysis, co-change, commit details, PR discovery, recent work, and blame. Missing common operations like branch diff or commit log filtering, but still functional for the intended domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Automatically extracts architectural decisions, patterns, and insights from Git commits to build a local, structured project memory. It exposes this living context to AI tools via MCP, allowing them to understand the historical reasoning and evolution behind your codebase.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that detects semantic (non-textual) merge conflicts between Git branches using AST-level analysis. Catches incompatible changes that Git merges cleanly — signature changes, removed exports, parameter changes, interface breaks, and cross-file dependency conflicts.
      4
      41 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Developers: Search your zsh, bash, or fish shell history from Claude Code, Cline, Cursor, Zed, or any MCP client using tools like search_history (full-text with timestamp/CWD/exit code), recent_in_dir, failed_commands, and command_chains for multi-step sequences. Reindex after new activity. Local-only SQLite FTS5 with secrets redacted before storage.
      7
      41 npm
      5
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Inspect, manage, and kill local dev servers via MCP. Stop guessing what's on :3000. Five tools: list servers with framework detection, inspect ports, find zombies, diagnose conflicts, safe-kill with dry-run default. Local, no cloud, no telemetry.
      5
      6 npm
      4
      MIT