Mcp Qdrant Docker

Mcp Qdrant Docker

Okay, here's a breakdown of Docker configuration for a Qdrant MCP (Multi-Cluster Proxy) server, along with explanations and best practices. I'll provide a `docker-compose.yml` example and discuss the key elements. **Understanding Qdrant MCP** The Qdrant MCP acts as a gateway to multiple Qdrant clusters. It handles routing requests to the appropriate cluster based on configuration. This is useful for: * **Scaling:** Distributing your data across multiple Qdrant clusters. * **Isolation:** Separating data for different tenants or applications. * **High Availability:** Routing around failed clusters. * **Geo-Distribution:** Placing data closer to users. **`docker-compose.yml` Example** ```yaml version: "3.9" services: qdrant-mcp: image: qdrant/qdrant-mcp:latest # Or specify a version ports: - "6333:6333" # MCP API port - "6334:6334" # MCP GRPC port environment: QDRANT_MCP_CONFIG_PATH: /qdrant-mcp/config/config.yaml # Path to your config file volumes: - ./config:/qdrant-mcp/config # Mount your config directory restart: unless-stopped depends_on: - qdrant-cluster-1 # Replace with your actual cluster service names - qdrant-cluster-2 # Replace with your actual cluster service names # Add more dependencies as needed qdrant-cluster-1: image: qdrant/qdrant:latest # Or specify a version ports: - "6335:6333" # Cluster 1 API port environment: QDRANT__SERVICE__GRPC_PORT: 6336 volumes: - qdrant_data_1:/qdrant/storage restart: unless-stopped qdrant-cluster-2: image: qdrant/qdrant:latest # Or specify a version ports: - "6337:6333" # Cluster 2 API port environment: QDRANT__SERVICE__GRPC_PORT: 6338 volumes: - qdrant_data_2:/qdrant/storage restart: unless-stopped volumes: qdrant_data_1: qdrant_data_2: ``` **Explanation:** 1. **`version: "3.9"`:** Specifies the Docker Compose file version. Use a version compatible with your Docker installation. 2. **`services:`:** Defines the services (containers) that will be run. 3. **`qdrant-mcp:`:** The service for the Qdrant MCP. * **`image: qdrant/qdrant-mcp:latest`:** Uses the official Qdrant MCP Docker image. **Important:** Consider using a specific version tag (e.g., `qdrant/qdrant-mcp:v1.5.0`) instead of `latest` for production to ensure consistent behavior. * **`ports:`:** Maps the container ports to the host ports. * `6333:6333`: The main Qdrant MCP API port (HTTP). You'll use this to send requests to the MCP. * `6334:6334`: The Qdrant MCP gRPC port. * **`environment:`:** Sets environment variables for the container. * `QDRANT_MCP_CONFIG_PATH: /qdrant-mcp/config/config.yaml`: Specifies the path to the MCP configuration file *inside* the container. This is crucial. * **`volumes:`:** Mounts a directory from your host machine into the container. * `./config:/qdrant-mcp/config`: Mounts the `./config` directory on your host to `/qdrant-mcp/config` inside the container. This is where you'll place your `config.yaml` file. **You MUST create this `./config` directory and put your `config.yaml` file in it.** * **`restart: unless-stopped`:** Automatically restarts the container if it crashes, unless you explicitly stop it. Good for reliability. * **`depends_on:`:** Specifies dependencies. The MCP will only start *after* the listed services (your Qdrant clusters) are running. **Important:** Replace `qdrant-cluster-1` and `qdrant-cluster-2` with the actual names of your Qdrant cluster services in your `docker-compose.yml`. Add more as needed. 4. **`qdrant-cluster-1` and `qdrant-cluster-2`:** Example Qdrant cluster services. You'll need to configure these according to your needs. * **`image: qdrant/qdrant:latest`:** Uses the official Qdrant Docker image. Again, use a specific version tag for production. * **`ports:`:** Maps the container ports to the host ports. Make sure these ports don't conflict with each other or with the MCP. * **`environment:`:** Sets environment variables for the container. The `QDRANT__SERVICE__GRPC_PORT` is important for internal communication within the cluster. * **`volumes:`:** Mounts a volume for persistent storage of the Qdrant data. `qdrant_data_1:/qdrant/storage` creates a named volume. * **`restart: unless-stopped`:** Automatically restarts the container if it crashes. 5. **`volumes:`:** Defines named volumes for persistent storage. This is important so your data isn't lost when the containers are stopped or restarted. **`config.yaml` (Qdrant MCP Configuration)** This is the most important part. The `config.yaml` file tells the MCP how to route requests to your Qdrant clusters. Here's an example: ```yaml clusters: cluster1: address: "qdrant-cluster-1:6333" # Use the service name and port cluster2: address: "qdrant-cluster-2:6333" # Use the service name and port collection_mappings: my_collection: cluster: cluster1 # All requests for "my_collection" go to cluster1 another_collection: cluster: cluster2 # All requests for "another_collection" go to cluster2 shared_collection: cluster: cluster1 # All requests for "shared_collection" go to cluster1 ``` **Explanation of `config.yaml`:** * **`clusters:`:** Defines the Qdrant clusters that the MCP will route to. * `cluster1`, `cluster2`: Arbitrary names for your clusters. Use descriptive names. * `address`: The address of the Qdrant cluster. **Crucially, use the Docker service name (e.g., `qdrant-cluster-1`) and the internal port (6333 by default).** Docker's internal DNS will resolve the service name to the container's IP address. Do *not* use `localhost` or the host's IP address here. * **`collection_mappings:`:** Defines how collections are mapped to clusters. * `my_collection`, `another_collection`, `shared_collection`: The names of your Qdrant collections. * `cluster`: The name of the cluster (as defined in the `clusters` section) that should handle requests for this collection. **Important Considerations and Best Practices:** * **Version Pinning:** Always use specific version tags for your Docker images (e.g., `qdrant/qdrant-mcp:v1.5.0`, `qdrant/qdrant:v1.5.0`) instead of `latest` in production. This prevents unexpected behavior when the images are updated. * **Configuration Management:** Use a proper configuration management system (e.g., environment variables, configuration files) to manage your Qdrant and MCP settings. Avoid hardcoding values in your Dockerfiles or Compose files. * **Networking:** Docker Compose automatically creates a default network for your services. This allows the services to communicate with each other using their service names. If you need more complex networking, you can define custom networks. * **Health Checks:** Implement health checks for your Qdrant clusters and the MCP. This allows Docker to automatically restart unhealthy containers. See the Qdrant documentation for details on health check endpoints. * **Logging:** Configure logging for your Qdrant clusters and the MCP. This is essential for troubleshooting. Docker can collect logs from the containers and send them to a central logging system. * **Monitoring:** Monitor the performance of your Qdrant clusters and the MCP. Use metrics to track CPU usage, memory usage, disk I/O, and network traffic. * **Security:** Secure your Qdrant clusters and the MCP. Use authentication and authorization to control access to your data. Consider using TLS/SSL to encrypt communication between the MCP and the clusters. * **Resource Limits:** Set resource limits (CPU, memory) for your containers to prevent them from consuming too many resources. * **Backup and Restore:** Implement a backup and restore strategy for your Qdrant data. * **Testing:** Thoroughly test your Qdrant MCP setup before deploying it to production. * **Qdrant Documentation:** Refer to the official Qdrant documentation for the most up-to-date information and best practices: [https://qdrant.tech/documentation/](https://qdrant.tech/documentation/) **How to Run:** 1. **Create the `config` directory:** `mkdir config` 2. **Create the `config.yaml` file:** Place the `config.yaml` file (with your cluster definitions and collection mappings) in the `config` directory. 3. **Save the `docker-compose.yml` file:** Save the `docker-compose.yml` file in the same directory as the `config` directory. 4. **Run Docker Compose:** `docker-compose up -d` (This will start the containers in detached mode.) **Troubleshooting:** * **Check the logs:** Use `docker-compose logs qdrant-mcp` (or the name of your MCP service) to view the logs for the MCP container. Look for errors related to configuration, cluster connections, or routing. * **Verify the configuration:** Double-check the `config.yaml` file for errors. Make sure the cluster addresses are correct and that the collection mappings are accurate. * **Check network connectivity:** Make sure the MCP container can communicate with the Qdrant cluster containers. You can use `docker exec -it qdrant-mcp bash` to enter the MCP container and then use tools like `ping` or `telnet` to test connectivity. * **Qdrant Cluster Status:** Ensure your Qdrant clusters are running and healthy *before* starting the MCP. **Chinese Translation of Key Terms:** * **Qdrant MCP (Multi-Cluster Proxy):** Qdrant 多集群代理 (Duō jíqún dàilǐ) * **Cluster:** 集群 (Jíqun) * **Collection:** 集合 (Jíhé) * **Configuration:** 配置 (Pèizhì) * **Docker Compose:** Docker Compose * **Service:** 服务 (Fúwù) * **Image:** 镜像 (Jìngxiàng) * **Container:** 容器 (Róngqì) * **Port:** 端口 (Duānkǒu) * **Environment Variable:** 环境变量 (Huánjìng biànliàng) * **Volume:** 卷 (Juǎn) * **Mapping:** 映射 (Yìngshè) This comprehensive guide should help you set up a Qdrant MCP server using Docker. Remember to adapt the configuration to your specific needs and environment. Good luck!

