# Qdrant MCP

> Qdrant connects your AI client directly to a vector database cluster. It lets you query embeddings, perform nearest neighbor similarity searches, and manage all collections without writing complex scripts. Use the `search` tool to find data points matching semantic queries, or use `list_collections` to map out what's stored in your indexes.

## Overview
- **Category:** ai-frontier
- **Price:** Free
- **Tags:** vector-database, semantic-search, embedding-management, data-retrieval, vector-search

## Description

Qdrant hooks your AI client directly into a vector database cluster. You can query embeddings, run nearest neighbor similarity searches, and manage every collection without having to write any complex scripts or boilerplate code. It gives your agent the raw power it needs to interact with structured data.

To start mapping out what's in the system, you use **`list_collections`**. This tool runs instantly and shows you a full list of every single collection stored on your Qdrant instance; it’s like getting an index map of all your indexes. Once you know which collections exist, you can dive deeper into any specific one by calling **`get_collection`**. You pass the name of the collection, and the agent spits out detailed metadata about it—you'll get metrics like its configured distance metric (e.g., Cosine or Euclidean) and the expected vector size for all payloads.

When you need to know how big a collection is, use **`count`**. You pass a specific collection name, and it returns one single number: the total count of points housed in that index. This gives you an immediate grasp of your dataset's scale without having to pull records. If you suspect something’s wrong or if you need to prune old data, you use **`delete`**. You specify which data points you want gone from a collection; remember, this action is permanent, so double-check what you send.

For finding specific records by their unique ID, the agent uses **`get_points`**. If you know the exact identifier (ID) of a payload, you feed that ID to this tool, and it pulls the full data—the actual payload—immediately. This is crucial for debugging or validating specific pieces of information.

When you need to read through massive amounts of data page by page, **`scroll`** handles it. You use this tool when your dataset is too big to load into memory all at once. It returns batches of points and their payloads sequentially, allowing your agent to iterate through thousands of records without hitting any memory limits. This lets you inspect IDs and contents one chunk after the other.

The core function—the search itself—is done with **`search`**. You pass a JSON array of floats; that’s your query vector. The tool then performs a nearest neighbor search within a specified collection, returning the data points that match your semantic query best. This is how you find data that means the same thing as your input, even if the words don't match exactly.

To put it all together: If your goal is to analyze data quality or debug embeddings, you combine **`scroll`** with **`get_points`**. To build a knowledge graph and link related concepts, you rely on **`search`**. You can check the overall structure of your environment by running **`list_collections`**, then validate that structure using **`get_collection`** before querying. If you need to know how many records are available across all indexes without actually pulling them, use **`count`**. The entire workflow—from mapping out what exists with **`list_collections`** to reading specific payloads with **`get_points`**, and finally performing the heavy lifting of finding semantic matches using **`search`**—runs entirely through your agent's ability to invoke these tools, giving you full control over your vector data.

## Tools

### count
Returns a single number: the total count of points in a specified collection.

### delete
Removes specific data points from a collection. Note that this action is irreversible.

### get_collection
Retrieves detailed metadata about one specific collection, like its distance metric and vector size.

### get_points
Pulls the actual data (payloads) for points when you provide their unique IDs.

### list_collections
Lists every collection present in your Qdrant database instance.

### scroll
Returns batches of points and their payloads, useful for reading through large amounts of data page by page.

### search
Performs a nearest neighbor search in a collection using a JSON array of floats as the query vector.

## Prompt Examples

**Prompt:** 
```
List the configurations for all collections in my Qdrant instance.
```

**Response:** 
```
I found 2 collections. 
1. `docs-embeddings`: Contains 4,500 points, optimized using Cosine distance, vector size 1536.
2. `image-features`: Contains 120,400 points, optimized using Dot product, vector size 512.
Should I inspect `docs-embeddings` further?
```

**Prompt:** 
```
Count the total embedded points in the 'docs-embeddings' collection.
```

**Response:** 
```
The `count` tool indicates there are exactly 14,235 points currently indexed in the `docs-embeddings` collection.
```

**Prompt:** 
```
Scroll and show me the IDs and payloads of the first 3 items in the 'users' collection.
```

**Response:** 
```
Scrolling through 'users', here are the top 3 IDs and payloads:
1. ID: `1f2a3`, Payload: { "role": "admin", "department": "sales" }
2. ID: `7b9c1`, Payload: { "role": "user", "department": "support" }
3. ID: `9d8e4`, Payload: { "role": "user", "department": "sales" }
```

## Capabilities

### Find nearest vector matches
You pass a query vector (a JSON array of floats), and the agent returns the most similar data points from your collections.

