codebase-memory-mcp-intelligence
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecodebase-memory-mcp Intelligence
codebase-memory-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
undefinedbash
undefinedStandard version
标准版
With graph visualization UI
带图谱可视化UI版本
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
undefinedcurl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
undefinedWindows (PowerShell)
Windows(PowerShell)
powershell
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1powershell
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1Manual Installation
手动安装
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 --versionRestart your coding agent after installation.
bash
codebase-memory-mcp --version安装完成后重启你的开发Agent。
Core Usage Patterns
核心使用模式
Indexing a Codebase
索引代码库
Via agent (recommended):
User: Index this projectThe MCP server will call with the current working directory.
index_repositoryVia CLI:
bash
codebase-memory-mcp index /path/to/repoEnable auto-indexing:
bash
codebase-memory-mcp config set auto_index true
codebase-memory-mcp config set auto_index_limit 50000Auto-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 codebaseThis invokes which returns:
get_architecture- 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 nameUses :
search_graphjson
{
"name_pattern": ".*Handler.*",
"labels": ["Function"]
}Find high-degree nodes:
User: Show me the most called functionsjson
{
"labels": ["Function"],
"min_in_degree": 5,
"limit": 20
}Scope to specific files:
User: Find all classes in the auth modulejson
{
"labels": ["Class"],
"file_pattern": ".*/auth/.*"
}按名称模式查找符号:
用户:查找所有名称包含"Handler"的函数调用:
search_graphjson
{
"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_callersjson
{
"symbol_name": "authenticate",
"max_depth": 3
}Trace call chain:
User: Trace the execution path from main to database functionsUses :
trace_symboljson
{
"symbol_name": "main",
"direction": "outgoing",
"max_depth": 5,
"edge_types": ["CALLS"]
}查找所有调用者:
用户:哪些函数调用了authenticate函数?调用:
get_callersjson
{
"symbol_name": "authenticate",
"max_depth": 3
}追踪调用链:
用户:追踪从main到数据库函数的执行路径调用:
trace_symboljson
{
"symbol_name": "main",
"direction": "outgoing",
"max_depth": 5,
"edge_types": ["CALLS"]
}Semantic Search
语义搜索
Find related code by concept:
User: Find authentication-related functionsUses :
semantic_queryjson
{
"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_queryjson
{
"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 operationsUses :
cypher_querycypher
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 20Find inheritance hierarchies:
cypher
MATCH (c:Class)-[:INHERITS*1..3]->(base:Class)
WHERE base.name = 'BaseModel'
RETURN c.name, c.fileHTTP 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_querycypher
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.fileHTTP路由到实现的映射:
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 servicesDead Code Detection
死代码检测
User: Find unused functionsUses :
find_dead_codejson
{
"entry_points": ["main", "handler"],
"min_depth": 2
}Returns functions with zero incoming edges, excluding recognized entry points (main, init, handlers, tests).
CALLS用户:查找未使用的函数调用:
find_dead_codejson
{
"entry_points": ["main", "handler"],
"min_depth": 2
}返回所有入度为0的边对应的函数,排除已识别的入口点(main、init、处理器、测试)。
CALLSChange Impact Analysis
变更影响分析
Detect impact of uncommitted changes:
User: What's affected by my recent changes?Uses :
detect_changesjson
{
"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_changesjson
{
"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 storageUses :
manage_adrjson
{
"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 decisionsjson
{
"action": "list"
}Update ADR:
json
{
"action": "update",
"id": "ADR-001",
"status": "superseded"
}创建ADR:
用户:记录我们使用Redis存储会话的决策调用:
manage_adrjson
{
"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 callsUses with HTTP edge filters:
search_graphjson
{
"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_graphjson
{
"edge_types": ["HTTP_CALLS"],
"labels": ["Function"]
}追踪跨服务依赖:
cypher
MATCH (f:Function)-[:HTTP_CALLS]->(r:Route)
RETURN f.name, f.file, r.path, r.methodConfiguration
配置
View Current Config
查看当前配置
bash
codebase-memory-mcp config listbash
codebase-memory-mcp config listKey Settings
关键设置
bash
undefinedbash
undefinedAuto-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
undefinedcodebase-memory-mcp config set ui_port 9749
undefinedIgnore Patterns
忽略规则
Create in your repo root (gitignore syntax):
.cbmignorenode_modules/
*.test.ts
dist/
build/
*.min.js
vendor/Default ignores: , , , , , ,
node_modules.gitdistbuildvendor.venv__pycache__在代码库根目录创建文件(采用gitignore语法):
.cbmignorenode_modules/
*.test.ts
dist/
build/
*.min.js
vendor/默认忽略项:, , , , , ,
node_modules.gitdistbuildvendor.venv__pycache__Advanced Features
高级功能
Graph Visualization UI
图谱可视化UI
Launch with UI enabled:
bash
codebase-memory-mcp --ui=true --port=9749Open for 3D interactive graph exploration.
http://localhost:9749Features:
- 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打开即可进行3D交互式图谱探索。
http://localhost:9749功能特性:
- 带社区着色的力导向布局
- 按标签、文件、包筛选
- 点击节点查看属性与边
- 跨代码库图谱的多星系布局
Team-Shared Graph Artifact
团队共享图谱制品
Commit compressed graph to avoid reindexing:
bash
undefined提交压缩后的图谱以避免重复索引:
bash
undefinedAfter 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.zstgit add .codebase-memory/graph.db.zst
git commit -m "Add codebase graph snapshot"
团队成员只需运行:
```bash
codebase-memory-mcp import --input=.codebase-memory/graph.db.zstCLI Mode
CLI模式
Use without MCP for scripting:
bash
undefined无需MCP即可用于脚本编写:
bash
undefinedSearch
搜索
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}'
undefinedcodebase-memory-mcp cli semantic_query '{"query": "database connection pooling", "limit": 5}'
undefinedLanguage-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.tomlsetup.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 resourcesjson
{
"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 resourcesDockerfile analysis:
User: Find all services using Node 18json
{
"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 resourcesDockerfile分析:
用户:查找所有使用Node 18的服务json
{
"labels": ["Dockerfile"],
"code_pattern": "FROM node:18"
}Troubleshooting
故障排除
Indexing Issues
索引问题
Large repos timing out:
bash
undefined大型代码库索引超时:
bash
undefinedIncrease 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:**
```bashcodebase-memory-mcp config set max_file_size_mb 5
**符号缺失:**
- 检查`.cbmignore`——确保源文件未被排除
- 验证语言支持:`codebase-memory-mcp --languages`
- 重新索引:`codebase-memory-mcp index --force /path/to/repo`
**查询缓慢:**
```bashRebuild indexes
重建索引
codebase-memory-mcp cli vacuum
codebase-memory-mcp cli vacuum
Check database size
检查数据库大小
ls -lh ~/.cache/codebase-memory-mcp/graph.db
undefinedls -lh ~/.cache/codebase-memory-mcp/graph.db
undefinedMCP Connection Issues
MCP连接问题
Agent can't find server:
- Verify installation:
which codebase-memory-mcp - Check agent config:
codebase-memory-mcp config verify - Restart agent completely
- Check logs:
~/.cache/codebase-memory-mcp/logs/
Tools not appearing:
bash
undefinedAgent无法找到服务器:
- 验证安装:
which codebase-memory-mcp - 检查Agent配置:
codebase-memory-mcp config verify - 完全重启Agent
- 查看日志:
~/.cache/codebase-memory-mcp/logs/
工具未显示:
bash
undefinedReinstall agent configs
重新安装Agent配置
codebase-memory-mcp install --force
codebase-memory-mcp install --force
Verify MCP registration
验证MCP注册
codebase-memory-mcp config show-mcp-config
undefinedcodebase-memory-mcp config show-mcp-config
undefinedPerformance
性能问题
High memory usage during indexing:
- Normal for large repos (Linux kernel uses ~6GB peak)
- Memory released after indexing completes
- Use flag to cap usage
--max-memory-gb
Slow semantic search:
bash
undefined索引期间内存占用过高:
- 大型代码库属于正常现象(Linux内核峰值约6GB)
- 索引完成后内存会释放
- 使用标志限制内存使用
--max-memory-gb
语义搜索缓慢:
bash
undefinedRebuild 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
undefinedcodebase-memory-mcp config set semantic_limit 10
undefinedFile Watcher
文件监视器
Changes not detected:
bash
undefined变更未被检测到:
bash
undefinedCheck 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
undefinedecho fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
undefinedCommon 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工具参考
| Tool | Purpose |
|---|---|
| Index codebase into knowledge graph |
| Structural search by pattern, label, degree |
| Graph-augmented grep |
| Vector search with bundled embeddings |
| Full architectural summary |
| Find all callers of a symbol |
| Trace call chains (in/out) |
| Advanced graph queries |
| Detect unused functions |
| Git diff impact analysis |
| Architecture Decision Records |
| Context for specific symbols |
| All HTTP/gRPC/GraphQL routes |
| Cross-service dependency graph |
| 工具 | 用途 |
|---|---|
| 将代码库索引为知识图谱 |
| 按模式、标签、度数进行结构化搜索 |
| 图谱增强型grep搜索 |
| 内置嵌入模型的向量搜索 |
| 完整架构摘要 |
| 查找符号的所有调用者 |
| 追踪调用链(入/出方向) |
| 高级图谱查询 |
| 检测未使用的函数 |
| Git差异影响分析 |
| 架构决策记录管理 |
| 获取特定符号的上下文 |
| 所有HTTP/gRPC/GraphQL路由 |
| 跨服务依赖图谱 |
Updates
更新
bash
undefinedbash
undefinedCheck 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
undefinedbash
undefinedRemove 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/
undefinedrm -rf ~/.cache/codebase-memory-mcp/
undefined