codebase-memory-mcp-intelligence

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

codebase-memory-mcp Intelligence

codebase-memory-mcp 智能工具

Skill by ara.so — MCP Skills collection.
ara.so开发的Skill——MCP技能集合。

Overview

概述

codebase-memory-mcp is a high-performance code intelligence MCP server that indexes codebases into persistent knowledge graphs. It parses 155 languages using tree-sitter ASTs, resolves call graphs, detects HTTP routes, and enables sub-millisecond structural queries. The Linux kernel (28M LOC) indexes in 3 minutes; average repos in milliseconds.
Key capabilities:
  • Graph-based code intelligence: Functions, classes, calls, imports, inheritance as queryable nodes/edges
  • Structural search: Find symbols by pattern, trace call chains, detect dead code
  • Architecture analysis: Community detection, hotspots, layering, cross-service HTTP linking
  • Semantic search: Vector search with bundled embeddings (no API key required)
  • 155 languages: Tree-sitter grammars compiled into a single static binary
  • 14 MCP tools: All accessible via natural language in any compatible agent
codebase-memory-mcp是一款高性能代码智能MCP服务器,可将代码库索引为持久化知识图谱。它借助tree-sitter AST解析155种语言,解析调用图、检测HTTP路由,并支持亚毫秒级的结构化查询。Linux内核(2800万行代码)仅需3分钟即可完成索引;普通代码库的索引耗时仅需数毫秒。
核心功能:
  • 基于图谱的代码智能:函数、类、调用、导入、继承关系均可作为可查询的节点/边
  • 结构化搜索:按模式查找符号、追踪调用链、检测死代码
  • 架构分析:社区检测、热点识别、分层分析、跨服务HTTP链接
  • 语义搜索:内置嵌入模型的向量搜索(无需API密钥)
  • 支持155种语言:tree-sitter语法编译为单一静态二进制文件
  • 14种MCP工具:所有功能均可通过自然语言在兼容Agent中访问

Installation

安装

Quick Install (macOS/Linux)

快速安装(macOS/Linux)

bash
undefined
bash
undefined

Standard version

标准版

With graph visualization UI

带图谱可视化UI版本

Windows (PowerShell)

Windows(PowerShell)

powershell
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1
powershell
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1

Manual Installation

手动安装

Download from releases:
bash
undefined
发布页面下载:
bash
undefined

Extract and run installer

解压并运行安装脚本

tar xzf codebase-memory-mcp-*.tar.gz ./install.sh

The installer auto-detects Claude Code, Cursor, Codex CLI, Gemini CLI, Zed, OpenCode, Aider, VS Code, and other agents, configuring MCP entries automatically.
tar xzf codebase-memory-mcp-*.tar.gz ./install.sh

安装程序会自动检测Claude Code、Cursor、Codex CLI、Gemini CLI、Zed、OpenCode、Aider、VS Code等Agent,并自动配置MCP条目。

Verify Installation

验证安装

bash
codebase-memory-mcp --version
Restart your coding agent after installation.
bash
codebase-memory-mcp --version
安装完成后重启你的开发Agent。

Core Usage Patterns

核心使用模式

Indexing a Codebase

索引代码库

Via agent (recommended):
User: Index this project
The MCP server will call
index_repository
with the current working directory.
Via CLI:
bash
codebase-memory-mcp index /path/to/repo
Enable auto-indexing:
bash
codebase-memory-mcp config set auto_index true
codebase-memory-mcp config set auto_index_limit 50000
Auto-index runs on MCP session start for new projects and registers existing projects with the background file watcher.
通过Agent(推荐):
用户:索引这个项目
MCP服务器会调用
index_repository
,以当前工作目录为目标进行索引。
通过CLI:
bash
codebase-memory-mcp index /path/to/repo
启用自动索引:
bash
codebase-memory-mcp config set auto_index true
codebase-memory-mcp config set auto_index_limit 50000
自动索引会在MCP会话启动时针对新项目运行,并将现有项目注册到后台文件监视器中。

Architecture Overview

架构概览

