Files
memind/docs/codebase-memory-mcp-local.md
T
john 938f6d6d37
Memind CI / Test, build, and release guards (push) Failing after 34s
docs: note Homebrew path for codebase-memory-mcp Cursor config
Document the ~/.local/bin vs /opt/homebrew/bin mismatch that breaks MCP
connection when install targets a path the global npm binary does not use.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 08:39:41 +08:00

2.5 KiB
Raw Blame History

codebase-memory-mcp 本地开发

MIT · 仅本机 Cursor / code 任务开发工具 · 不进入 MeMind 103 运行时 关联:context-runtime-harness-fusion-plan.md §6.6

用途边界

允许 禁止
Cursor 内代码库结构查询、调用链、架构图 个人生活流 / h5 用户记忆主检索
未来挂到 tool-gateway 的 aider/openhands 路径 替代 Memory V2 / Context Runtime Phase 23
Phase 5 Personal KG 仅借 schema 思想 把索引目录提交进 Git

安装(本机一次)

npm install -g codebase-memory-mcp
codebase-memory-mcp install -y    # 写入 ~/.cursor/mcp.json 等,属设计行为

安装后 重启 Cursor。全局二进制缓存由 npm 包管理;图数据在 CBM 本地 daemon/SQLite不在 Memind 仓库根目录。

Homebrew 路径:若用 brew/全局 npm 安装,二进制通常在 /opt/homebrew/bin/codebase-memory-mcpinstall 默认写 ~/.local/bin/...,若该路径不存在会导致 Cursor MCP 连不上——确认 ~/.cursor/mcp.jsoncommandwhich codebase-memory-mcp 一致。

首次索引 Memind

方式 A — Cursor(推荐)

重启后对 agent 说:「Index this project」

方式 B — CLI

cd /Users/john/Project/Memind
codebase-memory-mcp cli --progress index_repository '{"repo_path":"/Users/john/Project/Memind"}'

可选:常驻 daemon 减少 CLI 冷启动:

codebase-memory-mcp daemon start

离线验证

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 探针

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

卸载 / 更新

codebase-memory-mcp update
codebase-memory-mcp uninstall -y   # 仅移除 agent MCP 配置,不删全局 npm 包