---
canonical_url: "https://docs.composio.dev/toolkits/mongodb_mcp"
markdown_url: "https://docs.composio.dev/toolkits/mongodb_mcp.md"
product: "platform"
version: null
last_updated: null
---

# MongoDB MCP

MongoDB MCP lets authorized agents explore and manage MongoDB Atlas resources, databases, collections, documents, indexes, performance data, and MongoDB knowledge sources.

- **Category:** model context protocol
- **Auth:** S2S_OAUTH2
- **Composio-managed OAuth available?** No
- **Tools:** 41
- **Triggers:** 0
- **Slug:** `MONGODB_MCP`
- **Version:** 00000000_00

## Tools

### Aggregate

**Slug:** `MONGODB_MCP_AGGREGATE`

Run an aggregation against a MongoDB collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `pipeline` | array | Yes | An array of aggregation stages to execute.  If the user has asked for a vector search, `$vectorSearch` **MUST** be the first stage of the pipeline (or the first stage of a `$unionWith` sub-pipeline only when explicitly combining unrelated result sets — for hybrid full-text + vector search, use `$rankFusion` or `$scoreFusion` instead, see below).  If the user has asked for lexical/Atlas search, use `$search` instead of `$text`. ### Usage Rules for `$vectorSearch` - **Index Type Detection:**   Use the collection-indexes tool to determine if the target field has a classic vector index (type: 'vector') or an auto-embed index (type: 'autoEmbed'). - **Classic Vector Search (type: 'vector'):**   Use 'queryVector' with embeddings as an array of numbers. - **Auto-Embed Vector Search (type: 'autoEmbed'):**   Use 'query' - MongoDB automatically generates embeddings at query time. Do NOT use 'queryVector' or 'embeddingParameters' for auto-embed indexes. - **Unset embeddings:**   Unless the user explicitly requests the embeddings, add an `$unset` stage **at the end of the pipeline** to remove the embedding field and avoid context limits. **The $unset stage in this situation is mandatory**. - **Pre-filtering:**   If the user requests additional filtering, include filters in `$vectorSearch.filter` only for pre-filter fields in the vector index.   NEVER include fields in $vectorSearch.filter that are not part of the vector index. - **Post-filtering:**   For all remaining filters, add a $match stage after $vectorSearch. - If unsure which fields are filterable, use the collection-indexes tool to determine valid prefilter fields. - If no requested filters are valid prefilters, omit the filter key from $vectorSearch.  ### Usage Rules for `$search` - Include the index name, unless you know for a fact there's a default index. If unsure, use the collection-indexes tool to determine the index name. - The `$search` stage supports multiple operators, such as 'autocomplete', 'text', 'geoWithin', and others. Choose the appropriate operator based on the user's query. If unsure of the exact syntax, consult the MongoDB Atlas Search documentation, which can be found here: https://www.mongodb.com/docs/atlas/atlas-search/operators-and-collectors/  ### Usage Rules for `$rankFusion` and `$scoreFusion` (Hybrid Search) Use these stages when the user wants to combine full-text (`$search`) and vector (`$vectorSearch`) retrieval into a single fused result set. **Prefer native fusion over a `$unionWith` + `$group` workaround** — the workaround averages incompatible score scales and produces wrong rankings.  **Which stage to use:** - `$rankFusion` (MongoDB 8.0+) — Reciprocal Rank Fusion. The recommended default.   Normalizes scores across incompatible scales automatically. No score tuning needed. - `$scoreFusion` (MongoDB 8.2+) — Score-based fusion. Use when the user needs explicit   per-pipeline weights, score normalisation (sigmoid / minMaxScaler), or a custom   combination expression.  **Construction rules:** - `$rankFusion` / `$scoreFusion` MUST be the first stage of the top-level pipeline. - Sub-pipelines go inside `input.pipelines` as a named map (not an array). Each name   must be non-empty, must not start with `$`, and must not contain `.` or null bytes. - Allowed stages inside sub-pipelines: `$search`, `$vectorSearch`, `$match`, `$sort`,   `$geoNear`, `$skip`, `$limit`. `$project` and `$unset` are NOT allowed inside sub-pipelines. - Do field shaping (`$project` / `$unset`) only AFTER the fusion stage, at the root. - Both a vectorSearch (or autoEmbed) index AND a search (lexical) index must exist on   the collection. Use the collection-indexes tool to confirm both before running a hybrid query. - Add a `$limit` stage after the fusion stage to cap the final result set. - Add `$unset` at the end to remove embedding fields and avoid context bloat.  ### Usage Rules for `$rerank` (Native Reranking) Use this stage when the user wants to reorder a set of candidate documents using a cross-encoder reranker model.  **Construction rules:** - `$rerank` can be any stage in the pipeline on an Atlas cluster running MongoDB 8.3 or higher. - It is recommended to use `$rerank` after a sorted pipeline, e.g. `$search`, `$vectorSearch`, `$rankFusion`, `$scoreFusion`, or [`$match`, `$sort`]. - $rerank must be enabled via the Native Reranking Project Setting - Set `numDocsToRerank` as the number of documents passed into `$rerank`. This will also limit the number of documents returned by `$rerank` - Set `path` as a field name or an array of field names that exist in all documents. Use `$match` or `$set` before `$rerank` to validate no fields are missing. - Add `$addFields` after `$rerank` to retrieve the reranker score.  **`$rerank` example (recommended default):** ```javascript [   {     $match: {       description: { $exists: true },       name: { $exists: true }     }   },   {     $sort: {       lastUpdated: -1     }   },   {     $rerank: {       query: {         text: "query text including instructions"       },       model: "rerank-2.5",       numDocsToRerank: 100,       path: ["description", "name"]     }   },   {     $addFields: {       rerankScore: { $meta: "score" }     }   } ] ```  |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |
| `responseBytesLimit` | number | No | The maximum number of bytes to return in the response. This value is capped by the server's configured maximum and cannot be exceeded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `count` | string | Yes | The total number of documents returned by the aggregation pipeline |
| `documents` | array | Yes | The documents returned by the aggregation pipeline |
| `appliedLimits` | array | Yes | The limits applied to the aggregation pipeline |

