# MongoDB Atlas Vector Search MCP

> MongoDB Atlas Vector Search gives you full control over high-performance vector search and operational data management directly from your AI agent. Use it to execute sophisticated $vectorSearch queries, manage standard MQL documents (find/insert/delete), and provision custom search indices across your MongoDB Atlas cluster.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** vector-search, embeddings, ai-infrastructure, nosql, semantic-search, data-retrieval

## Description

You're getting full operational control over your MongoDB Atlas cluster right from your AI agent using this server. It lets your agent talk directly to your data, handling high-performance vector search and all kinds of standard document management. You don't need any manual scripting; your agent just runs the queries against the MCP standard.

When you use this setup, you can run advanced `$vectorSearch` queries using raw embedding vectors across your specified collections. This is how your AI client pulls back results that are semantically relevant to what it's looking for—it goes way beyond keyword matching. You'll execute sophisticated searches against the entire Atlas cluster.

For managing standard data, you use MQL filters for everything. Your agent can run `find` to pull specific MongoDB documents from any target collection by resolving exact query filters. If your system needs fresh data, it uses `insert` to drop a new, generic document into whatever collection you point it at within Atlas. Conversely, if the data is stale or wrong, your agent runs `delete`, using parsed MongoDB filters to specify exactly which records need to go.

You're also in charge of setting up the infrastructure for these searches. To optimize performance, you can use `create_index` to build and configure a standard embedding Search Index. You define this index by specifying custom dimensions and mapping definitions that tell Atlas how to calculate similarity scores across your data. Before starting, though, you need to know what's available. The agent runs `list_collections` to give you a complete list of every accessible data collection within the defined Atlas limits.

This system lets your agent run targeted MQL queries for rapid auditing by using `find`. This capability fetches specific metadata or structural chunks that bypass vector logic entirely, letting you check on raw data points fast. You're not just limited to searching vectors; you can query the underlying structure of your database too.

Basically, everything needed to manage your operational records—the finding, inserting, deleting, and indexing—is all housed here for your AI client to use. The agent handles connecting through the MCP standard and gives back structured data results instantly. You won't get a wall of text; you'll just get clean JSON output that tells you exactly what it found.

## Tools

### create_index
Creates a standard embedding Search Index bound to specific dimensions in your collection.

### delete
Deletes documents from a target collection, using parsed MongoDB filters to specify the data set.

### find
Retrieves standard MongoDB documents by resolving specific query filters against your collections.

### insert
Adds a new, generic document into the designated target collection within Atlas.

### list_collections
Lists all accessible data collections that are explicitly managed and bounded inside your Atlas limits.

### search
Performs high-dimensional Vector similarity search using the advanced $vectorSearch operator.

## Prompt Examples

**Prompt:** 
```
Vector search in 'knowledge_base' for vector: [0.1, -0.2, ...]
```

**Response:** 
```
Executing $vectorSearch on Atlas… I've identified the 5 most similar documents in the 'knowledge_base' collection. The top match has a high similarity score and contains content about 'Cloud Architecture'. Would you like the full JSON metadata for these matches?
```

**Prompt:** 
```
Find active users in the 'users' collection with plan 'pro'
```

**Response:** 
```
Executing MQL find query… I've identified 12 users matching the criteria: `{"status": "active", "plan": "pro"}`. Highlights include 'Alex Smith' (ID: 123) and 'Sarah Johnson' (ID: 456). I can retrieve the full account metadata for any of these users if you'd like.
```

**Prompt:** 
```
List all collections in the 'production' database
```

**Response:** 
```
I've retrieved the collection list for the 'production' database: 'users', 'orders', 'knowledge_base', 'system_logs', and 'product_catalog'. Which one would you like to audit or run a similarity search on?
```

## Capabilities

### Run Vector Similarity Queries
Execute advanced `$vectorSearch` queries using raw embedding vectors against your specified collections.

### Manage Standard Documents (CRUD)
Use MQL filters to insert, find, or delete standard MongoDB documents in any target collection.

### Create Search Indices
Build and configure Atlas Search indices by specifying custom dimensions and mapping definitions for your data.

### List Available Collections
Retrieve a list of all accessible data collections within the defined Atlas limits.

### Query Specific Data Points
Run targeted MQL queries to fetch specific metadata or structural chunks, bypassing vector logic for rapid auditing.

## Use Cases

