feat(dev-tools): add codebase-memory-mcp local check and docs
Document MIT dev-tool setup for Cursor code intelligence and add an offline probe for CLI, Cursor MCP config, and Memind index readiness. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# codebase-memory-mcp 本地开发
|
||||
|
||||
> MIT · 仅本机 Cursor / code 任务开发工具 · **不进入 MeMind 103 运行时**
|
||||
> 关联:[context-runtime-harness-fusion-plan.md](./context-runtime-harness-fusion-plan.md) §6.6
|
||||
|
||||
## 用途边界
|
||||
|
||||
| 允许 | 禁止 |
|
||||
|------|------|
|
||||
| Cursor 内代码库结构查询、调用链、架构图 | 个人生活流 / h5 用户记忆主检索 |
|
||||
| 未来挂到 `tool-gateway` 的 aider/openhands 路径 | 替代 Memory V2 / Context Runtime Phase 2–3 |
|
||||
| Phase 5 Personal KG **仅借 schema 思想** | 把索引目录提交进 Git |
|
||||
|
||||
## 安装(本机一次)
|
||||
|
||||
```bash
|
||||
npm install -g codebase-memory-mcp
|
||||
codebase-memory-mcp install -y # 写入 ~/.cursor/mcp.json 等,属设计行为
|
||||
```
|
||||
|
||||
安装后 **重启 Cursor**。全局二进制缓存由 npm 包管理;图数据在 CBM 本地 daemon/SQLite,**不在** Memind 仓库根目录。
|
||||
|
||||
## 首次索引 Memind
|
||||
|
||||
**方式 A — Cursor(推荐)**
|
||||
|
||||
重启后对 agent 说:**「Index this project」**。
|
||||
|
||||
**方式 B — CLI**
|
||||
|
||||
```bash
|
||||
cd /Users/john/Project/Memind
|
||||
codebase-memory-mcp cli --progress index_repository '{"repo_path":"/Users/john/Project/Memind"}'
|
||||
```
|
||||
|
||||
可选:常驻 daemon 减少 CLI 冷启动:
|
||||
|
||||
```bash
|
||||
codebase-memory-mcp daemon start
|
||||
```
|
||||
|
||||
## 离线验证
|
||||
|
||||
```bash
|
||||
codebase-memory-mcp --version
|
||||
node scripts/check-codebase-memory-mcp-local.mjs
|
||||
```
|
||||
|
||||
- 仅验证 CLI + Cursor 配置:`MEMIND_CBM_REQUIRE_INDEX=0 node scripts/check-codebase-memory-mcp-local.mjs`
|
||||
- 完整通过需已索引,输出 **`CODEBASE_MEMORY_MCP_OK`**
|
||||
|
||||
## 常用 CLI 探针
|
||||
|
||||
```bash
|
||||
codebase-memory-mcp cli --json list_projects '{}'
|
||||
codebase-memory-mcp cli --json search_graph '{"name_pattern":".*headroom.*","label":"Function"}'
|
||||
codebase-memory-mcp cli --json get_architecture '{}'
|
||||
```
|
||||
|
||||
## 与 zvec-grep 的分工
|
||||
|
||||
| 工具 | 强项 |
|
||||
|------|------|
|
||||
| **codebase-memory-mcp** | AST 知识图:符号、CALLS、路由、Cypher |
|
||||
| **zvec-grep** | workspace 语义/关键词文件检索(`.zvec-grep/`) |
|
||||
|
||||
两者互补;Context Runtime 本地清单见 [context-runtime-local-dev.md](./context-runtime-local-dev.md)。
|
||||
|
||||
## 卸载 / 更新
|
||||
|
||||
```bash
|
||||
codebase-memory-mcp update
|
||||
codebase-memory-mcp uninstall -y # 仅移除 agent MCP 配置,不删全局 npm 包
|
||||
```
|
||||
@@ -56,6 +56,9 @@ node scripts/check-zvec-workspace-local.mjs
|
||||
|
||||
# MCP compactor shadow/active 逻辑
|
||||
node scripts/check-mcp-compactor-local.mjs
|
||||
|
||||
# codebase-memory-mcp CLI + Memind 索引(见 docs/codebase-memory-mcp-local.md)
|
||||
node scripts/check-codebase-memory-mcp-local.mjs
|
||||
```
|
||||
|
||||
## 用户自测清单(有 LLM 配额时)
|
||||
|
||||
Reference in New Issue
Block a user