### Aggregate-db

**Slug:** `MONGODB_MCP_AGGREGATE_DB`

Run an aggregation against a MongoDB database

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `pipeline` | array | Yes | An array of aggregation stages to execute. The first stage must be a database-level aggregation stage (one of `$changeStream`, `$currentOp`, `$documents`, `$listLocalSessions`, `$queryStats`). https://www.mongodb.com/docs/manual/reference/mql/aggregation-stages/#db.aggregate---stages |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |
| `responseBytesLimit` | number | No | The maximum number of bytes to return in the response. This value is capped by the server's configured maximum and cannot be exceeded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `documents` | array | Yes | The documents returned by the aggregation pipeline |
| `appliedLimits` | array | Yes | The limits applied to the aggregation pipeline |
| `aggResultsCount` | number | No | The total number of documents returned by the aggregation pipeline |

### Atlas-create-access-list

**Slug:** `MONGODB_MCP_ATLAS_CREATE_ACCESS_LIST`

Allow Ip/CIDR ranges to access your MongoDB Atlas clusters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `comment` | string | No | Comment for the access list entries |
| `projectId` | string | Yes | Atlas project ID |
| `cidrBlocks` | array | No | CIDR blocks to allow access from |
| `ipAddresses` | array | No | IP addresses to allow access from |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes |  |

### Atlas-create-cluster

**Slug:** `MONGODB_MCP_ATLAS_CREATE_CLUSTER`

Create a MongoDB Atlas cluster (M10–M80, replica set or single shard, single or multi-region). Compute autoscaling is enabled by default: min instance size is set to the selected instance size, max is set two tiers above. Disk autoscaling is always enabled. For encryption at rest, the CMK provider must already have a valid configuration in the Atlas project. The tool returns immediately, use the atlas-inspect-cluster tool to poll the cluster state for readiness (state: IDLE). Connection strings are unavailable until the cluster reaches IDLE state. Note to LLM: Omit instance size unless specified by the user. If provider and regions are not already known, ask for both together in a single question before calling this tool. Common, non-exhaustive region default mappings by provider:
AWS: "East Coast"/"Virginia"/"US East" → US_EAST_1, "Ohio" → US_EAST_2, "California"/"West Coast" → US_WEST_2, "Southeast Asia"/"APAC"/"Singapore" → AP_SOUTHEAST_1, "Europe"/"EU"/"Ireland" → EU_WEST_1.
GCP: "Central US" → CENTRAL_US, "Western US" → WESTERN_US, "Southeast Asia"/"APAC" → SOUTHEASTERN_ASIA_PACIFIC, "Europe"/"EU" → WESTERN_EUROPE.
AZURE: "East US" → US_EAST_2, "West US" → US_WEST_2, "Europe North" → EUROPE_NORTH, "Europe West" → EUROPE_WEST.
Default recommendation: AWS US_EAST_1.
User-specified regions not present in the mapping MUST be respected, rely on the tool to surface errors if a region is not supported.


#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `backup` | string ("OFF" | "SNAPSHOT" | "CONTINUOUS") | No | `OFF`: no backups. `SNAPSHOT`: cloud backup snapshots, recommended for most workloads. `CONTINUOUS`: point-in-time restore, required for RPO-sensitive production workloads. Defaults to `SNAPSHOT`. |
| `regions` | array | Yes | Cloud provider regions in Atlas format using uppercase letters and underscores (e.g. US_EAST_1). The first region has the highest priority. Do not include duplicate regions. |
| `provider` | string ("AWS" | "GCP" | "AZURE") | Yes | Cloud provider for the cluster. |
| `projectId` | string | Yes | Atlas project ID to create the cluster in. Use the atlas-list-projects to find project IDs if not provided. |
| `diskSizeGB` | number | No | Initial disk size in GB. Disk autoscaling is always enabled regardless of this value. Omit unless explicitly specified by the user. |
| `clusterName` | string | Yes | Name of the cluster. |
| `clusterType` | string ("REPLICASET" | "SHARDED") | No | Cluster topology. Use `SHARDED` for single-shard clusters, requires M30 or higher. Defaults to `REPLICASET`. |
| `instanceSize` | string ("M10" | "M20" | "M30" | "M40" | "M50" | "M60" | "M80") | No | Instance size. NVME and high-memory instances are not supported. Minimum M30 when clusterType is SHARDED. Defaults to M10 for projects with fewer than 2 existing clusters, M30 otherwise. Omit unless explicitly specified by the user. |
| `mongoDBVersion` | string ("7.0" | "8.0" | "LATEST") | No | MongoDB version to deploy. Use a pinned version for production environments where version stability is required. Defaults to `LATEST`. |
| `computeAutoScaling` | boolean | No | When true, enables compute autoscaling. Min instance size is set to the selected instance size, max is set two tiers above. Omit unless explicitly specified by the user. |
| `encryptionAtRestProvider` | string ("AWS" | "AZURE" | "GCP" | "NONE") | No | Customer-managed key provider for encryption at rest. Defaults to the cluster's provider if a valid configuration exists. Use `NONE` to explicitly disable the feature. Omit unless explicitly specified by the user. |
| `terminationProtectionEnabled` | boolean | No | When true, prevents the cluster from being deleted until protection is explicitly disabled. Recommended for production clusters. Defaults to false. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `backup` | string ("OFF" | "SNAPSHOT" | "CONTINUOUS") | Yes |  |
| `regions` | array | Yes |  |
| `provider` | string ("AWS" | "GCP" | "AZURE") | Yes |  |
| `clusterId` | string | No |  |
| `diskSizeGB` | number | No |  |
| `clusterType` | string ("REPLICASET" | "SHARDED") | Yes |  |
| `instanceSize` | string ("M10" | "M20" | "M30" | "M40" | "M50" | "M60" | "M80") | Yes |  |
| `mongoDBVersion` | string ("7.0" | "8.0" | "LATEST") | Yes |  |
| `computeAutoScaling` | boolean | Yes |  |
| `encryptionAtRestProvider` | string ("AWS" | "AZURE" | "GCP" | "NONE") | Yes |  |
| `terminationProtectionEnabled` | boolean | Yes |  |

