🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.

mongodb-mcp-server
Atlas MCP Server
3 years
Works with Finder
6
Github Watches
1
Github Forks
6
Github Stars
Atlas MCP Server
A Model Context Protocol server for interacting with MongoDB Atlas. This project implements a Model Context Protocol (MCP) server enabling AI assistants to interact with MongoDB Atlas resources through natural language.
[!CAUTION] Do not use this in production. This is a work in progress and is not intended for production use. It is meant for demonstration purposes only.
📚 Table of Contents
Prerequisites
- Node.js (v20 or later)
- MongoDB Atlas account
Installation
VSCode
Prerequisites:
- Node.js v20.x
Step 1: Add the mcp server to VSCode configuration
- Press
Cmd + Shift + P
and typeMCP: Add MCP Server
and select it. - Select command (Stdio).
- Input command
npx -y @mongodb-js/mongodb-mcp-server
. - Choose between user / workspace
- Add arguments to the file
Note: the file should look like:
{
"servers": {
"MongoDB": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mongodb-js/mongodb-mcp-server"
]
}
}
}
Notes: You can configure the server with atlas access, make sure to follow configuration section for more details.
Step 2: Try talking to github copilot
- Can you connect to my mongodb instance?
Claude Desktop
Step 1: Install claude and login
Note: follow instructions at https://claude.ai/download
Step 2: Launch Claude Settings -> Developer -> Edit Config
Paste the mcp server configuration into the file
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "@mongodb-js/mongodb-mcp-server"]
}
}
}
Step 3: Close and Relaunch Claude Desktop and click on the hammer icon, the MongoDB MCP server should be detected.
You may experiment asking Can you connect to my mongodb instance?
.
🛠️ Supported Tools
Tool List
MongoDB Atlas Tools
-
atlas-list-orgs
- Lists MongoDB Atlas organizations -
atlas-list-projects
- Lists MongoDB Atlas projects -
atlas-create-project
- Creates a new MongoDB Atlas project -
atlas-list-clusters
- Lists MongoDB Atlas clusters -
atlas-inspect-cluster
- Inspect a specific MongoDB Atlas cluster -
atlas-create-free-cluster
- Create a free MongoDB Atlas cluster -
atlas-inspect-access-list
- Inspect IP/CIDR ranges with access to MongoDB Atlas clusters -
atlas-create-access-list
- Configure IP/CIDR access list for MongoDB Atlas clusters -
atlas-list-db-users
- List MongoDB Atlas database users -
atlas-create-db-user
- List MongoDB Atlas database users
NOTE: atlas tools are only available when you set credentials on configuration section.
MongoDB Database Tools
-
connect
- Connect to a MongoDB instance -
find
- Run a find query against a MongoDB collection -
aggregate
- Run an aggregation against a MongoDB collection -
count
- Get the number of documents in a MongoDB collection -
insert-one
- Insert a single document into a MongoDB collection -
insert-many
- Insert multiple documents into a MongoDB collection -
create-index
- Create an index for a MongoDB collection -
update-one
- Update a single document in a MongoDB collection -
update-many
- Update multiple documents in a MongoDB collection -
rename-collection
- Rename a MongoDB collection -
delete-one
- Delete a single document from a MongoDB collection -
delete-many
- Delete multiple documents from a MongoDB collection -
drop-collection
- Remove a collection from a MongoDB database -
drop-database
- Remove a MongoDB database -
list-databases
- List all databases for a MongoDB connection -
list-collections
- List all collections for a given database -
collection-indexes
- Describe the indexes for a collection -
collection-schema
- Describe the schema for a collection -
collection-storage-size
- Get the size of a collection in MB -
db-stats
- Return statistics about a MongoDB database
Configuration
The MongoDB MCP Server can be configured using multiple methods, with the following precedence (highest to lowest):
- Command-line arguments
- Environment variables
Configuration Options
Option | Description |
---|---|
apiClientId |
Atlas API client ID for authentication |
apiClientSecret |
Atlas API client secret for authentication |
connectionString |
MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
logPath |
Folder to store logs |
disabledTools |
An array of tool names, operation types, and/or categories of tools that will be disabled. |
logPath
Default log location is as follows:
- Windows:
%LOCALAPPDATA%\mongodb\mongodb-mcp\.app-logs
- macOS/Linux:
~/.mongodb/mongodb-mcp/.app-logs
Disabled Tools
You can disable specific tools or categories of tools by using the disabledTools
option. This option accepts an array of strings,
where each string can be a tool name, operation type, or category.
The way the array is constructed depends on the type of configuration method you use:
- For environment variable configuration, use a comma-separated string:
export MDB_MCP_DISABLED_TOOLS="create,update,delete,atlas,collectionSchema"
. - For command-line argument configuration, use a space-separated string:
--disabledTools create update delete atlas collectionSchema
.
Categories of tools:
-
atlas
- MongoDB Atlas tools, such as list clusters, create cluster, etc. -
mongodb
- MongoDB database tools, such as find, aggregate, etc.
Operation types:
-
create
- Tools that create resources, such as create cluster, insert document, etc. -
update
- Tools that update resources, such as update document, rename collection, etc. -
delete
- Tools that delete resources, such as delete document, drop collection, etc. -
read
- Tools that read resources, such as find, aggregate, list clusters, etc. -
metadata
- Tools that read metadata, such as list databases, list collections, collection schema, etc.
Atlas API Access
To use the Atlas API tools, you'll need to create a service account in MongoDB Atlas:
-
Create a Service Account:
- Log in to MongoDB Atlas at cloud.mongodb.com
- Navigate to Access Manager > Organization Access
- Click Add New > Applications > Service Accounts
- Enter name, description and expiration for your service account (e.g., "MCP, MCP Server Access, 7 days")
- Select appropriate permissions (for full access, use Organization Owner)
- Click "Create"
-
Save Client Credentials:
- After creation, you'll be shown the Client ID and Client Secret
- Important: Copy and save the Client Secret immediately as it won't be displayed again
-
Add Access List Entry (Optional but recommended):
- Add your IP address to the API access list
-
Configure the MCP Server:
- Use one of the configuration methods below to set your
apiClientId
andapiClientSecret
- Use one of the configuration methods below to set your
Configuration Methods
Environment Variables
Set environment variables with the prefix MDB_MCP_
followed by the option name in uppercase with underscores:
# Set Atlas API credentials
export MDB_MCP_API_CLIENT_ID="your-atlas-client-id"
export MDB_MCP_API_CLIENT_SECRET="your-atlas-client-secret"
# Set a custom MongoDB connection string
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
export MDB_MCP_LOG_PATH="/path/to/logs"
Command-Line Arguments
Pass configuration options as command-line arguments when starting the server:
npx -y @mongodb-js/mongodb-mcp-server --apiClientId="your-atlas-client-id" --apiClientSecret="your-atlas-client-secret" --connectionString="mongodb+srv://username:password@cluster.mongodb.net/myDatabase" --logPath=/path/to/logs
🤝 Contributing
Interested in contributing? Great! Please check our Contributing Guide for guidelines on code contributions, standards, adding new tools, and troubleshooting information.
相关推荐
Easily create LLM tools and agents using plain Bash/JavaScript/Python functions.
PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 QQ / 微信(企业微信、个人微信)/ 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 ChatGPT、DeepSeek、Dify、Claude、Gemini、xAI、PPIO、Ollama、LM Studio、阿里云百炼、火山方舟、SiliconFlow、Qwen、Moonshot、ChatGLM、SillyTraven、MCP 等 LLM 的机器人 / Agent | LLM-based instant messaging bots platform, supports Discord, Telegram, WeChat, Lark, DingTalk, QQ, Slack
Artifact2MCP Generator allows generation of MCP server automatically & dynamically given smart contract's compiled artifact (chain‑agnostic)
📦 Repomix (formerly Repopack) is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.
Reviews

