MCP HubMCP Hub
qdrant

mcp-server-qdrant

by: qdrant

Qdrant Model Context Protocol (MCP) server

452created 02/12/2024
Visit
Qdrant
Protocol

📌Overview

Purpose: The primary goal of the mcp-server-qdrant is to serve as a Model Context Protocol server that manages and retrieves memories using the Qdrant vector search engine.

Overview: This server functions as a semantic memory layer, facilitating the storage and retrieval of information in the Qdrant database. It is designed to bridge the gap between large language models (LLMs) and external data sources, enhancing AI applications by providing contextual understanding.

Key Features:

  • Memory Storage (qdrant-store): This feature allows users to store information and optional metadata in the Qdrant database, enabling the system to retain relevant data for future reference.

  • Information Retrieval (qdrant-find): Users can query the database to retrieve stored information, which is returned as a series of relevant messages, thus ensuring efficient access to necessary context for LLMs.


mcp-server-qdrant: A Qdrant MCP Server

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. This repository demonstrates how to create an MCP server for Qdrant, a vector search engine.

Overview

This MCP server acts as a semantic memory layer on top of the Qdrant database, allowing for the storage and retrieval of memories.

Components

Tools

  1. qdrant-store

    • Stores information in the Qdrant database.
    • Input:
      • information (string): Information to store.
      • metadata (JSON): Optional metadata.
    • Returns: Confirmation message.
  2. qdrant-find

    • Retrieves relevant information from the Qdrant database.
    • Input:
      • query (string): Query for searching.
    • Returns: Information stored in the Qdrant database.

Environment Variables

NameDescriptionDefault Value
QDRANT_URLURL of the Qdrant serverNone
QDRANT_API_KEYAPI key for the Qdrant serverNone
COLLECTION_NAMEName of the collection to useRequired
QDRANT_LOCAL_PATHPath to the local Qdrant databaseNone
EMBEDDING_PROVIDEREmbedding provider to usefastembed
EMBEDDING_MODELName of the embedding model to usesentence-transformers/all-MiniLM-L6-v2
TOOL_STORE_DESCRIPTIONCustom description for the store toolSee default in settings.py
TOOL_FIND_DESCRIPTIONCustom description for the find toolSee default in settings.py

Important: Command-line arguments are not supported anymore! Use environment variables for all configuration.

Installation

Using uvx

No specific installation is needed to run mcp-server-qdrant with uvx.

QDRANT_URL="http://localhost:6333" \
COLLECTION_NAME="my-collection" \
EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2" \
uvx mcp-server-qdrant

Transport Protocols

Supported transport protocols:

  • stdio (default): Local MCP clients only.
  • sse: Server-Sent Events, suitable for remote clients.

Using Docker

You can build and run the MCP server using Docker:

# Build the container
docker build -t mcp-server-qdrant .

# Run the container
docker run -p 8000:8000 \
  -e QDRANT_URL="http://your-qdrant-server:6333" \
  -e QDRANT_API_KEY="your-api-key" \
  -e COLLECTION_NAME="your-collection" \
  mcp-server-qdrant

Installing via Smithery

To install the Qdrant MCP Server via Smithery:

npx @smithery/cli install mcp-server-qdrant --client claude

Manual configuration of Claude Desktop

Add the following configuration to your claude_desktop_config.json:

{
  "qdrant": {
    "command": "uvx",
    "args": ["mcp-server-qdrant"],
    "env": {
      "QDRANT_URL": "https://xyz-example.eu-central.aws.cloud.qdrant.io:6333",
      "QDRANT_API_KEY": "your_api_key",
      "COLLECTION_NAME": "your-collection-name",
      "EMBEDDING_MODEL": "sentence-transformers/all-MiniLM-L6-v2"
    }
  }
}

For local Qdrant mode, use:

{
  "qdrant": {
    "command": "uvx",
    "args": ["mcp-server-qdrant"],
    "env": {
      "QDRANT_LOCAL_PATH": "/path/to/qdrant/database",
      "COLLECTION_NAME": "your-collection-name",
      "EMBEDDING_MODEL": "sentence-transformers/all-MiniLM-L6-v2"
    }
  }
}

Support for Other Tools

This MCP server can be compatible with any MCP-compatible client, such as Cursor.

Using with Cursor/Windsurf

You can configure this MCP server as a code search tool by customizing tool descriptions:

QDRANT_URL="http://localhost:6333" \
COLLECTION_NAME="code-snippets" \
TOOL_STORE_DESCRIPTION="Store reusable code snippets for later retrieval." \
TOOL_FIND_DESCRIPTION="Search for relevant code snippets." \
uvx mcp-server-qdrant --transport sse

Tip: We recommend using SSE transport for connecting Cursor/Windsurf to the MCP server.

Contributing

If you have suggestions or want to report a bug, feel free to open an issue! Contributions are welcome.

Testing mcp-server-qdrant Locally

The MCP inspector is a tool for testing and debugging MCP servers.

QDRANT_URL=":memory:" COLLECTION_NAME="test" \
mcp dev src/mcp_server_qdrant/server.py

Once started, access the inspector interface through your browser.

License

This MCP server is licensed under the Apache License 2.0, allowing free use, modification, and distribution under its terms.