### Atlas-create-db-user

**Slug:** `MONGODB_MCP_ATLAS_CREATE_DB_USER`

Create an MongoDB Atlas database user

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `roles` | array | Yes | Roles for the new user |
| `clusters` | array | No | Clusters to assign the user to, leave empty for access to all clusters |
| `password` | string | No | Password for the new user. IMPORTANT: If the user hasn't supplied an explicit password, leave it unset and under no circumstances try to generate a random one. A secure password will be generated by the MCP server if necessary. |
| `username` | string | Yes | Username for the new user |
| `projectId` | string | Yes | Atlas project ID |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `password` | string | No |  |
| `username` | string | Yes |  |

### Atlas-create-free-cluster

**Slug:** `MONGODB_MCP_ATLAS_CREATE_FREE_CLUSTER`

Create a free MongoDB Atlas cluster

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Name of the cluster |
| `region` | string | No | Region of the cluster |
| `projectId` | string | Yes | Atlas project ID to create the cluster in |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `created` | boolean | Yes | Whether the cluster was created successfully |

### Atlas-create-project

**Slug:** `MONGODB_MCP_ATLAS_CREATE_PROJECT`

Create a MongoDB Atlas project

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `orgId` | string | Yes | Organization ID that will own the new project |
| `projectName` | string | Yes | Name for the new project |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `orgId` | string | Yes |  |
| `projectName` | string | Yes |  |

### Atlas-get-performance-advisor

**Slug:** `MONGODB_MCP_ATLAS_GET_PERFORMANCE_ADVISOR`

Get MongoDB Atlas performance advisor recommendations and suggestions, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max 50) slow query logs

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `since` | string | No | Date to get slow query logs since. Must be a string in ISO 8601 format. Only relevant for the slowQueryLogs operation. |
| `projectId` | string | Yes | Atlas project ID to get performance advisor recommendations. The project ID is a hexadecimal identifier of 24 characters. If the user has only specified the name, use the `atlas-list-projects` tool to retrieve the user's projects with their ids. |
| `namespaces` | array | No | Namespaces to get slow query logs. Only relevant for the slowQueryLogs operation. |
| `operations` | array | No | Operations to get performance advisor recommendations |
| `clusterName` | string | Yes | Atlas cluster name to get performance advisor recommendations |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes |  |
| `clusterName` | string | Yes |  |
| `slowQueryLogs` | array | No |  |
| `suggestedIndexes` | array | No |  |
| `schemaSuggestions` | array | No |  |
| `dropIndexSuggestions` | object | No |  |

### Atlas-inspect-access-list

**Slug:** `MONGODB_MCP_ATLAS_INSPECT_ACCESS_LIST`

Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes | Atlas project ID |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `entries` | array | Yes |  |
| `projectId` | string | Yes |  |
| `totalCount` | number | Yes |  |

### Atlas-inspect-cluster

**Slug:** `MONGODB_MCP_ATLAS_INSPECT_CLUSTER`

Inspect metadata of a MongoDB Atlas cluster

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes | Atlas project ID |
| `clusterName` | string | Yes | Atlas cluster name |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes |  |
| `state` | string | Yes |  |
| `paused` | boolean | Yes |  |
| `region` | string | No |  |
| `provider` | string | No |  |
| `instanceSize` | string | Yes |  |
| `instanceType` | string ("FREE" | "DEDICATED" | "FLEX") | Yes |  |
| `mongoDBVersion` | string | Yes |  |
| `connectionStrings` | object | Yes |  |

### Atlas-list-alerts

**Slug:** `MONGODB_MCP_ATLAS_LIST_ALERTS`

