mcp本地RAG
一种“原始”的RAG-like网络搜索模型上下文协议服务器,可在本地运行。✨无需APIs✨
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcp-local-rag": {
"args": [
"--directory",
"\u003cpath where this folder is located\u003e/mcp-local-rag/",
"run",
"src/mcp_local_rag/main.py"
],
"command": "uv"
}
}
}
服务介绍
mcp-local-rag
本地运行的“原始”类RAG(检索增强生成)网页搜索模型上下文协议(MCP)服务器。✨ 无需API ✨
安装指南
- 您需要安装
uv: https://docs.astral.sh/uv/
如果您不想执行步骤2中的克隆。
只需直接将以下内容粘贴到Claude配置中。您可以在这里找到配置路径:https://modelcontextprotocol.io/quickstart/user
{
"mcpServers": {
"mcp-local-rag":{
"command": "uvx",
"args": [
"--python=3.10",
"--from",
"git+https://github.com/nkapila6/mcp-local-rag",
"mcp-local-rag"
]
}
}
}
否则:
- 克隆此GitHub仓库(可选,使用上述配置可以跳过)
git clone https://github.com/nkapila6/mcp-local-rag
- 将以下内容添加到您的Claude配置中。您可以在这里找到配置路径:https://modelcontextprotocol.io/quickstart/user
{
"mcpServers": {
"mcp-local-rag": {
"command": "uv",
"args": [
"--directory",
"<path where this folder is located>/mcp-local-rag/",
"run",
"src/mcp_local_rag/main.py"
]
}
}
}
使用示例
在提示时
当要求获取/查找/搜索网络时,模型会提示您使用MCP服务器进行聊天。
在示例中,询问了关于昨天发布的Google最新Gemma模型的信息。这是Claude不知道的新信息。
结果
来自本地rag_search的结果帮助模型用新信息回答问题。