Back to MCP directory
publicPublicdnsLocal runtime

better-qdrant-mcp-server

一个增强Qdrant向量数据库功能的MCP服务器,提供集合管理、文档添加和语义搜索等功能。

article

README

🚀 更好的 Qdrant MCP 服务器

这是一个增强版的 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

先决条件

  • Node.js >= 18.0.0
  • 运行中的 Qdrant 服务器(本地或远程)
  • 使用的嵌入式服务 API 密钥

✨ 主要特性

  • 列出集合:可查看所有可用的 Qdrant 集合。
  • 添加文档:能处理并添加文档到 Qdrant 集合中,支持多种嵌入式服务。
  • 搜索:可在向量数据库上执行语义搜索。
  • 删除集合:可从 Qdrant 数据库中移除集合。

📦 安装指南

全局安装

使用 npm 进行全局安装:

npm install -g better-qdrant-mcp-server

直接使用 npx

若不想全局安装,可直接使用 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"
}

高级用法

使用 Claude

要将此 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"
      }
    }
  }
}

📚 详细文档

支持的嵌入式服务

  • OpenAI:需要一个 API 密钥。
  • OpenRouter:需要一个 API 密钥。
  • Ollama:本地嵌入模型(默认端点:http://localhost:11434)。
  • FastEmbed:本地嵌入模型。

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client