qdrant-mcp-ollama
Uses Ollama to generate GPU-accelerated embeddings, enabling semantic search and retrieval over codebases stored in Qdrant.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@qdrant-mcp-ollamaSearch the codebase for authentication logic and return relevant code chunks."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
qdrant-mcp-ollama
A Model Context Protocol (MCP) server for Qdrant vector database that uses Ollama for GPU-accelerated embeddings.
Why not the official mcp-server-qdrant?
The official Qdrant MCP server uses FastEmbed for embeddings, which:
Runs on CPU only — slow on large codebases, underutilizes modern GPUs
Uses a small model (
all-MiniLM-L6-v2, 384-dim) — lower quality embeddingsSingle-process lock in local mode — only one MCP client can access the database at a time
This server solves all three problems:
Official |
| |
Embedding engine | FastEmbed (CPU) | Ollama (GPU) |
Default model | all-MiniLM-L6-v2 (384-dim, 80MB) | bge-m3 (1024-dim, 1.2GB) |
Concurrent access | No (local mode) | Yes (Qdrant server) |
Model flexibility | FastEmbed models only | Any Ollama embedding model |
Related MCP server: Claude Context MCP
Architecture
┌──────────────┐ ┌────────────────────┐ ┌─────────────┐
│ MCP Client │────>│ qdrant-mcp-ollama │────>│ Ollama │
│ (Claude Code, │ │ (server.py) │ │ (GPU) │
│ Kilo Code, │<────│ │ └─────────────┘
│ Cursor, etc) │ └────────┬───────────┘
└──────────────┘ │
v
┌────────────────────┐
│ Qdrant Server │
│ (Docker, :6333) │
│ Storage: local │
│ disk / cloud │
└────────────────────┘Prerequisites
Ollama — installed and running with an embedding model pulled
Docker — for running the Qdrant server
uv — Python package manager (recommended) or
pip
Quick Start
1. Pull an embedding model in Ollama
ollama pull bge-m32. Start the Qdrant server
docker run -d --name qdrant-server \
-p 6333:6333 -p 6334:6334 \
-v qdrant-storage:/qdrant/storage \
--restart unless-stopped \
qdrant/qdrant:latest3. Run the MCP server
# No install needed — uv downloads dependencies on-the-fly:
QDRANT_URL="http://localhost:6333" \
EMBEDDING_MODEL="bge-m3" \
uv run --with fastmcp --with qdrant-client --with httpx python server.py4. Embed a codebase
uv run --with qdrant-client --with httpx python embed_codebase.py \
/path/to/your/project my-project --preset python5. Search from your MCP client
Once configured (see sections below), ask your AI assistant:
"Search the codebase for authentication logic"
It will use the qdrant_find tool to return semantically relevant code chunks.
Setting Up the Qdrant Server
Option A: Docker (recommended)
Store data on a specific drive (e.g., E: on Windows):
# Create storage directories
mkdir -p E:/qdrant-storage E:/qdrant-snapshots
# Start Qdrant with persistent storage
docker run -d --name qdrant-server \
-p 6333:6333 -p 6334:6334 \
-v E:/qdrant-storage:/qdrant/storage \
-v E:/qdrant-snapshots:/qdrant/snapshots \
--restart unless-stopped \
qdrant/qdrant:latestOn Linux/macOS:
docker run -d --name qdrant-server \
-p 6333:6333 -p 6334:6334 \
-v ~/qdrant-storage:/qdrant/storage \
--restart unless-stopped \
qdrant/qdrant:latestThe --restart unless-stopped flag ensures Qdrant starts automatically with Docker Desktop.
Verify it's running:
docker ps --filter name=qdrant-server
# Or open http://localhost:6333/dashboard in your browserOption B: Qdrant Cloud
Sign up at cloud.qdrant.io and get your URL and API key. Then set:
QDRANT_URL="https://your-cluster.cloud.qdrant.io:6333"
QDRANT_API_KEY="your-api-key"Note: The
QDRANT_API_KEYenvironment variable is passed through to the Qdrant client automatically.
Embedding a Codebase
The embed_codebase.py script scans a directory, chunks source files, and bulk-embeds them into Qdrant using Ollama on GPU.
Basic usage
uv run --with qdrant-client --with httpx python embed_codebase.py <directory> <collection-name>Using extension presets
# Python project
python embed_codebase.py ./my-api api-backend --preset python
# Full-stack web project
python embed_codebase.py ./my-app frontend --preset web
# R / bioinformatics project
python embed_codebase.py ./analysis bio-analysis --preset r
# Everything
python embed_codebase.py ./mono-repo all-code --preset allCustom extensions
python embed_codebase.py ./project my-collection --extensions .py .sql .sh .yamlAvailable presets
Preset | Extensions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| All common source extensions |
If no --preset or --extensions is provided, the script auto-detects file types.
All options
usage: embed_codebase.py <directory> <collection> [options]
positional arguments:
directory Path to the codebase directory
collection Qdrant collection name
options:
--extensions EXT [EXT ...] File extensions to include (e.g. .py .ts)
--preset PRESET Use a preset group of extensions
--model MODEL Ollama embedding model (default: bge-m3)
--qdrant-url URL Qdrant server URL (default: http://localhost:6333)
--ollama-url URL Ollama server URL (default: http://localhost:11434)
--chunk-size N Max lines per chunk (default: 80)
--chunk-overlap N Overlap lines between chunks (default: 10)
--batch-size N Upload batch size for Qdrant (default: 500)
--append Append to existing collection instead of replacingAppend mode
By default, re-running the script replaces the collection. Use --append to add to an existing collection:
# First embed
python embed_codebase.py ./src main-code --preset typescript
# Add more files later
python embed_codebase.py ./docs main-code --extensions .md --appendMulti-Codebase Usage
Use separate collections for each codebase to keep search results scoped and relevant:
# Project A
python embed_codebase.py ~/projects/api-server api-server --preset python
# Project B
python embed_codebase.py ~/projects/web-app web-app --preset web
# Project C
python embed_codebase.py ~/projects/data-pipeline data-pipeline --preset pythonWhen configuring the MCP server:
Without
COLLECTION_NAME: You must specify the collection per query. This is ideal when one MCP server serves multiple projects.With
COLLECTION_NAME: A default collection is used automatically. Set this per-project if your MCP client supports project-scoped configuration.
Configuring Claude Code
Add the MCP server
claude mcp add qdrant -s user \
-e QDRANT_URL="http://localhost:6333" \
-e OLLAMA_URL="http://localhost:11434" \
-e EMBEDDING_MODEL="bge-m3" \
-- uv run --with fastmcp --with qdrant-client --with httpx \
python /path/to/qdrant-mcp-ollama/server.pyReplace /path/to/qdrant-mcp-ollama/ with the actual path where you cloned this repo.
With a default collection
If you primarily work on one project:
claude mcp add qdrant -s user \
-e QDRANT_URL="http://localhost:6333" \
-e OLLAMA_URL="http://localhost:11434" \
-e EMBEDDING_MODEL="bge-m3" \
-e COLLECTION_NAME="my-project" \
-- uv run --with fastmcp --with qdrant-client --with httpx \
python /path/to/qdrant-mcp-ollama/server.pyVerify
claude mcp list
# Should show: qdrant: ... ✓ Connected
claude mcp get qdrant
# Shows full configuration detailsUsage in Claude Code
Once configured, Claude Code can use these tools:
qdrant_store— Store information: "Store this authentication pattern in Qdrant"qdrant_find— Search: "Find code related to database migrations"
For multi-collection setups (no default), specify the collection:
"Search the
api-servercollection for rate limiting logic"
Configuring Kilo Code (VS Code Extension)
Kilo Code is a VS Code extension with built-in MCP support.
Option 1: Manual MCP configuration
Open Kilo Code settings in VS Code
Navigate to MCP Servers configuration
Add a new server with:
Field | Value |
Name |
|
Command |
|
Arguments |
|
Set environment variables:
Variable | Value |
|
|
|
|
|
|
| Your project collection name (e.g., |
Option 2: VS Code settings.json
Add to your VS Code settings.json (Ctrl+Shift+P > Preferences: Open User Settings (JSON)):
{
"kilocode.mcpServers": {
"qdrant": {
"command": "uv",
"args": [
"run", "--with", "fastmcp", "--with", "qdrant-client", "--with", "httpx",
"python", "/path/to/qdrant-mcp-ollama/server.py"
],
"env": {
"QDRANT_URL": "http://localhost:6333",
"OLLAMA_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "bge-m3",
"COLLECTION_NAME": "my-project"
}
}
}
}Per-project setup in Kilo Code
For multi-codebase setups, configure Kilo Code at project scope (not global) with a project-specific COLLECTION_NAME. This way each workspace searches only its own codebase.
Configuring Other MCP Clients
Cursor / Windsurf
Run the server with SSE transport for remote-capable clients:
QDRANT_URL="http://localhost:6333" \
OLLAMA_URL="http://localhost:11434" \
EMBEDDING_MODEL="bge-m3" \
FASTMCP_PORT=8000 \
uv run --with fastmcp --with qdrant-client --with httpx \
python server.py --transport sseThen in Cursor/Windsurf MCP settings, connect to: http://localhost:8000/sse
Generic MCP client (stdio)
The default transport is stdio. Any MCP client that supports stdio can use this server by running:
uv run --with fastmcp --with qdrant-client --with httpx python server.pyConfiguration Reference
MCP Server Environment Variables
Variable | Description | Default |
| Qdrant server URL |
|
| API key for Qdrant Cloud | None |
| Ollama server URL |
|
| Ollama embedding model name |
|
| Default collection (empty = must specify per call) | (empty) |
Choosing an Embedding Model
All models below are available via ollama pull <model>:
Model | Dimensions | Size | Speed | Quality | Best for |
| 1024 | 1.2 GB | Moderate | High | General purpose, multilingual |
| 768 | 274 MB | Fast | Good | Lightweight, English-focused |
| 1024 | 670 MB | Moderate | High | English, high quality |
| 1024 | 1.2 GB | Moderate | Very High | Best quality, English |
| 384 | 46 MB | Very Fast | Fair | Minimal resources |
Recommendation: Start with bge-m3. It handles code well, supports multilingual content (comments in any language), and balances quality with speed.
Important: The embedding model used to index a collection must match the model used for queries. If you re-embed with a different model, delete and recreate the collection.
GPU Utilization
Larger models use more GPU. If your GPU is underutilized:
Switch from
nomic-embed-text(274 MB) tobge-m3(1.2 GB) or largerThe embedding script sends all texts in a single batch to maximize GPU saturation
For individual queries (via
qdrant_find), GPU spikes are brief and normal — embedding a single query takes milliseconds
Check GPU usage: nvidia-smi (NVIDIA) or rocm-smi (AMD)
MCP Tools
qdrant_store
Store information in the Qdrant database.
Parameter | Type | Required | Description |
| string | Yes | Text to store and make searchable |
| string | If no default set | Target collection |
| dict | No | Optional metadata to attach |
qdrant_find
Search for relevant information using semantic similarity.
Parameter | Type | Required | Description |
| string | Yes | Natural language search query |
| string | If no default set | Collection to search |
| int | No | Max results to return (default: 5) |
Troubleshooting
"Connection closed" / MCP server won't start
Is Ollama running? Check with
ollama list. Start it withollama serveif needed.Is the embedding model pulled? Run
ollama pull bge-m3.Is Qdrant running? Check with
docker ps --filter name=qdrant-server.
"Collection does not exist"
The collection is created by the embedding script or on first qdrant_store call. Either:
Run
embed_codebase.pyto index your codebase firstOr store something with
qdrant_storeto auto-create the collection
Dimension mismatch errors
This happens when the collection was created with one embedding model but you're querying with another. Fix:
Delete the collection: visit
http://localhost:6333/dashboardRe-embed with the correct model
Ensure
EMBEDDING_MODELin the MCP server config matches what you used for embedding
"Storage folder is already accessed by another instance"
This error comes from the official mcp-server-qdrant using local mode (QDRANT_LOCAL_PATH). This project avoids that by connecting to a Qdrant server via URL. Make sure you're not running both servers pointing to the same local path.
Slow embedding / low GPU utilization
Use a larger model:
bge-m3(1.2 GB) instead ofnomic-embed-text(274 MB)The embedding script sends all texts in one batch — if you have thousands of chunks, this maximizes GPU usage
For very large codebases (10,000+ files), consider splitting into multiple runs per directory
License
Apache License 2.0 — see LICENSE.
Available Tools
2 toolsqdrant_findC
Search for relevant information in the Qdrant database using semantic similarity.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language query to search for. The query is embedded using the same GPU model used for storage, ensuring accurate results. | |
| top_k | No | Maximum number of results to return (default: 5). | |
| collection_name | No | Name of the collection to search in. Required if no default collection is configured. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It implies a read-only operation but does not explicitly state that no data is modified, does not mention return behavior, error conditions, or limitations. The single sentence provides minimal behavioral disclosure beyond the literal action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no redundancy or filler. It is front-loaded with the verb and resource. While extremely brief, it is not a tautology and conveys the essential purpose. It avoids unnecessary words while being clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has a sibling (qdrant_store) and an output schema (which covers return format), the description is still incomplete. It lacks any usage context, such as when to choose this over storage or how the search integrates with the workflow. The presence of an output schema reduces the need to explain returns, but the description does not cover the selection decision or behavioral expectations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers all three parameters (query, top_k, collection_name) with descriptions, so the baseline is 3. The description adds nothing beyond the schema; it mentions 'semantic similarity' which is already implied by the query parameter's embedding mention. No additional value is provided.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb ('Search'), the target resource ('Qdrant database'), and the method ('semantic similarity'). This distinguishes it from the sibling qdrant_store, which likely stores information. However, it does not explicitly name the sibling or contrast with it, so it lacks the full differentiation seen in higher-scoring examples.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus the alternative qdrant_store, nor any mention of prerequisites or context. The description only states the action without any direction on selection or exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
qdrant_storeC
Store information in the Qdrant database with GPU-accelerated embeddings.
| Name | Required | Description | Default |
|---|---|---|---|
| metadata | No | Optional metadata dictionary to attach to the stored point. | |
| information | Yes | The text information to store. This will be embedded and made searchable via semantic similarity. | |
| collection_name | No | Name of the collection to store in. Required if no default collection is configured. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states that information will be stored with embeddings, but does not disclose potential side effects such as whether existing points are overwritten, whether collections are auto-created, or any error behavior. The mutation is implied but not explicitly flagged.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that conveys the core action. 'GPU-accelerated embeddings' adds a performance detail that may be useful context, but it could be considered extraneous. Overall, it is appropriately sized and front-loaded with the action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple store operation with only 3 parameters and an output schema present, the description covers the basic action. However, it omits guidance on when a collection_name is required and does not mention any setup steps or constraints. It meets a minimum viable level but leaves gaps that an agent might need to handle.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no parameter-specific detail beyond what the schema already provides. The only minor addition is implying that information gets embedded, which is already stated in the schema. This meets the baseline but does not exceed it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Store information in the Qdrant database') with a specific resource and purpose. It implies a write operation distinct from the sibling qdrant_find, though it doesn't explicitly differentiate. The mention of 'GPU-accelerated embeddings' adds implementation detail but doesn't obscure the core purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus the sibling qdrant_find. The description does not say 'use this to add data, use qdrant_find to search' or mention any prerequisites like collection existence. An agent would have to infer usage from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
qdrant_find - First observed
qdrant_store
TDQS
Scored across 2 tools
The two tools, qdrant_store and qdrant_find, have entirely distinct purposes—one writes data, the other retrieves it. There is zero ambiguity between them.
Both tools follow a consistent 'qdrant_<verb>' pattern, using clear action verbs (store, find). The naming is predictable and uniform.
With only two tools, the server feels thin for what is typically a database domain, but it is not an extreme mismatch. It sits at the borderline of adequacy.
The server only provides store and find, lacking any management operations like delete, update, or list. For a database, this is a significant gap that will limit workflow coverage.
Maintenance
Related MCP Connectors
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Search your knowledge bases from any AI assistant using hybrid RAG.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Persistent semantic memory for AI agents: store and recall text by meaning (RAG). x402
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables semantic code search across codebases using Qdrant vector database and OpenAI embeddings, allowing users to find code by meaning rather than just keywords through natural language queries.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to index and search codebases using semantic search powered by multiple embedding providers (OpenAI, VoyageAI, Gemini, Ollama) and vector database storage.-
- FlicenseNot gradedqualityDmaintenanceEnables semantic code search across multi-language codebases using natural language queries, integrated with Qdrant vector database for fast, cached retrieval.1-
- AlicenseNot gradedqualityFmaintenanceIndexes codebases into Qdrant for semantic search, enabling AI assistants to find relevant code by meaning without re-exploring the repo.MIT