MongoDB MCP Server — Hosted for Any AI Agent
MCP Server language Hosted language PublicQuery collections, insert documents, and run aggregation pipelines on your MongoDB Atlas database — AI-native document database access.
Use with AI AssistantsMCP
Connect Claude, Cursor, or any MCP-compatible client — then call tools directly
① Add This MCP Server
Paste into your AI client config — then all its tools are available instantly.
{
"mcpServers": {
"mongodb": {
"url": "https://mcp.aerostack.dev/s/aerostack/mcp-mongodb",
"headers": {
"Authorization": "Bearer YOUR_AEROSTACK_TOKEN"
}
}
}
}Replace YOUR_AEROSTACK_TOKEN with your API token from the dashboard.
② Call a Tool
Ask your AI assistant to call a specific tool, or send raw JSON-RPC:
Natural Language Prompt
“Use the list_collections tool to list all collections in a mongodb database using $listcatalog (requires mongodb 6.0+)”
Using a Workspace?
Add this MCP to your Workspace — your team shares one token, secrets are stored securely, and every AI agent in the workspace can call it without per-user setup.
description Overview
mcp-mongodb — MongoDB Atlas MCP Server
Query collections, insert documents, and run aggregation pipelines on your MongoDB Atlas database from your AI agents.
MongoDB Atlas is the cloud-hosted version of MongoDB — the most popular document database, used by millions of developers to store flexible JSON-like documents at scale. This MCP server gives your AI agents full CRUD access plus aggregation pipeline support through the Atlas Data API: finding, inserting, updating, and deleting documents across any database and collection in your cluster — all through natural language.
Live endpoint: https://mcp.aerostack.dev/s/aerostack/mcp-mongodb
What You Can Do
- Query any collection in your MongoDB Atlas cluster with filters, sorting, and pagination to pull live data into agent workflows
- Insert, update, or delete documents to write results back to your database as part of automation pipelines
- Run aggregation pipelines to perform complex data transformations, grouping, and analytics directly on your cluster
- List databases and collections to explore your data model and discover available data sources
Available Tools
| Tool | Description |
|---|---|
list_databases |
List all databases in the Atlas cluster |
list_collections |
List all collections in a database |
find_one |
Find a single document matching a filter |
find |
Find multiple documents with filter, sort, limit, skip, projection |
insert_one |
Insert a single document into a collection |
insert_many |
Insert multiple documents into a collection |
update_one |
Update a single document matching a filter |
update_many |
Update multiple documents matching a filter |
delete_one |
Delete a single document matching a filter |
delete_many |
Delete multiple documents matching a filter |
aggregate |
Run an aggregation pipeline on a collection |
Configuration
| Variable | Required | Description | How to Get |
|---|---|---|---|
MONGODB_APP_ID |
Yes | Atlas Data API Application ID | cloud.mongodb.com → Your Project → App Services → select your app → copy the App ID from the top of the page |
MONGODB_API_KEY |
Yes | Atlas Data API Key | Same project → App Services → Authentication → API Keys → create or copy an API key |
MONGODB_CLUSTER |
Yes | Cluster name (e.g. "Cluster0") | Database tab → your cluster name is shown at the top of the cluster card |
Quick Start
Add to Aerostack Workspace
- Go to aerostack.dev → Your Project → MCPs
- Search for "MongoDB" and click Add to Workspace
- Add
MONGODB_APP_ID,MONGODB_API_KEY, andMONGODB_CLUSTERunder Project → Secrets
Once added, every AI agent in your workspace can call MongoDB tools automatically — no per-user setup needed.
Example Prompts
"List all collections in my 'myapp' database"
"Find all orders in the orders collection where status is 'pending', sorted by createdAt descending"
"Insert a new user document with name 'Alice' and email 'alice@example.com' into the users collection"
"Run an aggregation pipeline on the events collection to group by event type and count occurrences"
Direct API Call
curl -X POST https://mcp.aerostack.dev/s/aerostack/mcp-mongodb \
-H 'Content-Type: application/json' \
-H 'X-Mcp-Secret-MONGODB-APP-ID: your-app-id' \
-H 'X-Mcp-Secret-MONGODB-API-KEY: your-api-key' \
-H 'X-Mcp-Secret-MONGODB-CLUSTER: Cluster0' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"find","arguments":{"database":"myapp","collection":"users","filter":{},"limit":10}}}'
License
MIT
terminal Tools (10)
Available tools on this MCP server. Each tool can be called directly from any AI agent.
list_collections #1 List all collections in a MongoDB database using $listCatalog (requires MongoDB 6.0+)
find_one #2 Find a single document in a collection matching a filter
find #3 Find multiple documents with optional filter, sort, limit, skip, and projection
insert_one #4 Insert a single document into a collection
insert_many #5 Insert multiple documents into a collection
update_one #6 Update a single document matching a filter
update_many #7 Update all documents matching a filter
delete_one #8 Delete a single document matching a filter
delete_many #9 Delete all documents matching a filter
aggregate #10 Run an aggregation pipeline on a collection
Details
language Live Endpoint
https://mcp.aerostack.dev/s/aerostack/mcp-mongodb
Sub-50ms globally · Zero cold start
Publisher
Pre-built functions for the most common MCP tool patterns. Clone, extend, and deploy.
More in Database
Browse Database MCPs →Airtable
by @aerostack
Turn your Airtable bases into an AI-queryable database — create, update, search, and analyze records with natural language.
Notion Workspace
by @aerostack
Pages, databases, blocks, search via Notion's official MCP
Redis
by @aerostack
Get, set, and manage keys, hashes, and lists in your Upstash Redis database — AI-native key-value store access.
Supabase
by @aerostack
Query Postgres tables, manage storage buckets, and interact with your Supabase backend — AI-native database access.
Turso
by @aerostack
Execute SQL queries, manage tables, and interact with your Turso (LibSQL) edge database — AI-native SQLite at the edge.
Dynamodb
by @aerostack
Query, put, update, delete, and scan items in Amazon DynamoDB tables — AI-native NoSQL database access for any agent.
Frequently asked questions
What is the MongoDB MCP server and what can it do? +
The MongoDB MCP server is hosted on Aerostack and exposes these tools to your AI agent: `list_collections`, `find_one`, `find`, `insert_one`, `insert_many`. You get one hosted URL — no self-hosting — that works from Claude, Cursor, ChatGPT, Gemini, VS Code, or any MCP-compatible client, and you can share it with your team or combine it with other MCP servers in a workspace.
Is the MongoDB MCP server hosted, or do I have to run it myself? +
It's hosted on Aerostack's edge infrastructure — you don't deploy or maintain anything. Add it to a workspace and you get one authenticated URL, with secrets encrypted, that any AI agent or editor can connect to. Use it solo or share the same URL across your whole team.
Which AI agents and editors can use the MongoDB MCP server? +
Any MCP client: Claude and Claude Code, Cursor, ChatGPT, Gemini, Windsurf, Cline, VS Code, and custom agents. Because it's one hosted URL, the same MongoDB MCP server works everywhere — and you can compose it with other MCP servers, skills, and functions behind a single workspace URL.
How do I install the MongoDB MCP server in Claude Desktop? +
Add the following to your Claude Desktop config (`claude_desktop_config.json`): ```json { "mcpServers": { "@aerostack/mcp-mongodb": { "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-mongodb"] } } } ``` Then restart Claude Desktop and the tools will appear automatically.
How do I use the MongoDB MCP server in Cursor? +
In Cursor, open **Settings → MCP** and add: ```json { "name": "@aerostack/mcp-mongodb", "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-mongodb"] } ``` Save and reload Cursor. The MCP tools will be available in Agent mode.
Does MongoDB MCP require authentication? +
Yes. MongoDB requires authentication. Check the MCP's documentation for the required credentials.