Get a complete architectural summary in one call:
User: Show me the architecture of this codebase
This invokes
get_architecture
which returns:
  • Languages and package structure
  • Entry points (main functions, HTTP handlers)
  • HTTP/gRPC/GraphQL routes
  • Hotspot functions (high in/out degree)
  • Module boundaries via Louvain clustering
  • Layering analysis (presentation/business/data)
Example response structure:
json
{
  "languages": ["TypeScript", "Python", "Go"],
  "packages": ["src/api", "src/services", "src/models"],
  "entry_points": [
    {"name": "main", "file": "src/index.ts", "type": "Function"}
  ],
  "routes": [
    {"path": "/api/users", "method": "GET", "handler": "getUsers", "file": "src/api/users.ts"}
  ],
  "hotspots": [
    {"name": "processRequest", "in_degree": 15, "out_degree": 8, "file": "src/services/request.ts"}
  ],
  "boundaries": [
    {"module": "Community_0", "members": ["src/api/*"], "internal_edges": 45, "external_edges": 12}
  ]
}
一次调用即可获取完整的架构摘要:
用户:展示这个代码库的架构
该请求会调用
get_architecture
,返回以下内容:
  • 语言与包结构
  • 入口点(主函数、HTTP处理器)
  • HTTP/gRPC/GraphQL路由
  • 热点函数(高入度/出度)
  • 基于Louvain聚类的模块边界
  • 分层分析(表现层/业务层/数据层)
响应结构示例:
json
{
  "languages": ["TypeScript", "Python", "Go"],
  "packages": ["src/api", "src/services", "src/models"],
  "entry_points": [
    {"name": "main", "file": "src/index.ts", "type": "Function"}
  ],
  "routes": [
    {"path": "/api/users", "method": "GET", "handler": "getUsers", "file": "src/api/users.ts"}
  ],
  "hotspots": [
    {"name": "processRequest", "in_degree": 15, "out_degree": 8, "file": "src/services/request.ts"}
  ],
  "boundaries": [
    {"module": "Community_0", "members": ["src/api/*"], "internal_edges": 45, "external_edges": 12}
  ]
}

Searching the Graph

图谱搜索

Find symbols by name pattern:
User: Find all functions with "Handler" in the name
Uses
search_graph
:
json
{
  "name_pattern": ".*Handler.*",
  "labels": ["Function"]
}
Find high-degree nodes:
User: Show me the most called functions
json
{
  "labels": ["Function"],
  "min_in_degree": 5,
  "limit": 20
}
Scope to specific files:
User: Find all classes in the auth module
json
{
  "labels": ["Class"],
  "file_pattern": ".*/auth/.*"
}
按名称模式查找符号:
用户:查找所有名称包含"Handler"的函数
调用
search_graph
json
{
  "name_pattern": ".*Handler.*",
  "labels": ["Function"]
}
查找高入度节点:
用户:展示被调用次数最多的函数
json
{
  "labels": ["Function"],
  "min_in_degree": 5,
  "limit": 20
}
限定特定文件范围:
用户:查找auth模块中的所有类
json
{
  "labels": ["Class"],
  "file_pattern": ".*/auth/.*"
}

Call Tracing

调用追踪

Find all callers:
User: What calls the authenticate function?
Uses
get_callers
:
json
{
  "symbol_name": "authenticate",
  "max_depth": 3
}
Trace call chain:
User: Trace the execution path from main to database functions
Uses
trace_symbol
:
json
{
  "symbol_name": "main",
  "direction": "outgoing",
  "max_depth": 5,
  "edge_types": ["CALLS"]
}
查找所有调用者:
用户:哪些函数调用了authenticate函数?
调用
get_callers
json
{
  "symbol_name": "authenticate",
  "max_depth": 3
}
追踪调用链:
用户:追踪从main到数据库函数的执行路径
调用
trace_symbol
json
{
  "symbol_name": "main",
  "direction": "outgoing",
  "max_depth": 5,
  "edge_types": ["CALLS"]
}

Semantic Search

语义搜索

