/ Каталог / Песочница / codebase-memory-mcp
● Сообщество DeusData ⚡ Сразу

codebase-memory-mcp

автор DeusData · DeusData/codebase-memory-mcp

Index any codebase into a persistent knowledge graph — 66 languages, sub-ms queries, 99% fewer tokens than file-by-file exploration.

codebase-memory-mcp builds a persistent knowledge graph from entire codebases using tree-sitter parsing across 66 languages. It indexes the Linux kernel (28M LOC) in 3 minutes, supports Cypher-like queries, call graph tracing, git diff mapping, and optional 3D visualization. Single static binary with zero dependencies, auto-configures for 11+ AI agents.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

codebase-memory.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "codebase-memory",
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "codebase-memory": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/DeusData/codebase-memory-mcp"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add codebase-memory -- TODO 'See README: https://github.com/DeusData/codebase-memory-mcp'

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: codebase-memory-mcp

How to quickly understand a new codebase with codebase-memory

👤 Developers onboarding onto an unfamiliar project ⏱ ~15 min beginner

Когда использовать: You just joined a team or started working on a new repo and need to understand its architecture fast.

Предварительные требования
  • codebase-memory installed — curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
Поток
  1. Index the codebase
    Index this project repository and give me an architecture overview.✓ Скопировано
    → High-level module map with key entry points and dependencies
  2. Explore a specific module
    Show me the call graph for the authentication module. What functions does login() call?✓ Скопировано
    → Call chain from login through middleware, validation, and database
  3. Find related code
    Search the graph for all functions that interact with the user table.✓ Скопировано
    → List of functions with file locations and relationships

Итог: A solid mental model of the codebase architecture in minutes instead of hours.

Подводные камни
  • Indexing very large monorepos takes time on first run — Use index_status to check progress. Subsequent queries are instant since the graph persists.
Сочетать с: filesystem · github

Analyze the impact of a code change before refactoring

👤 Senior engineers planning a refactoring effort ⏱ ~20 min intermediate

Когда использовать: You want to know what will break before you rename, move, or delete a function or class.

Предварительные требования
  • Codebase indexed — Run index_repository first
Поток
  1. Trace all callers
    Trace all call paths to the deprecated processPayment() function across the entire codebase.✓ Скопировано
    → Complete list of callers with file paths and call depths
  2. Map git changes to symbols
    I changed these files in my branch. Use detect_changes to show which symbols in the graph are affected.✓ Скопировано
    → List of affected functions and their downstream dependents

Итог: A complete impact analysis showing all code that needs to change.

Подводные камни
  • Graph may be stale if code changed since last index — Re-run index_repository after significant code changes
Сочетать с: github · filesystem

Комбинации

Сочетайте с другими MCP — эффект x10

codebase-memory + github

Index a repo, then use GitHub MCP to find PRs that affect critical call paths

Index our repo, trace all callers of the auth middleware, then check if any open PRs modify those paths.✓ Скопировано
codebase-memory + filesystem

Index locally, query the graph, then edit the found files directly

Find all functions that call the deprecated API, then update each one to use the new API.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
index_repository path: str Index a codebase into the knowledge graph (run once, persists) 0
search_graph label?: str, pattern?: str Search the graph by label or pattern 0
trace_call_path from: str, to: str Find call chains between two functions 0
detect_changes diff: str Map git diffs to affected symbols in the graph 0
get_architecture project?: str Get a high-level architecture overview of the indexed codebase 0
query_graph query: str Run a Cypher-like query against the graph 0
search_code pattern: str Grep-style text search across indexed code 0

Стоимость и лимиты

Во что обходится

Квота API
N/A — fully local
Токенов на вызов
50–500 tokens per query (vs 2000+ for reading files directly)
Деньги
Free
Совет
Index once, query many times. The graph persists between sessions so you don't re-index.

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: N/A — no external credentials
Исходящий трафик: 100% local processing. Your code never leaves your machine.

Устранение неполадок

Частые ошибки и исправления

Indexing fails on large repo

Ensure sufficient disk space for the graph database. For very large repos (>1M LOC), first indexing may take several minutes.

Проверить: Check index_status for progress
Language not parsed correctly

Verify your language is in the 66 supported languages. Check tree-sitter grammar availability.

Проверить: list_projects to see indexed stats
Graph queries return empty results

The codebase may not be indexed yet. Run index_repository first, then wait for completion.

Проверить: index_status

Альтернативы

codebase-memory-mcp в сравнении

АльтернативаКогда использоватьКомпромисс
filesystem MCPYou just need to read specific files rather than understand the whole codebaseNo graph, no call tracing — but zero setup

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills