克兰西
 ](https://github.com/divmgl/clancey/actions/workflows/publish.yml)
一个MCP服务器,为您的Claude Code和Codex对话建立索引,以进行语义搜索。从之前的编码会话中查找解决方案、决策和上下文。
特性
- 语义搜索 -按含义查找对话,而不仅仅是关键字
- 自动索引 -在新对话发生时自动为其建立索引
- 本地和私人 -一切都使用LanceDB和Huggingface模型在本地运行
- 可恢复的 -索引以增量方式保存进度,从停止的地方继续
- 快速 -使用全MiniLM-L6-v2实现快速、轻便的嵌入
安装
使用客户端的设置:
Claude Code
添加到您的Claude Code MCP设置中(~/.claude/settings.json):
{
"mcpServers": {
"clancey": {
"command": "npx",
"args": ["-y", "clancey"]
}
}
}重新启动克劳德代码。
Codex
添加到您的Codex配置(~/.codex/config.toml):
[mcp_servers.clancey]
command = "npx"
args = ["-y", "clancey"]重新启动Codex。
MCP工具
search_conversations
从语义上搜索你的索引对话。
query: "how did I fix the auth bug"
limit: 5
project: "my-app" # optional filterindex_conversations
手动触发会话索引。
force: true # reindex everythingindex_status
获取有关索引对话的统计信息。
运作原理
- 从以下位置扫描对话文件
~/.claude/projects/和~/.codex/sessions/ - 将JSONL事件解析为用户/助理消息
- 将长对话分割成可搜索的片段
- 生成嵌入
all-MiniLM-L6-v2 - 将矢量存储在LanceDB中
~/.clancey/conversations.lance - 监视源目录和增量重新索引的更改
.jsonl文件
数据存储在 ~/.clancey/。日志位于 ~/.clancey/clancey.log.
发展
git clone https://github.com/divmgl/clancey.git
cd clancey
bun install
bun run build技术栈
许可证
麻省理工学院