user_CZF0kjIU
As a dedicated user of the mongodb-mcp-server, I’m truly impressed by its performance and efficiency. The seamless integration with MongoDB JS has greatly improved our deployment process. The server is robust, reliable, and easy to manage, making it an indispensable tool for our projects. Highly recommended for anyone looking to streamline their MongoDB operations.

user_LpJBjLND
As a dedicated user of the mongodb-mcp-server, I am thoroughly impressed with its robust performance and reliability. Developed by mongodb-js, this server has streamlined my database management tasks significantly. The intuitive interface and powerful features make it an indispensable tool for anyone working with MongoDB. Highly recommended for its seamless integration and exceptional functionality!

user_X9jNtN4s
I've been using mongodb-mcp-server by mongodb-js, and it's a game-changer! The installation process was seamless, and the setup guide made it incredibly easy to get started. It's robust, efficient, and perfectly tailored for developers working with MongoDB. If you're looking for a reliable server solution, this is the one.

user_MlcAx34o
The mongodb-mcp-server by mongodb-js is a fantastic tool for those looking to manage their MongoDB environments seamlessly. It's intuitive and powerful, making it an essential for any serious developer. Highly recommended for anyone in need of a reliable server management application!

user_iczBuU4I
Mongodb-mcp-server by mongodb-js is an exceptional tool for server management in MongoDB. The seamless integration and robust functionality make database operations efficient and hassle-free. The intuitive interface and detailed documentation greatly enhance productivity, ensuring a smooth user experience. Highly recommended for anyone looking to optimize their MongoDB server management!