RollandMELET

开发者工具
访问服务器

README

用于 Qdrant 的 MCP 服务器

项目背景

本项目提供了一个 MCP (模型上下文协议) 服务器,用于允许 Claude 访问部署在 VPS 上的 Qdrant 向量数据库。

配置

  • Qdrant 服务器部署在 Coolify 上
    • URL: http://qdrant-v8gc8cc4sk80o444ccck0gkg.178.16.129.71.sslip.io
    • Collection: ClaudeCollection
  • MCP 服务器通过 Docker 部署,以将 Qdrant 服务器暴露给 Claude

项目结构

  • Dockerfile: 用于 MCP 服务器的 Docker 容器配置
  • docker-compose.yaml: 用于通过 Coolify 部署服务的配置

环境要求

环境变量

  • QDRANT_URL: Qdrant 服务器的 URL
  • QDRANT_API_KEY: 用于 Qdrant 身份验证的 API 密钥
  • COLLECTION_NAME: 要使用的 Qdrant 集合的名称
  • EMBEDDING_MODEL: 要使用的嵌入模型 (默认: sentence-transformers/all-MiniLM-L6-v2)

端口

  • 8000: MCP 服务器的主端口 (支持 SSE 用于远程连接)

与 Claude Desktop 一起使用

要配置 Claude Desktop 以使用此 MCP 服务器,请按如下方式修改 claude_desktop_config.json 文件:

{
  "mcpServers": {
    "qdrant": {
      "url": "http://你的IP地址:8000/sse",
      "transport": "sse"
    }
  }
}

你的IP地址 替换为您的 VPS 的公共 IP 地址或 Coolify 提供的完整域名。

文档和资源

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
MCP Package Docs Server

MCP Package Docs Server

促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。

精选
本地
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。

精选
本地
JavaScript
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript
Linear MCP Server

Linear MCP Server

一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

精选
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Curri MCP Server

Curri MCP Server

通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。

官方
本地
JavaScript