List triggered alerts for a MongoDB Atlas project. These are alerts Atlas has raised, not the alert configurations that define them. Defaults to OPEN alerts; set status to TRACKING or CLOSED to see others.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Max results per page. |
| `status` | string ("OPEN" | "TRACKING" | "CLOSED") | No | Status of the alerts to return. Defaults to OPEN. TRACKING means the alert condition exists but hasn't persisted beyond the notification delay. OPEN means the alert condition currently exists. CLOSED means the alert has been resolved. |
| `pageNum` | integer | No | Page number. |
| `projectId` | string | Yes | Atlas project ID to list alerts for |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `alerts` | array | Yes |  |
| `status` | string ("OPEN" | "TRACKING" | "CLOSED") | Yes |  |
| `projectId` | string | Yes |  |
| `totalCount` | number | No |  |

### Atlas-list-clusters

**Slug:** `MONGODB_MCP_ATLAS_LIST_CLUSTERS`

List MongoDB Atlas clusters

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | No | Atlas project ID to filter clusters |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `clusters` | array | Yes |  |
| `projectId` | string | No |  |
| `totalCount` | number | Yes |  |
| `projectName` | string | No |  |

### Atlas-list-db-users

**Slug:** `MONGODB_MCP_ATLAS_LIST_DB_USERS`

List MongoDB Atlas database users

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes | Atlas project ID to filter DB users |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `users` | array | Yes |  |
| `projectId` | string | Yes |  |
| `totalCount` | number | Yes |  |

### Atlas-list-orgs

**Slug:** `MONGODB_MCP_ATLAS_LIST_ORGS`

List MongoDB Atlas organizations

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Max number of organizations to return per page. |
| `pageNum` | integer | No | Page number of organizations to return. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `totalCount` | number | Yes |  |
| `organizations` | array | Yes |  |

### Atlas-list-projects

**Slug:** `MONGODB_MCP_ATLAS_LIST_PROJECTS`

List MongoDB Atlas projects.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Max number of projects to return per page. |
| `orgId` | string | No | Atlas organization ID to filter projects. If not provided, projects for all orgs are returned. |
| `pageNum` | integer | No | Page number of projects to return. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `orgId` | string | No |  |
| `projects` | array | Yes |  |
| `totalCount` | number | Yes |  |

### Atlas-load-sample-dataset

**Slug:** `MONGODB_MCP_ATLAS_LOAD_SAMPLE_DATASET`

Load a MongoDB sample dataset into an Atlas cluster, or check the status of a previously-initiated load. To start a new load, provide `clusterName` — the load runs asynchronously and the response includes a `jobId` and initial state. To check progress, call this tool again with `jobId` (sample dataset loads typically take 1–5 minutes). State can be WORKING, COMPLETED, or FAILED.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `jobId` | string | No | Job id returned by a previous load request. Provide this to check the status of an in-progress load. Mutually exclusive with clusterName. |
| `projectId` | string | Yes | Atlas project ID that owns the cluster |
| `clusterName` | string | No | Cluster name to load the sample dataset into. Provide this to initiate a new load. Mutually exclusive with jobId. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `jobId` | string | Yes | Unique identifier for the sample dataset load job |
| `state` | string ("WORKING" | "FAILED" | "COMPLETED") | Yes | Current state of the load job |
| `createDate` | string | Yes | ISO 8601 timestamp (UTC) when the load was initiated |
| `clusterName` | string | Yes | Name of the cluster the sample dataset is being loaded into |
| `completeDate` | string | No | ISO 8601 timestamp (UTC) when the load completed (only set when state is COMPLETED or FAILED) |
| `errorMessage` | string | No | Failure reason (only set when state is FAILED) |

### Atlas-pause-resume-cluster

**Slug:** `MONGODB_MCP_ATLAS_PAUSE_RESUME_CLUSTER`

Pause or resume a dedicated (M10+) MongoDB Atlas cluster (Free and Flex clusters cannot be paused). Pause: paused clusters are unavailable for connections and do not incur compute costs. If the cluster being paused is the current active connection, it will be automatically disconnected. Returns an error if the cluster is already paused or not in a pausable state (must be IDLE). Resume: the cluster will not be immediately available after resuming. Use the atlas-inspect-cluster tool to poll the cluster state for readiness (state: IDLE). If the cluster is not paused, resuming it is a no-op.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `action` | string ("PAUSE" | "RESUME") | Yes | Action to perform on the cluster. |
| `projectId` | string | Yes | Atlas project ID the cluster belongs to. |
| `clusterName` | string | Yes | Name of the cluster to pause or resume. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `action` | string ("PAUSE" | "RESUME") | Yes |  |
| `clusterId` | string | No |  |
| `clusterName` | string | Yes |  |
| `disconnectedConnectionIds` | array | Yes | Connection IDs that were disconnected due to the cluster being paused. |

### Atlas-streams-build

**Slug:** `MONGODB_MCP_ATLAS_STREAMS_BUILD`