### List all indexes in the cluster
The agent runs `list_collections` to show you every available collection, giving you a map of your stored data.

### Read metadata and metrics for one index
You specify a collection name, and the agent calls `get_collection` to report on its structure, including distance metrics and total payload points.

### Count all indexed records
The agent uses `count` to give you an immediate total number of points in a specified collection.

### Iterate through large datasets
You use the `scroll` tool to paginate through thousands of data points, allowing you to inspect IDs and payloads sequentially without memory limits.

### Retrieve specific records by ID
If you know a record's unique identifier (ID), the agent uses `get_points` to pull that exact payload immediately.

## Use Cases

### Debugging poor embedding quality
A data scientist wants to check if the latest batch of embeddings are actually working. They use `list_collections` first, then select a collection and run `scroll`. This lets them inspect hundreds of payloads quickly to verify that the right information is being indexed.

### Building RAG context retrieval
The engineer needs an answer based on external documentation. They prompt their agent: 'Find documents related to API rate limits.' The agent runs `search` with the query vector, and returns the top 3 payloads that provide the direct answer.

### Auditing database health
A backend developer suspects a collection is getting bloated with old data. They use `count` to check the current volume and then run `get_collection` to verify the distance metric, helping them decide if they need to clean up.

### Finding specific records by ID
You know a user's record has ID `1f2a3`. Instead of scrolling through millions of results, you use `get_points` with that exact ID and pull the payload immediately. It’s fast and precise.

## Benefits

- **Semantic Search on Demand:** Skip the boilerplate code. Just ask your agent to `search` for context, and it runs a nearest neighbor query using complex embeddings—all in one turn.
- **Instant Inventory Check:** Need to know what indexes you have? Use `list_collections`. It gives you an immediate map of every data source without needing to navigate multiple dashboards.
- **Deep Data Debugging:** Instead of dumping logs, use the `scroll` tool. You can paginate through millions of records and inspect IDs and payloads right in your chat window.
- **Efficiency Gains with `count`:** Get a quick total point count using `count`. It’s much faster than running an aggregation query just to check data volume.
- **Targeted Data Cleanup:** Use `delete` for safe, controlled removal of bad or redundant data points. You don't need a separate admin script for simple cleanup tasks.

## How It Works

The bottom line is that your AI client treats Qdrant like a native API endpoint, letting you query complex vector math right through natural conversation.

1. First, subscribe to this server and provide your Qdrant Base URL and API Key.
2. Next, prompt your AI client with a query. For example: 'List all collections' or 'Find data similar to X vector'.
3. The agent executes the necessary tool (like `list_collections` or `search`), and you get back the structured payload data directly in the chat.

## Frequently Asked Questions

**How do I find my Qdrant URL and API Key?**
For **Qdrant Cloud**: Go to the Qdrant Cloud Console, select your cluster to open the Cluster Detail Page. The endpoint will be displayed there (e.g., `xyz.us-east4-0.gcp.cloud.qdrant.io`), and you can generate Database API Keys underneath it (they start with `eyJhb`). For **Self-hosted**: Provide your custom URL and the static custom key you defined in your `config.yaml`.

**Can my AI use this for a RAG architecture directly?**
Yes contextually, but practically your agent acts as the database debugger. It can formulate vector arrays to query `search_points`, retrieving identical payload structures. It's meant for the *engineer building the RAG*, helping you inspect distances and debug faulty retrieval mechanisms mid-code.

**Does it support deleting vectors?**
Yes. If an embedding got corrupted or references dropped articles, use the `delete` tool. Pass the collection name and the list of specific IDs. Qdrant handles the mutation instantly and updates the index without rebuilding.

**What if I have millions of points?**
Instead of overloading your chat context, instruct your agent to use the `count` tool to grasp the scale, and the `scroll` tool with a small limit constraint (e.g., 5-10 records at a time). This paginates large bodies cleanly when analyzing index health.

**How do I check which collections are available using the `list_collections` tool?**
It lists every vector collection in your Qdrant instance. The output shows the collection name, current point count, and optimization details (like distance metrics or vector size).

**What format must my query be when running the `search` tool?**
You must provide a JSON array of floats for the query vector. The `search` tool then performs nearest neighbor similarity searches against your specified collection.

**Using `get_collection`, what specific metadata can I retrieve about an index?**
This tool pulls detailed information on a given collection, including its total payload points and the distance metrics it uses (e.g., Cosine or Dot product).

**How does the `scroll` tool help me debug data payloads?**
The `scroll` tool allows you to traverse a collection sequentially, returning both the point IDs and their full JSON payloads. This is ideal for inspecting data quality without writing complex pagination logic.