Find related code by concept:
User: Find authentication-related functions
Uses
semantic_query
:
json
{
  "query": "authentication jwt token validation",
  "limit": 10
}
Semantic search uses bundled Nomic embeddings (no API key required) with 11-signal scoring:
  • TF-IDF relevance
  • AST structural similarity
  • API signature matching
  • Data flow patterns
  • MinHash near-clone detection
按概念查找相关代码:
用户:查找与认证相关的函数
调用
semantic_query
json
{
  "query": "authentication jwt token validation",
  "limit": 10
}
语义搜索使用内置的Nomic嵌入模型(无需API密钥),采用11项评分指标:
  • TF-IDF相关性
  • AST结构相似度
  • API签名匹配
  • 数据流模式
  • MinHash近克隆检测

Cypher-Like Queries

类Cypher查询

Advanced graph queries:
User: Run a Cypher query to find all functions that call database operations
Uses
cypher_query
:
cypher
MATCH (f:Function)-[:CALLS]->(db:Function)
WHERE db.name CONTAINS 'query' OR db.name CONTAINS 'exec'
RETURN f.name, f.file, COUNT(db) as db_calls
ORDER BY db_calls DESC
LIMIT 20
Find inheritance hierarchies:
cypher
MATCH (c:Class)-[:INHERITS*1..3]->(base:Class)
WHERE base.name = 'BaseModel'
RETURN c.name, c.file
HTTP route to implementation:
cypher
MATCH (r:Route)-[:HANDLED_BY]->(h:Function)-[:CALLS]->(s:Function)
WHERE r.path CONTAINS '/api/users'
RETURN r.path, h.name, COLLECT(s.name) as services
高级图谱查询:
用户:运行Cypher查询,查找所有调用数据库操作的函数
调用
cypher_query
cypher
MATCH (f:Function)-[:CALLS]->(db:Function)
WHERE db.name CONTAINS 'query' OR db.name CONTAINS 'exec'
RETURN f.name, f.file, COUNT(db) as db_calls
ORDER BY db_calls DESC
LIMIT 20
查找继承层级:
cypher
MATCH (c:Class)-[:INHERITS*1..3]->(base:Class)
WHERE base.name = 'BaseModel'
RETURN c.name, c.file
HTTP路由到实现的映射:
cypher
MATCH (r:Route)-[:HANDLED_BY]->(h:Function)-[:CALLS]->(s:Function)
WHERE r.path CONTAINS '/api/users'
RETURN r.path, h.name, COLLECT(s.name) as services

Dead Code Detection

死代码检测

User: Find unused functions
Uses
find_dead_code
:
json
{
  "entry_points": ["main", "handler"],
  "min_depth": 2
}
Returns functions with zero incoming
CALLS
edges, excluding recognized entry points (main, init, handlers, tests).
用户:查找未使用的函数
调用
find_dead_code
json
{
  "entry_points": ["main", "handler"],
  "min_depth": 2
}
返回所有入度为0的
CALLS
边对应的函数,排除已识别的入口点(main、init、处理器、测试)。

Change Impact Analysis

变更影响分析

Detect impact of uncommitted changes:
User: What's affected by my recent changes?
Uses
detect_changes
:
json
{
  "include_tests": true
}
Returns:
  • Changed symbols with confidence scores
  • Affected downstream symbols (via call graph)
  • Risk classification (CRITICAL/HIGH/MEDIUM/LOW)
  • Test coverage mapping
Example response:
json
{
  "changed_symbols": [
    {
      "name": "authenticate",
      "type": "Function",
      "file": "src/auth.ts",
      "confidence": 0.95,
      "change_type": "modified"
    }
  ],
  "affected_symbols": [
    {
      "name": "loginHandler",
      "type": "Function",
      "file": "src/handlers/login.ts",
      "distance": 1,
      "risk": "HIGH"
    }
  ]
}
检测未提交变更的影响:
用户:我最近的变更会影响哪些内容?
调用
detect_changes
json
{
  "include_tests": true
}
返回内容:
  • 带置信度评分的变更符号
  • 受影响的下游符号(通过调用图)
  • 风险等级(CRITICAL/HIGH/MEDIUM/LOW)
  • 测试覆盖率映射