Create Atlas Stream Processing resources. Use this tool for 'set up a Kafka pipeline', 'create a workspace', 'add a connection', or 'deploy a processor'. Use resource='workspace' to create a new workspace (specify cloud provider, region, and tier). Use resource='connection' to add a data source or sink to an existing workspace. Use resource='processor' to deploy a stream processor with a pipeline. Use resource='privatelink' to set up private networking. Typical workflow: create workspace → add connections → deploy processor.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dlq` | object | No | Dead letter queue configuration. Only for resource='processor'. Only include when the user explicitly requests a DLQ, or when the pipeline uses $https with default onError='dlq'. The DLQ connection must already exist in the workspace. |
| `tier` | string ("SP2" | "SP5" | "SP10" | "SP30" | "SP50") | No | Processing tier. Default: SP10. Only for resource='workspace'. |
| `region` | string | No | Cloud region. Required when resource='workspace'. Use Atlas region names: AWS examples: 'VIRGINIA_USA', 'OREGON_USA', 'DUBLIN_IRL'. Azure examples: 'eastus2', 'westeurope'. GCP examples: 'US_CENTRAL1', 'EUROPE_WEST1'. |
| `pipeline` | array | No | Pipeline stages for the stream processor. Required when resource='processor'. Must start with a $source stage and end with a terminal stage ($merge, $emit, $https, or $externalFunction). Use $merge to write to Atlas cluster collections: {$merge: {into: {connectionName, db, coll}}}. Use $emit to write to Kafka or Kinesis sinks: {$emit: {connectionName, topic}}. $emit only works with Kafka/Kinesis connections — do NOT use $emit with Https connections. Use $https to POST data to an Https connection: {$https: {connectionName}}. Use $externalFunction for Lambda: {$externalFunction: {connectionName, functionName, execution: 'async', as: 'result'}}. Lambda does NOT use $emit — use $externalFunction with execution='async' as a terminal stage or execution='sync' for mid-pipeline enrichment. By default $https.onError is 'dlq', which requires a DLQ (see dlq parameter). Set {$https: {connectionName, onError: 'ignore'}} to skip DLQ. For Kafka $emit with Schema Registry: {$emit: {connectionName, topic, schemaRegistry: {connectionName: '<sr-connection>', valueSchema: {type: 'avro', schema: {<avro-schema>}, options: {subjectNameStrategy: 'TopicNameStrategy', autoRegisterSchemas: true}}}}}. Note: valueSchema.type must be lowercase 'avro'. valueSchema.schema (Avro schema definition) is always required even with autoRegisterSchemas. Kafka/Kinesis $source must include a 'topic'/'stream' field. $$NOW, $$ROOT, and $$CURRENT are not available in streaming context. Connections referenced in $source/$merge/$emit/$https must already exist in the workspace. |
| `resource` | string ("workspace" | "connection" | "processor" | "privatelink") | Yes | What to create. Start with 'workspace', then 'connection', then 'processor'. Use 'privatelink' only if connections need private networking. |
| `autoStart` | boolean | No | Start the processor immediately after creation. Default: false. Only for resource='processor'. Omit unless the user explicitly asks to start the processor right away. |
| `projectId` | string | Yes | Atlas project ID. Use atlas-list-projects to find project IDs if not available. |
| `cloudProvider` | string ("AWS" | "AZURE" | "GCP") | No | Cloud provider. Required when resource='workspace'. |
| `processorName` | string | No | Processor name. Required when resource='processor'. |
| `workspaceName` | string | No | Workspace name. Required for workspace, connection, and processor resources. Not required for privatelink (which is project-level). For 'workspace': the name to create. For others: the existing workspace to add to. Use `atlas-streams-discover` with action 'list-workspaces' to see existing workspaces. |
| `connectionName` | string | No | Connection name. Required when resource='connection'. |
| `connectionType` | string ("Kafka" | "Cluster" | "S3" | "Https" | "AWSKinesisDataStreams" | "AWSLambda" | "SchemaRegistry" | "Sample") | No | Connection type. Required when resource='connection'. Kafka: needs bootstrapServers, authentication, security config. Cluster: needs clusterName and dbRoleToExecute. S3: needs aws.roleArn (must be registered via Atlas Cloud Provider Access). Https: needs url. AWSKinesisDataStreams: needs aws.roleArn (must be registered via Atlas Cloud Provider Access). AWSLambda: needs aws.roleArn (must be registered via Atlas Cloud Provider Access). SchemaRegistry: needs provider, schemaRegistryUrls, and authentication config. Sample: provides sample data for testing (no config needed). |
| `connectionConfig` | object | No | Type-specific connection configuration. Only for resource='connection'. Omit entirely for connectionType='Sample' (no config needed). You may pass a partial config — the tool uses elicitation to collect missing required fields directly from the user. |
| `includeSampleData` | boolean | No | Include the sample_stream_solar connection for testing. Default: true. Only for resource='workspace'. |
| `privateLinkConfig` | object | No | PrivateLink configuration including provider and provider-specific fields. Required when resource='privatelink'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource` | string ("workspace" | "connection" | "processor" | "privatelink") | Yes | Which build step completed |

### Atlas-streams-discover

**Slug:** `MONGODB_MCP_ATLAS_STREAMS_DISCOVER`

