Skip to main content
Glama

git-context-mcp

MCP-сервер, который отвечает на один вопрос, возникающий у каждого разработчика: «почему этот код существует?»

git blame говорит вам, кто написал строку. Этот инструмент говорит вам, почему.

Получив файл и диапазон строк, git-context-mcp отслеживает историю коммита, находит pull request, в котором он был добавлен, читает описание PR и выводит все связанные GitHub-задачи — всё за один раз, прямо в Claude.


Демонстрация

You: Why does line 87 of src/auth/session.ts exist?

Claude (using blame_context):
  Commit `a3f9c12` by Sarah Chen on 2024-08-14
  Message: "fix: rotate session tokens on privilege escalation"

  PR #441 — "Security: fix session fixation vulnerability"
  Merged: 2024-08-15  |  Labels: security, critical

  PR Description:
  > After the pen test in sprint 22, we found that session tokens
  > weren't being rotated when a user's role changed. This allows
  > a stolen low-priv token to be used after the account is promoted.

  Linked Issue #389 — "Session token not rotated on role change" (closed)
  > Reported by @contractor-red: "I was able to reuse a captured
  > token after my account was upgraded to admin..."

Больше не нужно копаться в git log, искать в GitHub и сверять трекеры задач. Claude делает это за один шаг.


Related MCP server: Selvedge

Инструменты

Инструмент

Что он делает

blame_context

Файл + диапазон строк → коммит + описание PR + связанные задачи

commit_story

Хэш коммита → полная история (сообщение, статистика diff, PR, задачи)

file_history

Файл → последние N коммитов, каждый с аннотацией PR и задач

search_commits

Ключевое слово → соответствующие коммиты с контекстом PR/задач

file_contributors

Файл → ранжированная таблица авторов (коммиты, количество строк, даты активности)


Установка

Вариант 1 — npx (без установки)

claude mcp add git-context -- npx git-context-mcp

Вариант 2 — глобальная установка

npm install -g git-context-mcp
claude mcp add git-context -- git-context-mcp

Вариант 3 — ручная настройка

Добавьте в ~/.claude/claude_mcp_config.json:

{
  "mcpServers": {
    "git-context": {
      "command": "npx",
      "args": ["git-context-mcp"]
    }
  }
}

Затем перезапустите Claude Code.


Требования

  • Claude Code (или любой MCP-совместимый клиент)

  • git в PATH

  • gh CLI (установка) + gh auth login для поиска PR/задач GitHub

    • Работает и без gh — просто пропускает контекст PR/задач


Примеры использования

После установки общайтесь с Claude естественным образом в любом git-репозитории:

"Why does line 42 of src/db/connection.ts exist?"
"What's the story behind commit d4a8f91?"
"Who owns the most of src/payments/stripe.ts?"
"When was the rate limiting added? Search commits for 'rate limit'"
"Show me the last 5 changes to src/api/auth.ts and why each was made"

Как это работает

  1. blame_context запускает git blame -p для ваших строк, чтобы найти хэш(и) коммита

  2. Для каждого коммита он вызывает git show для получения полного сообщения и статистики diff

  3. Он обращается к API GitHub (gh api /repos/:owner/:repo/commits/:hash/pulls) для поиска PR

  4. Он анализирует ссылки #NNN и /issues/NNN из тела PR и извлекает каждую задачу

  5. Всё возвращается в виде структурированного markdown для анализа Claude

Токены не сохраняются. Данные никуда не отправляются, кроме собственного API GitHub (так же, как и gh CLI).


Участие в разработке

PR приветствуются. Весь сервер находится в src/index.ts.

git clone https://github.com/muhannad-hash/git-context-mcp
cd git-context-mcp
npm install
npm run dev   # watch mode

Лицензия

MIT

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Change tracking for AI-era codebases. AI agents call it to log structured change events (entity + diff + reasoning) before the session ends, then query history with diff, blame, history, changeset, and search. Captures the intent that would otherwise evaporate.
    8
    19
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Indexes commit history to create a queryable expert, providing insights into code evolution, developer intent, and hidden patterns beyond static code analysis.
    MIT

View all related MCP servers

Related MCP Connectors

  • Memory for coding agents: the decisions, the dead ends, and where the last session stopped.

  • Individual-analyst context layer: recall, remember, and reconcile your data and engineering context.

  • Independent static verification for exact immutable public GitHub commits.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muhannad-hash/git-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server