响应示例:
json
{
  "changed_symbols": [
    {
      "name": "authenticate",
      "type": "Function",
      "file": "src/auth.ts",
      "confidence": 0.95,
      "change_type": "modified"
    }
  ],
  "affected_symbols": [
    {
      "name": "loginHandler",
      "type": "Function",
      "file": "src/handlers/login.ts",
      "distance": 1,
      "risk": "HIGH"
    }
  ]
}

Architecture Decision Records (ADR)

架构决策记录(ADR)

Create ADR:
User: Document our decision to use Redis for session storage
Uses
manage_adr
:
json
{
  "action": "create",
  "title": "Use Redis for Session Storage",
  "status": "accepted",
  "context": "Need fast, distributed session management",
  "decision": "Adopt Redis with session TTL and clustering",
  "consequences": "Requires Redis infrastructure; enables horizontal scaling"
}
List ADRs:
User: Show all architecture decisions
json
{
  "action": "list"
}
Update ADR:
json
{
  "action": "update",
  "id": "ADR-001",
  "status": "superseded"
}
创建ADR:
用户:记录我们使用Redis存储会话的决策
调用
manage_adr
json
{
  "action": "create",
  "title": "Use Redis for Session Storage",
  "status": "accepted",
  "context": "Need fast, distributed session management",
  "decision": "Adopt Redis with session TTL and clustering",
  "consequences": "Requires Redis infrastructure; enables horizontal scaling"
}
列出所有ADR:
用户:展示所有架构决策
json
{
  "action": "list"
}
更新ADR:
json
{
  "action": "update",
  "id": "ADR-001",
  "status": "superseded"
}

Cross-Service Analysis

跨服务分析

Find HTTP call sites:
User: Show all external API calls
Uses
search_graph
with HTTP edge filters:
json
{
  "edge_types": ["HTTP_CALLS"],
  "labels": ["Function"]
}
Trace cross-service dependencies:
cypher
MATCH (f:Function)-[:HTTP_CALLS]->(r:Route)
RETURN f.name, f.file, r.path, r.method
查找HTTP调用站点:
用户:展示所有外部API调用
调用带HTTP边过滤器的
search_graph
json
{
  "edge_types": ["HTTP_CALLS"],
  "labels": ["Function"]
}
追踪跨服务依赖:
cypher
MATCH (f:Function)-[:HTTP_CALLS]->(r:Route)
RETURN f.name, f.file, r.path, r.method

Configuration

配置

View Current Config

查看当前配置

bash
codebase-memory-mcp config list
bash
codebase-memory-mcp config list

Key Settings

关键设置

bash
undefined
bash
undefined

Auto-index on session start

会话启动时自动索引

codebase-memory-mcp config set auto_index true
codebase-memory-mcp config set auto_index true

File limit for auto-indexing

自动索引的文件数量上限

codebase-memory-mcp config set auto_index_limit 50000
codebase-memory-mcp config set auto_index_limit 50000

Enable background file watcher

启用后台文件监视器

codebase-memory-mcp config set watch true
codebase-memory-mcp config set watch true

Embedding model (default: nomic-embed-code)

嵌入模型(默认:nomic-embed-code)

codebase-memory-mcp config set embedding_model nomic-embed-code
codebase-memory-mcp config set embedding_model nomic-embed-code

Graph visualization port

图谱可视化端口

codebase-memory-mcp config set ui_port 9749
undefined
codebase-memory-mcp config set ui_port 9749
undefined

Ignore Patterns

忽略规则

Create
.cbmignore
in your repo root (gitignore syntax):
node_modules/
*.test.ts
dist/
build/
*.min.js
vendor/
Default ignores:
node_modules
,
.git
,
dist
,
build
,
vendor
,
.venv
,
__pycache__
在代码库根目录创建
.cbmignore
文件(采用gitignore语法):
node_modules/
*.test.ts
dist/
build/
*.min.js
vendor/
默认忽略项:
node_modules
,
.git
,
dist
,
build
,
vendor
,
.venv
,
__pycache__