Discover and inspect Atlas Stream Processing resources. Also use for 'why is my processor failing', 'what workspaces do I have', 'show processor stats', or 'check processor health'. Use 'list-workspaces' to see all workspaces in a project. Use inspect actions for details on a specific resource. Use 'diagnose-processor' for a combined health report including state, stats, connection health, and recent errors. Use 'get-networking' for PrivateLink and account details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Max results per page for list actions. Default: 20. |
| `action` | string ("list-workspaces" | "inspect-workspace" | "list-connections" | "inspect-connection" | "list-processors" | "inspect-processor" | "diagnose-processor" | "get-networking") | Yes | What to look up. Start with 'list-workspaces' to see available workspaces, then use inspect actions for details or 'diagnose-processor' for a health report. |
| `region` | string | No | Cloud region. Only for 'get-networking': returns account details for the specified region. |
| `pageNum` | integer | No | Page number for list actions. Default: 1. |
| `projectId` | string | Yes | Atlas project ID. Use atlas-list-projects to find project IDs if not available. |
| `resourceName` | string | No | Connection or processor name. Required for 'inspect-connection', 'inspect-processor', and 'diagnose-processor'. |
| `cloudProvider` | string | No | Cloud provider (AWS, AZURE, GCP). Only for 'get-networking': returns account details for the specified provider. |
| `workspaceName` | string | No | Workspace name. Required for all actions except 'list-workspaces' and 'get-networking'. |
| `responseFormat` | string ("concise" | "detailed") | No | Response detail level. 'concise' returns names and states only. 'detailed' returns full configuration and stats. Default: 'concise' for list actions, 'detailed' for inspect/diagnose. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dlq` | object | No |  |
| `tier` | string | No |  |
| `stats` | object | No |  |
| `pipeline` | array | No |  |
| `workspace` | object | No |  |
| `connection` | object | No |  |
| `processors` | array | No |  |
| `workspaces` | array | No |  |
| `connections` | array | No |  |
| `privateLinks` | array | No |  |
| `accountDetails` | object | No |  |
| `processorState` | string ("STARTED" | "STOPPED" | "CREATED" | "FAILED") | No |  |
| `connectionHealth` | array | No |  |

### Atlas-streams-manage

**Slug:** `MONGODB_MCP_ATLAS_STREAMS_MANAGE`

Manage Atlas Stream Processing resources: start/stop processors, modify pipelines, update configurations. Also use for 'change the pipeline', 'scale up my processor', or 'update my workspace tier'. Common workflow: action='stop-processor' → action='modify-processor' → action='start-processor'. Use `atlas-streams-discover` with action 'inspect-processor' to check state before managing.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dlq` | object | No | New DLQ configuration. Only for 'modify-processor'. |
| `tier` | string ("SP2" | "SP5" | "SP10" | "SP30" | "SP50") | No | Override processing tier for this run. Must not exceed the workspace's max tier. Use `atlas-streams-discover` action='inspect-workspace' to check. Only for 'start-processor'. |
| `action` | string ("start-processor" | "stop-processor" | "modify-processor" | "update-workspace" | "update-connection" | "accept-peering" | "reject-peering") | Yes | Action to perform. One of: 'start-processor' — begin or resume processing (requires resourceName). 'stop-processor' — pause processing (requires resourceName). 'modify-processor' — change pipeline, DLQ, or rename (requires resourceName and at least one of: pipeline, dlq, newName; processor must be stopped first). 'update-workspace' — change workspace tier or region. 'update-connection' — update connection config (requires resourceName). 'accept-peering' — accept a VPC peering request (requires peeringId, requesterAccountId, requesterVpcId). 'reject-peering' — reject a VPC peering request (requires peeringId). For peering actions, workspaceName can be any workspace in the project (peering is project-level). |
| `newName` | string | No | Rename processor. Only for 'modify-processor'. |
| `newTier` | string ("SP2" | "SP5" | "SP10" | "SP30" | "SP50") | No | New default tier for workspace. Only for 'update-workspace'. |
| `pipeline` | array | No | New pipeline stages as an array of objects, e.g. [{$source: {connectionName: 'src'}}, {$match: {status: 'active'}}, {$merge: {into: {connectionName: 'dest', db: 'db', coll: 'coll'}}}]. Only for 'modify-processor'. Processor must be stopped first. If changing a window stage interval, the processor must be restarted with resumeFromCheckpoint=false. |
| `newRegion` | string | No | New region for workspace. Only for 'update-workspace'. Use Atlas region names (e.g. AWS: 'VIRGINIA_USA', Azure: 'eastus2', GCP: 'US_CENTRAL1'). |
| `peeringId` | string | No | VPC peering connection ID. Required for 'accept-peering' and 'reject-peering'. |
| `projectId` | string | Yes | Atlas project ID. Use atlas-list-projects to find project IDs if not available. |
| `resourceName` | string | No | Processor or connection name. Required for processor and connection actions. |
| `workspaceName` | string | Yes | Workspace name containing the resource to manage. |
| `requesterVpcId` | string | No | VPC ID of the peering requester. Required for 'accept-peering'. |
| `connectionConfig` | object | No | Updated connection configuration. Only for 'update-connection'. Provide only the fields to change. Note: networking config and connection type cannot be modified after creation — to change these, delete and recreate the connection. |
| `requesterAccountId` | string | No | AWS account ID of the peering requester. Required for 'accept-peering'. |
| `resumeFromCheckpoint` | boolean | No | Resume from last checkpoint on start. Default: true. Set false to reprocess from beginning (drops accumulated window state). Only for 'start-processor'. |
| `startAtOperationTime` | string | No | ISO 8601 timestamp to resume from. Only for 'start-processor'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tier` | string | No | Confirmed workspace tier after an update |
| `region` | string | No | Confirmed workspace region after an update |
| `maxTier` | string | No | Confirmed workspace max tier after an update |
| `peeringState` | string ("ACCEPTED" | "REJECTED") | No | Outcome of a VPC peering accept or reject action |
| `processorState` | string ("STARTED" | "STOPPED" | "CREATED" | "FAILED") | No | Processor state after a lifecycle action |
| `connectionState` | string ("PENDING" | "READY" | "DELETING" | "FAILED") | No | Connection state after an update |

### Atlas-streams-teardown

**Slug:** `MONGODB_MCP_ATLAS_STREAMS_TEARDOWN`

Delete Atlas Stream Processing resources. Also use for 'remove my workspace', 'disconnect a source', 'delete all processors', or 'clean up my streams environment'. Performs basic safety checks before deletion: summarizes counts of processors and connections, highlights connections referenced by processors where possible, and surfaces API errors if processors are still running when deletion is attempted. Use `atlas-streams-discover` to review resources before deleting.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource` | string ("processor" | "connection" | "workspace" | "privatelink" | "peering") | Yes | What to delete. 'processor': stop first recommended. 'connection': ensure no processor references it. 'workspace': removes all contained connections and processors. |
| `projectId` | string | Yes | Atlas project ID. Use atlas-list-projects to find project IDs if not available. |
| `resourceName` | string | No | Name or ID of the specific resource to delete. |
| `workspaceName` | string | No | Workspace name. Required for workspace, connection, and processor deletion. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource` | string ("processor" | "connection" | "workspace" | "privatelink" | "peering") | Yes | Which resource deletion completed or was initiated |
| `processorsRemoved` | integer | No | Processors removed as part of workspace deletion (when inventory was available) |
| `connectionsRemoved` | integer | No | Connections removed as part of workspace deletion (when inventory was available) |

### Atlas-upgrade-cluster

**Slug:** `MONGODB_MCP_ATLAS_UPGRADE_CLUSTER`

Upgrade a MongoDB Atlas cluster tier. Upgrades Free (M0) clusters to Flex or M10 Dedicated, or Flex clusters to M10 Dedicated. The upgrade path is determined automatically from the current tier unless overridden with targetTier. Note to LLM: If provider and region are not already known, ask for both together in a single question before calling this tool. Common region mappings by provider (default recommendation: AWS US_EAST_1):
AWS: "East Coast"/"Virginia"/"US East" → US_EAST_1, "Ohio" → US_EAST_2, "California"/"West Coast" → US_WEST_2, "Southeast Asia"/"APAC"/"Singapore" → AP_SOUTHEAST_1, "Europe"/"EU"/"Ireland" → EU_WEST_1.
GCP: "Central US" → CENTRAL_US, "Western US" → WESTERN_US, "Southeast Asia"/"APAC" → SOUTHEASTERN_ASIA_PACIFIC, "Europe"/"EU" → WESTERN_EUROPE.
AZURE: "East US" → US_EAST_2, "West US" → US_WEST_2, "Europe"/"EU" → EUROPE_NORTH.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `region` | string | No | Cloud provider region in Atlas format using uppercase letters and underscores (e.g. US_EAST_1). If omitted, the existing value is preserved. |
| `provider` | string | No | Cloud provider (e.g. AWS, GCP, AZURE). If omitted, the existing value is preserved. |
| `projectId` | string | Yes | Atlas project ID |
| `targetTier` | string ("FLEX" | "M10") | No | Target tier to upgrade to. Defaults to FLEX for Free clusters and M10 for Flex clusters. |
| `clusterName` | string | Yes | Name of the cluster to upgrade |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `clusterId` | string | No |  |
| `targetTier` | string ("FLEX" | "M10") | Yes |  |
| `originalTier` | string ("FREE" | "FLEX") | Yes |  |
| `resolvedRegion` | string | No |  |
| `resolvedProvider` | string | No |  |

### Collection-indexes

**Slug:** `MONGODB_MCP_COLLECTION_INDEXES`

Describe the indexes for a collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `searchIndexes` | array | Yes |  |
| `classicIndexes` | array | Yes |  |
| `searchIndexesCount` | number | Yes |  |
| `classicIndexesCount` | number | Yes |  |

### Collection-schema

**Slug:** `MONGODB_MCP_COLLECTION_SCHEMA`

Describe the schema for a collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `sampleSize` | number | No | Number of documents to sample for schema inference |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |
| `responseBytesLimit` | number | No | The maximum number of bytes to return in the response. This value is capped by the server's configured maximum and cannot be exceeded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `schema` | object | Yes |  |
| `fieldsCount` | number | Yes |  |

### Collection-storage-size

**Slug:** `MONGODB_MCP_COLLECTION_STORAGE_SIZE`

Gets the size of the collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `size` | number | Yes |  |
| `units` | string | Yes |  |

### Count

**Slug:** `MONGODB_MCP_COUNT`

Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | object | No | A filter/query parameter. Allows users to filter the documents to count. Matches the syntax of the filter argument of db.collection.count(). |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `count` | number | Yes | The number of documents in the collection |

### Create-collection

**Slug:** `MONGODB_MCP_CREATE_COLLECTION`

Creates a new collection in a database. If the database doesn't exist, it will be created automatically.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `created` | boolean | Yes |  |
| `database` | string | Yes |  |
| `collection` | string | Yes |  |

### Create-index

**Slug:** `MONGODB_MCP_CREATE_INDEX`

Create an index for a collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The name of the index |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `definition` | array | Yes | The index definition. Use 'classic' for standard indexes, 'vectorSearch' for vector search indexes, and 'search' for Atlas Search (lexical) indexes. |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes |  |
| `indexName` | string | Yes |  |
| `indexType` | string ("classic" | "vectorSearch" | "search") | Yes |  |
| `collection` | string | Yes |  |

### Db-stats

**Slug:** `MONGODB_MCP_DB_STATS`

Returns statistics that reflect the use state of a single database

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `stats` | object | Yes |  |

### Delete-many

**Slug:** `MONGODB_MCP_DELETE_MANY`

Removes all documents that match the filter from a MongoDB collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `filter` | object | No | The query filter, specifying the deletion criteria. Matches the syntax of the filter argument of db.collection.deleteMany() |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes |  |
| `collection` | string | Yes |  |
| `deletedCount` | number | Yes |  |

### Drop-collection

**Slug:** `MONGODB_MCP_DROP_COLLECTION`

Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dropped` | boolean | Yes |  |
| `database` | string | Yes |  |
| `collection` | string | Yes |  |

