这是一个增强版的 Qdrant 向量数据库模型上下文协议(MCP)服务器,为管理 Qdrant 集合、添加文档以及执行语义搜索提供了强大工具,有效提升向量数据库的使用效率与便捷性。
你可以通过以下两种方式安装该服务器:
npm install -g better-qdrant-mcp-server
或者直接使用 npx:
npx better-qdrant-mcp-server
该服务器使用环境变量进行配置,你可在项目根目录创建一个 .env 文件来设置这些变量:
# Qdrant 配置
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=你的_api_密钥(如果需要)
# 嵌入式服务 API 密钥
OPENAI_API_KEY=你的_openai_api_密钥
OPENROUTER_API_KEY=你的_openrouter_api_密钥
OLLAMA_ENDPOINT=http://localhost:11434
使用 npm 进行全局安装:
npm install -g better-qdrant-mcp-server
若不想全局安装,可直接使用 npx:
npx better-qdrant-mcp-server
use_mcp_tool
server_name: better-qdrant
tool_name: list_collections
arguments: {}
use_mcp_tool
server_name: better-qdrant
tool_name: add_documents
arguments: {
"filePath": "/path/to/your/document.pdf",
"collection": "my-collection",
"embeddingService": "openai",
"chunkSize": 1000,
"chunkOverlap": 200
}
use_mcp_tool
server_name: better-qdrant
tool_name: search
arguments: {
"query": "你的搜索查询",
"collection": "my-collection",
"embeddingService": "openai",
"limit": 5
}
use_mcp_tool
server_name: better-qdrant
tool_name: delete_collection
arguments: {
"collection": "my-collection"
}
要将此 MCP 服务器与 Claude 配合使用,请将其添加到你的 MCP 设置配置文件中:
{
"mcpServers": {
"better-qdrant": {
"command": "npx",
"args": ["better-qdrant-mcp-server"],
"env": {
"QDRANT_URL": "http://localhost:6333",
"QDRANT_API_KEY": "你的_api_密钥(如果需要)",
"DEFAULT_EMBEDDING_SERVICE": "ollama",
"OPENAI_API_KEY": "你的_openai_api_密钥",
"OPENAI_ENDPOINT": "https://api.openai.com/v1",
"OPENROUTER_API_KEY": "你的_openrouter_api_密钥",
"OPENROUTER_ENDPOINT": "https://api.openrouter.com/v1",
"OLLAMA_ENDPOINT": "http://localhost:11434",
"OLLAMA_MODEL": "nomic-embed-text"
}
}
}
}
本项目采用 MIT 许可证。