- Category: model context protocol
- Auth: S2S_OAUTH2
- Composio-managed OAuth available? No
- Tools: 41
- Triggers: 0
- Slug:
MONGODB_MCP - Version: 20261030_00
Tools
Aggregate
Aggregate
MONGODB_MCP_AGGREGATERun an aggregation against a MongoDB collectionInput Parameters
$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" } } } ] Output
Aggregate db
Aggregate db
MONGODB_MCP_AGGREGATE_DBRun an aggregation against a MongoDB databaseInput Parameters
$changeStream, $currentOp, $documents, $listLocalSessions, $queryStats). https://www.mongodb.com/docs/manual/reference/mql/aggregation-stages/#db.aggregate---stagesOutput
Atlas create access list
Atlas create access list
Atlas create cluster
Atlas create cluster
MONGODB_MCP_ATLAS_CREATE_CLUSTERCreate 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
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.SHARDED for single-shard clusters, requires M30 or higher. Defaults to REPLICASET.LATEST.NONE to explicitly disable the feature. Omit unless explicitly specified by the user.Output
Atlas create db user
Atlas create db user
MONGODB_MCP_ATLAS_CREATE_DB_USERCreate an MongoDB Atlas database userInput Parameters
Output
Atlas create free cluster
Atlas create free cluster
Atlas create project
Atlas create project
Atlas get performance advisor
Atlas get performance advisor
MONGODB_MCP_ATLAS_GET_PERFORMANCE_ADVISORGet 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 logsInput Parameters
atlas-list-projects tool to retrieve the user’s projects with their ids.Output
Atlas inspect access list
Atlas inspect access list
Atlas inspect cluster
Atlas inspect cluster
Atlas list alerts
Atlas list alerts
MONGODB_MCP_ATLAS_LIST_ALERTSList 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
Output
Atlas list clusters
Atlas list clusters
Atlas list db users
Atlas list db users
Atlas list orgs
Atlas list orgs
Atlas list projects
Atlas list projects
Atlas load sample dataset
Atlas load sample dataset
MONGODB_MCP_ATLAS_LOAD_SAMPLE_DATASETLoad 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
Output
Atlas pause resume cluster
Atlas pause resume cluster
MONGODB_MCP_ATLAS_PAUSE_RESUME_CLUSTERPause 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
Output
Atlas streams build
Atlas streams build
MONGODB_MCP_ATLAS_STREAMS_BUILDCreate 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
atlas-streams-discover with action ‘list-workspaces’ to see existing workspaces.Output
Atlas streams discover
Atlas streams discover
MONGODB_MCP_ATLAS_STREAMS_DISCOVERDiscover 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
Output
Atlas streams manage
Atlas streams manage
MONGODB_MCP_ATLAS_STREAMS_MANAGEManage 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
atlas-streams-discover action=‘inspect-workspace’ to check. Only for ‘start-processor’.Output
Atlas streams teardown
Atlas streams teardown
MONGODB_MCP_ATLAS_STREAMS_TEARDOWNDelete 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
Output
Atlas upgrade cluster
Atlas upgrade cluster
MONGODB_MCP_ATLAS_UPGRADE_CLUSTERUpgrade 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
Output
Collection indexes
Collection indexes
Collection schema
Collection schema
MONGODB_MCP_COLLECTION_SCHEMADescribe the schema for a collectionInput Parameters
Output
Collection storage size
Collection storage size
Count
Count
MONGODB_MCP_COUNTGets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameterInput Parameters
Output
Create collection
Create collection
Create index
Create index
MONGODB_MCP_CREATE_INDEXCreate an index for a collectionInput Parameters
Output
Db stats
Db stats
Delete many
Delete many
MONGODB_MCP_DELETE_MANYRemoves all documents that match the filter from a MongoDB collectionInput Parameters
Output
Drop collection
Drop collection
Drop database
Drop database
Drop index
Drop index
MONGODB_MCP_DROP_INDEXDrop an index for the provided database and collection.Input Parameters
Output
Explain
Explain
MONGODB_MCP_EXPLAINReturns statistics describing the execution of the winning plan chosen by the query optimizer for the evaluated methodInput Parameters
Output
Find
Find
MONGODB_MCP_FINDRun a find query against a MongoDB collectionInput Parameters
Output
Insert many
Insert many
MONGODB_MCP_INSERT_MANYInsert 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
Output
List collections
List collections
List databases
List databases
Remote atlas connect
Remote atlas connect
Rename collection
Rename collection
Update many
Update many
MONGODB_MCP_UPDATE_MANYUpdates 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.