Skip to main content

A Python MCP server for Qdrant memory storage and semantic search, compatible with Cursor-like MCP clients.

Project description

better-qdrant-mcp

An MCP server implemented with fastmcp, OpenAI embeddings, and qdrant-client, providing long-term memory and semantic search on top of Qdrant.

User Guide

Features

  • MCP server built with fastmcp
  • Hybrid search in Qdrant (dense OpenAI embeddings + sparse BM25)
  • Chinese support via jieba
  • Three tools aligned with the Node.js version:
    • memory-store
    • memory-search
    • memory-debug
  • Multiple transports: stdio, SSE, streamable HTTP

Requirements

  • Python 3.12+
  • Qdrant reachable via HTTP

Quick Start (published package)

The project is published as the better-qdrant-mcp package, so you can run it directly with uvx without cloning this repo.

1. Environment variables (required for all transports)

Minimal env for typical use:

  • QDRANT_URL – defaults to http://localhost:6333
  • QDRANT_API_KEY – optional
  • COLLECTION_NAME – optional default collection
  • OPENAI_API_KEY (or OPENAPI_API_KEY) – required
  • OPENAI_BASE_URL – optional
  • OPENAI_EMBEDDING_MODEL – defaults to text-embedding-3-small

Advanced / transport-related env:

  • MCP_TRANSPORTstdio | sse | streamable-http (default: stdio)
  • MCP_HOST – host for HTTP-based transports (default: 0.0.0.0)
  • MCP_PORT – port for HTTP-based transports (default: 8000)
  • MCP_PATH – path for HTTP transports (default: /mcp)

2. Available MCP tools

Once the server is running, the MCP client will see three tools:

  • memory-store(information, metadata?: dict, collection_name?: str) -> str
  • memory-search(query, limit?: int=5, collection_name?: str) -> str
  • memory-debug(collection_name?: str) -> str

memory-search uses hybrid search in Qdrant (dense + sparse). If the collection is configured with named vectors dense and sparse, queries are ranked by fusing dense OpenAI embeddings and sparse BM25 scores; otherwise it falls back to dense-only search.

3. Start the server

You can either specify the transport via CLI flags (recommended for quick start) or via env (MCP_TRANSPORT).

Standard IO (stdio) – default
uvx better-qdrant-mcp

In this mode, you configure your MCP client to use stdio transport and just invoke the binary; no HTTP URL is needed.

Server-Sent Events (SSE)
# Default host 0.0.0.0 and port 8000
uvx better-qdrant-mcp --transport sse

# Custom host and port
uvx better-qdrant-mcp --transport sse --host 0.0.0.0 --port 3000

Connection details for MCP clients:

  • Transport: sse
  • URL: http://<host>:<port>/sse (for example: http://localhost:8000/sse)
Streamable HTTP (recommended for web applications)
# Default host 0.0.0.0, port 8000 and path /mcp
uvx better-qdrant-mcp --transport streamable-http

# Custom host, port, and path
uvx better-qdrant-mcp --transport streamable-http --host 0.0.0.0 --port 3000 --path /api/mcp

Connection details for MCP clients:

  • Transport: streamable-http
  • URL: http://<host>:<port><path> (for example: http://localhost:8000/mcp)

Development Guide

Local installation (for development)

If you want to work on this repo locally instead of using the published package:

# using uv (recommended)
uv sync

# or with pip (editable install)
pip install -e .

Local build

For local development, you can use the provided Makefile:

make build

This command will first clean the dist directory and then run uv build to produce fresh artifacts.

Docker Deployment

Docker Compose provides Qdrant + this MCP server as a single service. Transport (stdio, sse, streamable-http) is selected via MCP_TRANSPORT.

The Docker image is built and published automatically to GitHub Container Registry as:

  • ghcr.io/jtsang4/better-qdrant-mcp:latest
  • Additional tags for branches, tags, and commit SHAs

The provided docker-compose.yml uses this published image directly, so you do not need to build the image locally.

# Start Qdrant + MCP using the published image
docker compose up -d

# Pull the latest published image and restart services
docker compose pull mcp && docker compose up -d

# Stop services
docker compose down

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better_qdrant_mcp-0.3.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

better_qdrant_mcp-0.3.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file better_qdrant_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: better_qdrant_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.6

File hashes

Hashes for better_qdrant_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 61cb89caeebec92af6e559e58e66df5738c71ead851153683bdbabca41d18e96
MD5 0f957e427d34a61cb15530cb51e582d8
BLAKE2b-256 8695be83942f59fab3b936a18b472bce2bdee3b57a92078b6205512bf13c13ce

See more details on using hashes here.

File details

Details for the file better_qdrant_mcp-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for better_qdrant_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 433cc8c855303efe81bb930f2c85c87c2b2904f16b8083e6626cc1c0ab993190
MD5 fc560f9b3e252977d30405b92843b20d
BLAKE2b-256 81dd8520c12f82b5ea30334bbe825b35810986323ada752b15f63b6d97160604

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page