Advanced Features

高级功能

Graph Visualization UI

图谱可视化UI

Launch with UI enabled:
bash
codebase-memory-mcp --ui=true --port=9749
Open
http://localhost:9749
for 3D interactive graph exploration.
Features:
  • Force-directed layout with community coloring
  • Filter by label, file, package
  • Click nodes to see properties and edges
  • Multi-galaxy layout for cross-repo graphs
启用UI启动:
bash
codebase-memory-mcp --ui=true --port=9749
打开
http://localhost:9749
即可进行3D交互式图谱探索。
功能特性:
  • 带社区着色的力导向布局
  • 按标签、文件、包筛选
  • 点击节点查看属性与边
  • 跨代码库图谱的多星系布局

Team-Shared Graph Artifact

团队共享图谱制品

Commit compressed graph to avoid reindexing:
bash
undefined
提交压缩后的图谱以避免重复索引:
bash
undefined

After indexing, compress the graph

索引完成后压缩图谱

codebase-memory-mcp export --output=.codebase-memory/graph.db.zst
codebase-memory-mcp export --output=.codebase-memory/graph.db.zst

Commit to repo

提交到代码库

git add .codebase-memory/graph.db.zst git commit -m "Add codebase graph snapshot"

Teammates run:
```bash
codebase-memory-mcp import --input=.codebase-memory/graph.db.zst
git add .codebase-memory/graph.db.zst git commit -m "Add codebase graph snapshot"

团队成员只需运行:
```bash
codebase-memory-mcp import --input=.codebase-memory/graph.db.zst

CLI Mode

CLI模式

Use without MCP for scripting:
bash
undefined
无需MCP即可用于脚本编写:
bash
undefined

Search

搜索

codebase-memory-mcp cli search_graph '{"name_pattern": ".*Service$", "labels": ["Class"]}'
codebase-memory-mcp cli search_graph '{"name_pattern": ".*Service$", "labels": ["Class"]}'

Cypher query

Cypher查询

codebase-memory-mcp cli cypher_query 'MATCH (f:Function) WHERE f.name = "main" RETURN f'
codebase-memory-mcp cli cypher_query 'MATCH (f:Function) WHERE f.name = "main" RETURN f'

Get architecture

获取架构信息

codebase-memory-mcp cli get_architecture '{}'
codebase-memory-mcp cli get_architecture '{}'

Semantic search

语义搜索

codebase-memory-mcp cli semantic_query '{"query": "database connection pooling", "limit": 5}'
undefined
codebase-memory-mcp cli semantic_query '{"query": "database connection pooling", "limit": 5}'
undefined

Language-Specific Features

语言特定功能

Go:
  • Package resolution via
    go.mod
  • Interface implementation detection
  • Struct method resolution
TypeScript/JavaScript:
  • JSX component tracing
  • Type inference from JSDoc
  • Import alias resolution
  • Decorator detection
Python:
  • Class hierarchy via
    INHERITS
  • Decorator-based route detection (Flask, FastAPI)
  • Import resolution via
    pyproject.toml
    ,
    setup.py
C/C++:
  • Header/implementation linking
  • Preprocessor-aware parsing
  • Template instantiation tracking
Go:
  • 通过
    go.mod
    解析包
  • 检测接口实现
  • 解析结构体方法
TypeScript/JavaScript:
  • JSX组件追踪
  • 从JSDoc推断类型
  • 解析导入别名
  • 检测装饰器
Python:
  • 通过
    INHERITS
    识别类层级
  • 检测基于装饰器的路由(Flask、FastAPI)
  • 通过
    pyproject.toml
    setup.py
    解析导入
C/C++:
  • 头文件/实现文件关联
  • 支持预处理器解析
  • 追踪模板实例化

Infrastructure-as-Code

基础设施即代码