### Debugging a Knowledge Base Query
The ML Engineer needs to see if their embeddings are working correctly. They don't just run `search`; they first use the `list_collections` tool to confirm the correct namespace, then use `find` to pull metadata for 10 random IDs, and finally execute a targeted `search` using a known vector. This verifies both structure and relevance.

### Updating User Records with New Vectors
The Backend Developer needs to update user profiles after training new embeddings. They first run `find` to pull the existing document IDs, then use the `insert` tool (or a conceptual upsert) to push the updated JSON record containing the fresh vector data.

### Auditing Search Capabilities
The Search Architect suspects one collection is missing necessary indexing. They run `list_collections` to confirm existence, then use `create_index` to define a new Atlas Search index, and finally verify the change by attempting a complex search using the `search` tool.

### Cleaning up Old Data
The data steward needs to delete records for users who left the company. They run `find` with an outdated status filter, and then use the `delete` tool on the resulting IDs list. This ensures both vector and operational data are purged.

## Benefits

- Seamlessly run vector searches: Use the `search` tool to execute sophisticated $vectorSearch queries, pulling back semantically relevant matches using raw embedding vectors. This eliminates manual SDK calls for basic retrieval.
- Maintain data integrity: The `find`, `insert`, and `delete` tools let you manage standard MQL documents alongside your vector data. You treat the entire dataset—metadata included—as one system.
- Build better search infrastructure: Use `create_index` to build Atlas Search indices. This gives you control over custom dimensions, optimizing how similarity calculations run.
- Keep track of everything: The `list_collections` tool lets your agent audit your environment by listing every accessible collection name. You always know what data sources are available.
- Verify data structure quickly: Use the `find` or targeted MQL queries to fetch specific metadata chunks, bypassing vector logic for rapid structural verification and auditing.

## How It Works

The bottom line is: you tell your AI client what to look for, and it runs the precise MongoDB Atlas command to get the answer.

1. Subscribe to the server and provide your MongoDB Atlas Data API URL and API Key.
2. Your AI client calls a tool (e.g., `search`) and passes the necessary query parameters, such as raw embedding vectors or MQL filters.
3. The MCP Server executes the operation against your cluster and returns structured data results directly to your agent.

## Frequently Asked Questions

**How do I check which collections are available using MongoDB Atlas Vector Search MCP Server?**
Run the `list_collections` tool. This immediately tells you all accessible data collections within your defined Atlas limits, so you know exactly what namespaces exist.

**What is the difference between `find` and `search` with MongoDB Atlas Vector Search MCP Server?**
`Find` uses standard MQL filters to look for documents based on explicit field values (e.g., 'status: active'). `Search` runs high-dimensional vector similarity, finding semantically related matches even if the keywords don't match exactly.

**Can I create an index using only the name of the collection?**
No. You must use `create_index` and specify both the target collection name AND the exact dimensions for the binding index to work correctly.

**If I update a document, which tool should I use: `find` or `insert`?**
Use `insert`. While you might first run `find` to get the ID, `insert` is the action that writes the updated data (the new JSON record) into the collection.

**What credentials do I need to successfully run the `search` tool?**
You must provide your MongoDB Atlas Data API URL and an active API Key. These credentials grant your agent access to the cluster, allowing it to execute vector similarity searches and manage data operations.

**How does using the `create_index` tool improve my search performance?**
The `create_index` tool optimizes your cluster's internal infrastructure. By defining custom dimensions and mapping, you pre-calculate the necessary structures for similarity checks, making subsequent vector searches much faster.

**When using the `delete` tool, what determines which documents are removed?**
The deletion is governed by parsed MongoDB filters. You specify exactly which records you want gone—the system doesn't guess; it removes documents that match your literal MQL query filters.

**Does `list_collections` provide schema information, or just collection names?**
`list_collections` retrieves the name of every managed data set in Atlas. More importantly, it also gives you access to the schema boundaries, letting you audit the structure and organization across your database.

**Can I manage both vector search and standard data in the same conversation?**
Yes. MongoDB Atlas Vector Search is unified. You can use the `search` tool for similarity and the `find` or `insert` tools for standard operational data management using MQL, allowing you to bridge both worlds natively.

**How do I create a new vector search index through the agent?**
Use the `create_index` tool by providing the database, collection, and required dimensions (matching your embedding model). Your agent will provision the index infrastructure on Atlas to enable high-speed vector retrieval.

**Can my agent find specific documents using standard MongoDB query filters?**
Absolutely. Use the `find` tool with a JSON string representing your MQL filter (e.g. `{"status":"active"}`). Your agent will execute the Data API request and return the matching documents and their scalar properties securely.