### Drop-database

**Slug:** `MONGODB_MCP_DROP_DATABASE`

Removes the specified database, deleting the associated data files

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dropped` | boolean | Yes |  |
| `database` | string | Yes |  |

### Drop-index

**Slug:** `MONGODB_MCP_DROP_INDEX`

Drop an index for the provided database and collection.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `type` | string ("classic" | "search") | Yes | The type of index to be deleted. Use 'classic' for standard indexes and 'search' for atlas search and vector search indexes. |
| `database` | string | Yes | Database name |
| `indexName` | string | Yes | The name of the index to be dropped. |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `dropped` | boolean | Yes |  |
| `database` | string | Yes |  |
| `indexName` | string | Yes |  |
| `collection` | string | Yes |  |

### Explain

**Slug:** `MONGODB_MCP_EXPLAIN`

Returns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated method

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `method` | array | Yes | The method and its arguments to run |
| `database` | string | Yes | Database name |
| `verbosity` | string ("queryPlanner" | "queryPlannerExtended" | "executionStats" | "allPlansExecution") | No | The verbosity of the explain plan, defaults to queryPlanner. If the user wants to know how fast is a query in execution time, use executionStats. It supports all verbosities as defined in the MongoDB Driver. |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `method` | string ("aggregate" | "find" | "count") | Yes |  |
| `verbosity` | string ("queryPlanner" | "queryPlannerExtended" | "executionStats" | "allPlansExecution") | Yes |  |
| `explainResult` | object | Yes |  |

### Find

**Slug:** `MONGODB_MCP_FIND`

Run a find query against a MongoDB collection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sort` | object | No | A document, describing the sort order, matching the syntax of the sort argument of cursor.sort(). The keys of the object are the fields to sort on, while the values are the sort directions (1 for ascending, -1 for descending). |
| `limit` | number | No | The maximum number of documents to return |
| `filter` | object | No | The query filter, matching the syntax of the query argument of db.collection.find() |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `projection` | object | No | The projection, matching the syntax of the projection argument of db.collection.find() |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |
| `responseBytesLimit` | number | No | The maximum number of bytes to return in the response. This value is capped by the server's configured maximum and cannot be exceeded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `documents` | array | Yes | The documents returned by the find query |
| `appliedLimits` | array | Yes | The limits applied to the find query |
| `queryResultsCount` | number | No | The total number of documents returned by the find query |