Kubernetes manifests:
User: Show all Kubernetes resources
json
{
  "labels": ["Resource"],
  "properties": {"kind": "Deployment"}
}
Kustomize overlays:
cypher
MATCH (overlay:Module)-[:IMPORTS]->(base:Resource)
WHERE overlay.type = 'kustomize'
RETURN overlay.name, COLLECT(base.name) as resources
Dockerfile analysis:
User: Find all services using Node 18
json
{
  "labels": ["Dockerfile"],
  "code_pattern": "FROM node:18"
}
Kubernetes清单:
用户:展示所有Kubernetes资源
json
{
  "labels": ["Resource"],
  "properties": {"kind": "Deployment"}
}
Kustomize覆盖层:
cypher
MATCH (overlay:Module)-[:IMPORTS]->(base:Resource)
WHERE overlay.type = 'kustomize'
RETURN overlay.name, COLLECT(base.name) as resources
Dockerfile分析:
用户:查找所有使用Node 18的服务
json
{
  "labels": ["Dockerfile"],
  "code_pattern": "FROM node:18"
}

Troubleshooting

故障排除

Indexing Issues

索引问题

Large repos timing out:
bash
undefined
大型代码库索引超时:
bash
undefined

Increase memory limit (default: 8GB)

增加内存限制(默认:8GB)

codebase-memory-mcp config set max_memory_gb 16
codebase-memory-mcp config set max_memory_gb 16

Skip large files

跳过大型文件

codebase-memory-mcp config set max_file_size_mb 5

**Missing symbols:**
- Check `.cbmignore` — ensure source files aren't excluded
- Verify language support: `codebase-memory-mcp --languages`
- Re-index: `codebase-memory-mcp index --force /path/to/repo`

**Slow queries:**
```bash
codebase-memory-mcp config set max_file_size_mb 5

**符号缺失:**
- 检查`.cbmignore`——确保源文件未被排除
- 验证语言支持:`codebase-memory-mcp --languages`
- 重新索引:`codebase-memory-mcp index --force /path/to/repo`

**查询缓慢:**
```bash

Rebuild indexes

重建索引

codebase-memory-mcp cli vacuum
codebase-memory-mcp cli vacuum

Check database size

检查数据库大小

ls -lh ~/.cache/codebase-memory-mcp/graph.db
undefined
ls -lh ~/.cache/codebase-memory-mcp/graph.db
undefined

MCP Connection Issues

MCP连接问题

Agent can't find server:
  1. Verify installation:
    which codebase-memory-mcp
  2. Check agent config:
    codebase-memory-mcp config verify
  3. Restart agent completely
  4. Check logs:
    ~/.cache/codebase-memory-mcp/logs/
Tools not appearing:
bash
undefined
Agent无法找到服务器:
  1. 验证安装:
    which codebase-memory-mcp
  2. 检查Agent配置:
    codebase-memory-mcp config verify
  3. 完全重启Agent
  4. 查看日志:
    ~/.cache/codebase-memory-mcp/logs/
工具未显示:
bash
undefined

Reinstall agent configs

重新安装Agent配置

codebase-memory-mcp install --force
codebase-memory-mcp install --force

Verify MCP registration

验证MCP注册

codebase-memory-mcp config show-mcp-config
undefined
codebase-memory-mcp config show-mcp-config
undefined

Performance

性能问题

High memory usage during indexing:
  • Normal for large repos (Linux kernel uses ~6GB peak)
  • Memory released after indexing completes
  • Use
    --max-memory-gb
    flag to cap usage
Slow semantic search:
bash
undefined
索引期间内存占用过高:
  • 大型代码库属于正常现象(Linux内核峰值约6GB)
  • 索引完成后内存会释放
  • 使用
    --max-memory-gb
    标志限制内存使用
语义搜索缓慢:
bash
undefined

Rebuild embeddings index

重建嵌入索引

codebase-memory-mcp cli rebuild_embeddings
codebase-memory-mcp cli rebuild_embeddings

Reduce result limit

减少结果数量上限

codebase-memory-mcp config set semantic_limit 10
undefined
codebase-memory-mcp config set semantic_limit 10
undefined

File Watcher

文件监视器

Changes not detected:
bash
undefined
变更未被检测到:
bash
undefined

