> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# MongoDB MCP Server Tools

The MongoDB MCP Server allows you to interact with MongoDB clusters using natural language queries from AI clients that support MCP. This page describes the MCP Server tools.

## Overview

The MongoDB MCP Server provides the following tool categories:

- **Atlas tools**, which perform operations on Atlas system resources, like organizations, projects, clusters, database user accounts, and retrieving performance recommendations.

- **Local Atlas deployment tools**, which allow you to list, connect to, create, and delete local Atlas deployments.

- **Database tools**, which perform operations such as inserting, updating, and deleting documents, and running queries and aggregation pipelines.

- **Assistant tools**, which search the MongoDB Assistant knowledge base for official documentation and curated guidance.

Not all **Atlas tools** and **Database tools** are available on both the MongoDB Atlas Managed MCP Server and Local MCP for MongoDB MCP Server. The **Atlas Managed** and **Local** columns in each of these table indicate if an MCP deployment type supports a given tool.

For detailed examples of how the MongoDB MCP Server uses these tools and sample outputs, see [MongoDB MCP Server Usage Examples.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-examples)

## MCP Server Atlas Tools

The Atlas tools are only available if you have set up Atlas API credentials as described in [Get Started with the MongoDB MCP Server.](https://www.mongodb.com/docs/mcp-server/get-started.md#std-label-mcp-get-started)

The following table describes the Atlas tools. The **Atlas Managed** and **Local** columns indicate whether each tool is available on the MongoDB Atlas Managed MCP Server and Local MCP for MongoDB MCP Server, respectively.

| Atlas Tool Name | Description | Atlas Managed | Local |
| --- | --- | --- | --- |
| `atlas-list-orgs` | Returns a list of Atlas organizations. |  | |
| `atlas-list-projects` | Returns a list of Atlas projects. |  | |
| `atlas-create-project` | Creates a new Atlas project. |  | |
| `atlas-list-clusters` | Returns list of Atlas clusters. |  | |
| `atlas-inspect-cluster` | Returns information about a specific Atlas cluster. |  | |
| `atlas-create-free-cluster` | Creates a free Atlas cluster. |  | |
| `atlas-connect-cluster` | Connects to an Atlas cluster using the configured service account. If you configured the MCP server without specifying a connection string, this tool creates a temporary database user with a random password to establish the connection. For details, see [Tool Details.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-tools-considerations) |  | |
| `atlas-get-regions` | Returns the supported Atlas regions for a cloud provider (`AWS`, `AZURE`, or `GCP`), including each region's code and human-readable location. Use this tool to resolve region names or codes before creating or upgrading a cluster. |  | |
| `atlas-upgrade-cluster` | Supports the following Atlas cluster upgrades: Free to Flex; Free to M10; Flex to M10 You can optionally specify the target `region` and `provider`. For a dedicated cluster, you can scale the cluster to a different M10–M80 instance size and update its compute autoscaling settings. Specify at least one of the following options: The new instance size; Whether to enable compute autoscaling; The minimum or maximum instance size for autoscaling Scaling applies to electable and read-only nodes. This tool doesn't scale analytics nodes, multi-shard clusters, or clusters whose regions use different instance sizes. |  | |
| `atlas-create-cluster` | Creates a dedicated Atlas cluster with M10–M80 instance sizes. Supports replica set and single-shard cluster types in one to three regions. `clusterType` defaults to `REPLICASET`. `SHARDED` clusters are single-shard only and require M30 or higher.; `regions` accepts up to three Atlas regions in priority order. The first region has the highest priority and holds the primary node.; `encryptionAtRestProvider` selects a customer-managed key provider for Encryption at Rest. The key provider must already have a valid Encryption at Rest configuration in the project.; Compute autoscaling is enabled by default. Disk autoscaling is always enabled.; The tool returns immediately. Use `atlas-inspect-cluster` to poll until the cluster state reaches `IDLE`. |  | |
| `atlas-pause-resume-cluster` | Pauses or resumes a dedicated (M10+) Atlas cluster. Free and Flex clusters cannot be paused. **Pause**: Makes the cluster unavailable for connections and stops compute costs. The cluster must be in the `IDLE` state.; **Resume**: Restarts a paused cluster. Use `atlas-inspect-cluster` to poll until the cluster state reaches `IDLE`. |  | |
| `atlas-inspect-access-list` | Returns information about the IP (Internet Protocol) and CIDR (Classless Inter-Domain Routing) ranges that can access an Atlas cluster. |  | |
| `atlas-create-access-list` | Configures the IP (Internet Protocol) and CIDR (Classless Inter-Domain Routing) access list for an Atlas cluster. |  | |
| `atlas-list-db-users` | Returns a list of Atlas database users. |  | |
| `atlas-create-db-user` | Creates an Atlas database user. |  | |
| `atlas-list-alerts` | Returns a list of triggered alerts for an Atlas project. These are alerts Atlas has raised, not the alert configurations that define them. Defaults to `OPEN` alerts. You can set the status to `TRACKING` or `CLOSED` to see those respective alerts. |  | |
| `atlas-get-performance-advisor` | Returns [Performance Advisor](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) recommendations for an Atlas cluster. Supports operations for suggested indexes, drop index suggestions, slow query logs, and schema suggestions. Requires [`Project Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only) access or higher. To learn more, see [Performance Advisor Tool.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-pa-tool) |  | |
| `atlas-load-sample-dataset` | Loads a sample dataset into an Atlas cluster. |  | |
| `remote-atlas-connect` | Connects to an Atlas cluster on the Remote MCP Server. |  | |
| `atlas-streams-discover` | Returns information about an Atlas Stream Processing workspace, processor, public connection, or privatelink networking connection. On the Remote MCP Server, the Atlas Stream Processing tools are exposed through the `atlas-streams-*` tools. |  | |
| `atlas-streams-build` | Creates an Atlas Stream Processing workspace, processor, public connection, or privatelink networking connection. |  | |
| `atlas-streams-manage` | Manages an Atlas Stream Processing workspace, processor, or public connection. The MongoDB MCP Server can: Start, stop, or update a processor.; Update a workspace.; Update a public connection.; Accept or reject a privatelink networking connection. |  | |
| `atlas-streams-teardown` | Deletes an Atlas Stream Processing workspace, processor, public connection, or privatelink networking connection. |  | |

## MCP Server Local Atlas Tools

You can use the Local MCP with local Atlas deployments. To do so, you must install Docker. For an introduction to local Atlas deployments, see [Create a Local Atlas Deployment.](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-local/)

The following table describes the local Atlas tools. These tools are only available to the Local MCP for MongoDB MCP Server.

| MCP Server Local Atlas Tool Name | Description |
| --- | --- |
| `atlas-local-list-deployments` | Lists local Atlas deployments. |
| `atlas-local-create-deployment` | Creates a local Atlas deployment. To run this tool, you must disable [read only mode.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/enable-or-disable-features.md#std-label-mcp-server-configuration-read-only-mode) |
| `atlas-local-connect-deployment` | Connects to a local Atlas deployment. |
| `atlas-local-delete-deployment` | Deletes a local Atlas deployment. To run this tool, you must disable [read only mode.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/enable-or-disable-features.md#std-label-mcp-server-configuration-read-only-mode) |

For examples that run the local Atlas tools, see [Local Atlas Deployments.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-examples-local-atlas-deployments)

## MCP Server Database Tools

The following table describes the database tools. The **Atlas Managed** and **Local** columns indicate whether each tool is available on the MongoDB Atlas Managed MCP Server and Local MCP for MongoDB MCP Server, respectively.

| Database Tool Name | Description | Atlas Managed | Local |
| --- | --- | --- | --- |
| `connect` | Connects to a MongoDB cluster. |  | |
| `disconnect` | Closes a MongoDB connection and revokes its connection ID. |  | |
| `list-connections` | Returns a list of the active MongoDB connections and their connection IDs. Use this tool to find the connection ID of an established connection. |  | |
| `find` | Runs a MongoDB database query. |  | |
| `aggregate` | Runs a MongoDB aggregation pipeline. |  | |
| `aggregate-db` | Runs a MongoDB aggregation pipeline at the database level. |  | |
| `count` | Returns the number of documents in a collection. |  | |
| `explain` | Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method. |  | |
| `insert-many` | Adds documents to a collection. |  | |
| `create-index` | Creates an index on a collection. This tool supports creating [vector search indexes](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-vector-search-tools) and [lexical search indexes.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-lexical-search-tools) |  | |
| `drop-index` | Drop an index for the provided database and collection. This tool supports dropping [vector search indexes](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-vector-search-tools) and [lexical search indexes.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-lexical-search-tools) |  | |
| `update-many` | Modifies multiple documents in a collection. |  | |
| `rename-collection` | Changes the name of a collection. |  | |
| `create-collection` | Creates a new collection. |  | |
| `delete-many` | Removes documents from a collection. |  | |
| `drop-collection` | Deletes a collection from a database. |  | |
| `drop-database` | Deletes a database. |  | |
| `list-databases` | Returns a list of all databases available through the current connection. |  | |
| `list-collections` | Returns a list of collections in a database. |  | |
| `collection-indexes` | Returns information about collection indexes, including [vector search indexes](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-vector-search-tools) and [lexical search indexes.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-lexical-search-tools) |  | |
| `collection-schema` | Returns collection [schema](https://www.mongodb.com/docs/manual/core/schema-validation.md#std-label-schema-validation-overview) information. |  | |
| `collection-storage-size` | Returns collection size in megabytes. |  | |
| `db-stats` | Returns database statistics. |  | |
| `export` | Saves the results of a query or aggregation pipeline in JSON format to a file on the computer that runs the MCP Server. The results are also available through the `exported-data` resource in the AI client application. |  | |
| `mongodb-logs` | Returns the most recent logged `mongod` events. |  | |

## MCP Server Assistant Tools

The assistant tools give your AI client access to the MongoDB Assistant knowledge base, which includes official MongoDB documentation, curated expert guidance, and other resources provided by MongoDB. These tools enable your AI client to retrieve accurate, version-specific MongoDB information rather than relying on its training data alone.

The following table describes the assistant tools:

| MCP Server Assistant Tool Name | Description |
| --- | --- |
| `list-knowledge-sources` | Lists available data sources in the MongoDB Assistant knowledge base. Use this to explore available data sources or to find search filter parameters to use in `search-knowledge`. |
| `search-knowledge` | Searches for information in the MongoDB Assistant knowledge base. The knowledge base includes official documentation, curated expert guidance, and other resources provided by MongoDB. Supports filtering by data source and version. |

## Tool Details

For additional information about specific MCP tools, see the following sections.

### Vector Search Support

The MongoDB MCP Server supports [MongoDB Vector Search](https://www.mongodb.com/docs/vector-search.md#std-label-avs-overview). You can create and manage vector search indexes, generate embeddings, and run semantic search queries through natural language prompts. The following table summarizes key features.

| Use Case | Example Prompts | Relevant Tools |
| --- | --- | --- |
| Manage indexes | `Create a vector search index on the sample_db database and products collection``Show me all vector search indexes on the products collection``Drop the vector search index named vector_index` | `create-index``collection-indexes``drop-index`IMPORTANT: To update a vector search index, drop the existing index and create a new one. |
| Insert documents with automatic embeddings | `Insert these documents into the products collection and embed their descriptions` | `insert-many` |
| Vector search queries | `Search for documents semantically similar to this description``Find me related products filtered by price range` | `aggregate` |

Use the following resources to learn more:

- For descriptions of the database tools used for vector search, such as `create-index`, `collection-indexes`, `drop-index`, `insert-many`, and `aggregate`, see the [MCP Server Database Tools](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-database-tools) table.

- For detailed usage examples and sample outputs, see [Vector Search.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-vector-search-examples)

- To configure the MCP Server for vector search, see [voyageApiKey.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/options.md#std-label-mcp-voyage-api-key)

- To learn more about vector search, see [MongoDB Vector Search Overview.](https://www.mongodb.com/docs/vector-search.md#std-label-avs-overview)

### Lexical Search Support

The MongoDB MCP Server supports [MongoDB Search](https://www.mongodb.com/docs/search.md#std-label-atlas-search). You can create and manage lexical search indexes and run full-text search queries through natural language prompts. This includes queries that use the [`$search`](https://www.mongodb.com/docs/search/query/aggregation-stages/search.md#mongodb-pipeline-pipe.-search) aggregation stage to return relevant documents and the [`$searchMeta`](https://www.mongodb.com/docs/search/query/aggregation-stages/searchMeta.md#mongodb-pipeline-pipe.-searchMeta) aggregation stage to return metadata about the results, such as a count of the relevant documents. The following table summarizes key features.

| Use Case | Example Prompts | Relevant Tools |
| --- | --- | --- |
| Manage indexes | `Create a lexical search index on the sample_db database and products collection for the description field``Show me all lexical search indexes on the products collection``Drop the lexical search index named search_index` | `create-index``collection-indexes``drop-index`IMPORTANT: To update a lexical search index, drop the existing index and create a new one. |
| Lexical search queries | `Find products most relevant to "wireless headphones"``Which documents mention "bluetooth"? Include documents where "bluetooth" may be misspelled``Find products that use "wireless" in the description, and treat "bluetooth" as a synonym to "wireless"` | `aggregate` |

Use the following resources to learn more:

- For descriptions of the database tools used for lexical search, such as `create-index`, `collection-indexes`, `drop-index`, and `aggregate`, see the [MCP Server Database Tools](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-database-tools) table.

- For detailed usage examples and sample outputs, see [Lexical Search.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-lexical-search-examples)

- To learn more about how MongoDB performs lexical searches, see [MongoDB Search Overview.](https://www.mongodb.com/docs/search.md#std-label-atlas-search)

### Atlas Stream Processing Support

You can use the MongoDB MCP Server to interact with your Atlas Stream Processing resources. Atlas Stream Processing enables you to continuously read, write, and transform streams of data using the same aggregation operations used by Atlas databases. You incur charges for all running processors.

The Atlas Stream Processing tools (`atlas-streams-discover`, `atlas-streams-build`, `atlas-streams-manage`, and `atlas-streams-teardown`) are available on both the Local and Atlas Managed MCP Servers. For tool descriptions, see the [MCP Server Atlas Tools](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-atlas-tools) table.

For more information, see [Atlas Stream Processing.](https://www.mongodb.com/docs/atlas/atlas-stream-processing.md#std-label-atlas-sp)

### Generate Embeddings Automatically

The MongoDB MCP Server supports two independent mechanisms for generating vector embeddings:

- **MCP Server embedding generation**: The MCP Server generates embeddings client-side using Voyage AI before sending documents to MongoDB. This requires a [Voyage AI API key.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/options.md#std-label-mcp-voyage-api-key)

- **MongoDB automated embedding**: MongoDB automatically generates embeddings server-side when documents are inserted or updated. To learn more, see [MongoDB Automated Embedding.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-autoembed)

These mechanisms work independently and can be used together or separately depending on your use case.

MCP Server embedding generation requires a [Voyage AI API key](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/options.md#std-label-mcp-voyage-api-key) configured on the local MCP Server and is therefore available only on the local MCP Server. MongoDB automated embedding generates embeddings within MongoDB and does not depend on MCP Server configuration.

#### MCP Server Embedding Generation

If you configure the MCP Server with a [Voyage AI API key](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/options.md#std-label-mcp-voyage-api-key), the server can automatically generate embeddings in the following ways:

- **Generate embeddings for documents**: Embeds text fields in documents when using the `insert-many` tool.

- **Generates embeddings for queries**: Embeds the search query when running vector search queries with the `aggregate` tool. Specifically, the server generates embeddings for the `queryVector` parameter in [`$vectorSearch`](https://www.mongodb.com/docs/vector-search/query/aggregation-stages/vector-search-stage.md#mongodb-pipeline-pipe.-vectorSearch) aggregation queries.

The MCP Server supports the following Voyage AI embedding models:

- `voyage-3-large`

- `voyage-3.5`

- `voyage-3.5-lite`

- `voyage-code-3`

To learn more about Voyage AI models, see the [Voyage AI documentation.](https://docs.voyageai.com/docs/embeddings)

**Note:**

By default, the MongoDB MCP Server validates that fields with vector search indexes contain valid vector embeddings to prevent breaking vector search indexes. To disable this behavior, set the `disableEmbeddingsValidation` option to `true`. To learn more, see [voyageApiKey.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/options.md#std-label-mcp-voyage-api-key)

#### MongoDB Automated Embedding

**Important:**

Automated embedding in vector search indexes is available as a [preview feature](https://www.mongodb.com/docs/preview-features/) only for MongoDB Community Edition v8.2 and later. The feature and the corresponding documentation might change at anytime during the Preview period.

MongoDB can also automatically generate embeddings server-side when documents are inserted or updated. This approach does not require a Voyage AI API key in your MCP configuration because embedding generation happens within MongoDB.

The MongoDB MCP Server supports managing vector search indexes with automated embedding, which automatically generate embeddings for your documents. You can create, drop, and inspect vector search indexes with automated embedding through natural language prompts. The following table summarizes key features.

To learn more, see [Automated Embedding.](https://dochub.mongodb.org/core/auto-embedding-in-community)

| Use Case | Relevant Tools | Example Prompts |
| --- | --- | --- |
| Manage indexes | `create-index``collection-indexes``drop-index` | "Create an auto embed vector search index on 'plot' field in 'mflix.movies' namespace using voyage-4-large model." |
| Insert data with embeddings | `insert-many` | "Insert these documents with the following fields and automatically generate embeddings..." |
| Query with embeddings | `aggregate` | "Run a vector search query on mflix.movies with the auto embed index on the 'plot' field." |

#### Considerations

The MongoDB MCP Server supports pre-filtering vector search queries. To learn more, see [Pre-Filter.](https://www.mongodb.com/docs/search/query/operators-collectors/vectorSearch.md#std-label-fts-vectorSearch-pre-filter)

The MCP server does not support the `quantization` field for vector search indexes.

### Performance Advisor Tool

The `atlas-get-performance-advisor` tool allows you to access [Performance Advisor](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) recommendations through natural language queries. This tool helps you identify performance optimization opportunities by analyzing slow queries and suggesting improvements.

When performing slow query analysis, the MongoDB MCP Server retrieves a sample of slow queries, capped at 50 queries. The sample includes up to 50 most recent slow queries that match any specified conditions in your prompt to ensure optimal performance and response times.

**Note:**

This tool requires [`Project Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only) access or higher and an M10+ cluster.

[`Project Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only) refers to the Atlas Project-level role assigned to your service account, not a database role.

| Use Case | Example Prompts | Performance Advisor Operation |
| --- | --- | --- |
| Analyze Slow Queries | `Show me my slow queries``What is slowing down my cluster?``Show me queries that are longer than 5 seconds``Show me slow writes in the website.users namespace` | [slowQueryLogs](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupprocessperformanceadvisorslowquerylogs) |
| Index Suggestions | `Are there any indexes I should create to improve performance?``What indexes do you recommend I drop?` | [suggestedIndexes](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterperformanceadvisorsuggestedindexes) [dropIndexSuggestions](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterperformanceadvisordropindexsuggestions) |
| Schema Advice | `Show schema recommendations for my cluster``Help me optimize my database schema` | [schemaAdvice](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterperformanceadvisorschemaadvice) |

For detailed usage examples and sample outputs, see [Performance Optimization.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-performance-examples)

### Connecting without Atlas Connection String

This section describes the local MCP Server `atlas-connect-cluster` flow. If you configure the local MCP Server without specifying a connection string to an Atlas cluster, the `atlas-connect-cluster` tool uses the configured Atlas API service account credentials to create a temporary [database user](https://www.mongodb.com/docs/atlas/security-add-mongodb-users.md#std-label-mongodb-users) and establish a connection to the cluster.

The Remote MCP Server uses a different tool, `remote-atlas-connect`, which follows its own connection and session model and returns a connection handle for subsequent database operations.

The temporary database user has the following characteristics:

- Randomly generated username and password.

- By default, expires after 4 hours.

- Role assigned based on how you configured the MCP Server:

  - [`readAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-atlasrole-readAnyDatabase) if you enabled [read-only mode](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration/enable-or-disable-features.md#std-label-mcp-server-configuration-read-only-mode) or disabled the `create`, `delete`, and `update` tool categories.

  - [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-atlasrole-readWriteAnyDatabase) if the server has full permissions.

**Note:**

The MongoDB MCP Server stores user credentials in memory only and never returns or exposes the credentials in the LLM context.

## Learn More

To disable specific tools and restrict the MCP Server to read-only mode, see [Local MCP Server Configuration.](https://www.mongodb.com/docs/mcp-server/local-mcp/configuration.md#std-label-mcp-server-configuration)

To see some MCP Server example natural language prompts, see [MongoDB MCP Server Usage Examples.](https://www.mongodb.com/docs/mcp-server/examples.md#std-label-mcp-server-examples)