### Insert-many

**Slug:** `MONGODB_MCP_INSERT_MANY`

Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `documents` | array | Yes | The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany(). |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes |  |
| `collection` | string | Yes |  |
| `insertedIds` | array | Yes |  |
| `insertedCount` | number | Yes |  |

### List-collections

**Slug:** `MONGODB_MCP_LIST_COLLECTIONS`

List all collections for a given database

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes | Database name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `totalCount` | number | Yes |  |
| `collections` | array | Yes |  |

### List-databases

**Slug:** `MONGODB_MCP_LIST_DATABASES`

List all databases for a MongoDB connection

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `databases` | array | Yes |  |
| `totalCount` | number | Yes |  |

### Remote-atlas-connect

**Slug:** `MONGODB_MCP_REMOTE_ATLAS_CONNECT`

Connect to MongoDB Atlas cluster

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `projectId` | string | Yes |  |
| `clusterName` | string | Yes |  |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `clusterId` | string | No | The unique identifier of the connected Atlas cluster. |
| `connectionId` | string | Yes | Opaque handle for the established connection. Pass it as the connectionId argument of MongoDB tool calls. |

### Rename-collection

**Slug:** `MONGODB_MCP_RENAME_COLLECTION`

Renames a collection in a MongoDB database

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `newName` | string | Yes | The new name for the collection |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `dropTarget` | boolean | No | If true, drops the target collection if it exists |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `renamed` | boolean | Yes |  |
| `database` | string | Yes |  |
| `newCollection` | string | Yes |  |
| `oldCollection` | string | Yes |  |

### Update-many

**Slug:** `MONGODB_MCP_UPDATE_MANY`

Updates all documents that match the specified filter for a collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider updating them in batches.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `filter` | object | No | The selection criteria for the update, matching the syntax of the filter argument of db.collection.updateOne() |
| `update` | object | Yes | An update document describing the modifications to apply using update operator expressions |
| `upsert` | boolean | No | Controls whether to insert a new document if no documents match the filter |
| `database` | string | Yes | Database name |
| `collection` | string | Yes | Collection name |
| `connectionId` | string | Yes | The connection to run the operation against. Use the id returned by one of the connect tools. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | Yes |  |
| `collection` | string | Yes |  |
| `upsertedId` | string | No |  |
| `matchedCount` | number | Yes |  |
| `modifiedCount` | number | Yes |  |
| `upsertedCount` | number | Yes |  |