Check watcher status

检查监视器状态

codebase-memory-mcp status
codebase-memory-mcp status

Restart watcher

重启监视器

codebase-memory-mcp watch restart
codebase-memory-mcp watch restart

Increase file watch limit (Linux)

增加文件监视上限(Linux)

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p
undefined
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p
undefined

Common Workflows

常见工作流

Onboarding to New Codebase

新代码库上手

1. "Index this project"
2. "Show me the architecture"
3. "What are the entry points?"
4. "Find the main HTTP routes"
5. "Show me the most important functions" (hotspots)
1. "索引这个项目"
2. "展示这个代码库的架构"
3. "入口点有哪些?"
4. "查找主要的HTTP路由"
5. "展示最重要的函数"(热点)

Refactoring

重构

1. "Find all callers of [function]"
2. "What's affected by my changes?" (after editing)
3. "Show me the call chain from [entry] to [target]"
4. "Find dead code"
1. "查找[函数]的所有调用者"
2. "我的变更会影响哪些内容?"(编辑后)
3. "展示从[入口]到[目标]的调用链"
4. "查找死代码"

Debugging

调试

1. "Trace execution from [function]"
2. "What calls this endpoint?" (for HTTP routes)
3. "Find similar functions to [name]"
4. "Show data flow through [function]"
1. "追踪[函数]的执行路径"
2. "哪些函数调用了这个端点?"(针对HTTP路由)
3. "查找与[名称]相似的函数"
4. "展示[函数]的数据流"

Cross-Service Analysis

跨服务分析

1. "Find all external API calls"
2. "Show services that depend on [service]"
3. "Map HTTP routes to implementations"
4. "Find pub-sub channels across repos"
1. "查找所有外部API调用"
2. "展示依赖[服务]的服务"
3. "映射HTTP路由到实现"
4. "查找跨代码库的发布-订阅通道"

MCP Tools Reference

MCP工具参考

ToolPurpose
index_repository
Index codebase into knowledge graph
search_graph
Structural search by pattern, label, degree
search_code
Graph-augmented grep
semantic_query
Vector search with bundled embeddings
get_architecture
Full architectural summary
get_callers
Find all callers of a symbol
trace_symbol
Trace call chains (in/out)
cypher_query
Advanced graph queries
find_dead_code
Detect unused functions
detect_changes
Git diff impact analysis
manage_adr
Architecture Decision Records
get_context
Context for specific symbols
list_routes
All HTTP/gRPC/GraphQL routes
analyze_dependencies
Cross-service dependency graph
工具用途
index_repository
将代码库索引为知识图谱
search_graph
按模式、标签、度数进行结构化搜索
search_code
图谱增强型grep搜索
semantic_query
内置嵌入模型的向量搜索
get_architecture
完整架构摘要
get_callers
查找符号的所有调用者
trace_symbol
追踪调用链(入/出方向)
cypher_query
高级图谱查询
find_dead_code
检测未使用的函数
detect_changes
Git差异影响分析
manage_adr
架构决策记录管理
get_context
获取特定符号的上下文
list_routes
所有HTTP/gRPC/GraphQL路由
analyze_dependencies
跨服务依赖图谱

Updates

更新

bash
undefined
bash
undefined

Check for updates

检查更新

codebase-memory-mcp update
codebase-memory-mcp update

Auto-update check on startup (default: enabled)

启动时自动检查更新(默认:启用)

codebase-memory-mcp config set check_updates true

The server notifies on first tool call if a new release is available.
codebase-memory-mcp config set check_updates true

如果有新版本发布,服务器会在首次工具调用时通知用户。

Uninstall

卸载

bash
undefined
bash
undefined

Remove all agent configs and binary

删除所有Agent配置与二进制文件

codebase-memory-mcp uninstall
codebase-memory-mcp uninstall

Keep database (default)

默认保留数据库

Or remove database too:

如需同时删除数据库:

rm -rf ~/.cache/codebase-memory-mcp/
undefined
rm -rf ~/.cache/codebase-memory-mcp/
undefined