cherry-mcp
Exposes Cherry Studio local knowledge bases through tools that list knowledge bases and perform vector similarity search over their stored document chunks.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cherry-mcp
将 Cherry Studio 的本地知识库通过 MCP (Model Context Protocol) 暴露给 AI 客户端(Cursor、Claude Desktop、opencode 等)。
快速开始
在任何支持 MCP 的 AI 客户端配置文件中添加:
{
"mcpServers": {
"cherry-mcp": {
"command": "npx",
"args": [
"-y", "cherry-mcp",
"--embed-url", "http://127.0.0.1:1234",
"--embed-model", "text-embedding-qwen3-embedding-8b",
"--embed-dim", "4096"
]
}
}
}--embed-api-key 使用本地模型时可省略;首次执行 npm 会自动安装依赖。
opencode 配置
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cherry-mcp": {
"type": "local",
"command": [
"npx", "-y", "cherry-mcp@latest",
"--top-k", "10",
"--threshold", "0.6",
"--max-fetch", "1000",
"--kb-path", "C:\\Users\\你的用户名\\AppData\\Roaming\\CherryStudio\\Data\\KnowledgeBase",
"--embed-url", "http://127.0.0.1:1234",
"--embed-model", "text-embedding-qwen3-embedding-8b",
"--embed-dim", "4096"
],
"enabled": true
}
}
}更多配置示例请参阅 mcp-config.md
Related MCP server: kb-mcp-server
参数配置
所有参数支持 CLI 传入,也可通过环境变量注入。优先级:CLI 参数 > 环境变量
以下参数为必填:--embed-url、--embed-model、--embed-dim
CLI 参数 | 环境变量 | 默认值 | 说明 |
|
|
| 最大返回结果数 |
|
|
| 最低相似度阈值(0-1) |
|
|
| 每库最多读取的记录数 |
|
| - | 限定搜索指定名称的知识库 |
|
| 自动识别 | 知识库根目录路径(可覆盖默认值) |
|
| (必填) | Embedding API 地址 |
|
| - | API Token(本地模型可留空) |
|
| (必填) | 向量模型 ID |
|
| (必填) | 向量维度(须与模型实际输出一致) |
完整参数说明请参阅 cli-params.md
可用工具
工具名 | 说明 |
| 列出所有知识库(名称、路径、向量数量、维度等) |
| 向量相似度检索,返回最相关的文档片段 |
本地开发
1. 克隆项目并安装依赖
git clone https://github.com/UserTheo02726/cherry-mcp.git
cd cherry-mcp
npm install2. 配置调试参数
# 复制配置文件示例
cp dev/dev-config.json.example dev/dev-config.json
# 编辑配置文件,填入你的参数
vim dev/dev-config.json配置文件说明:
{
"embedUrl": "https://api.siliconflow.cn/v1/embeddings",
"embedModel": "BAAI/bge-m3",
"embedDim": 1024,
"embedApiKey": "sk-xxx",
"topK": 20,
"threshold": 0.5,
"maxFetch": 1000,
"kbName": "",
"kbPath": ""
}3. 调试
方式 A:命令行调试
# 1. 列出所有工具
node dev/debug.js tools/list
# 2. 调用 list_knowledge_bases 工具
node dev/debug.js tools/call list_knowledge_bases
# 3. 调用 search_knowledge 工具
node dev/debug.js tools/call search_knowledge "<搜索关键词>" <返回结果数默认:5> <相似度阈值默认:0.6>方式 B:使用 MCP Inspector
node dev/inspector.jsMCP 服务启动后会等待 IDE 客户端连接,不会显示交互界面。
前置要求
Node.js >= 22
已运行 Cherry Studio 并创建至少一个知识库
可访问的 Embedding API(本地 LM Studio 或远程 SiliconFlow 等)
TODO
优化
search_knowledge工具的参数描述,减少 AI 主动传入top_k、threshold、kb_name等可选参数的行为list_knowledge_bases返回的知识库名称是 Base62 ID,而非 GUI 中的自定义名称
常见问题
遇到问题请参阅 troubleshooting.md
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and manage your team's knowledge from MCP clients.
Cross-vendor AI memory over MCP. One semantic store, readable and writeable from every MCP client.
Knowledge base MCP for AI agents on iknow.dev. Search, read, and maintain via OAuth.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables semantic search over knowledge-base articles and listing of sample support tickets using MCP tools.4-
- FlicenseNot gradedqualityDmaintenanceEnables semantic search over a local knowledge base using MCP tools, allowing AI clients to retrieve relevant document chunks via the search_knowledge tool.2-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables MCP clients to store and retrieve user preferences, behaviors, and other text-based information across conversations using semantic vector search.-
- FlicenseNot gradedqualityBmaintenanceEnables local full-text and semantic search over saved content, providing search and retrieval capabilities via MCP for AI assistants.-