MongoDB Atlas MCP Server
OfficialMongoDB Atlas MCP 服务器
用于管理 MongoDB Atlas 项目的 MCP(模型上下文协议)服务器。此软件包提供了通过 MCP 接口创建和管理 MongoDB Atlas 集群、用户和网络访问的工具。
演示视频

观看演示视频,了解 MongoDB Atlas MCP Server 的实际运行情况。
Related MCP server: MongoDB MCP Server
特征
MCP 工具
create_atlas_cluster- 在现有项目中创建一个新的 MongoDB Atlas 集群setup_atlas_network_access- 为 Atlas 项目配置网络访问create_atlas_user- 创建具有 atlasAdmin 角色的新数据库用户get_atlas_connection_strings- 检索集群的连接字符串list_atlas_projects- 列出所有可使用提供的 API 密钥访问的 Atlas 项目list_atlas_clusters- 列出特定 Atlas 项目中的所有集群
安装
npm install mcp-mongodb-atlas用法
作为命令行工具
您可以直接从命令行运行 Atlas 项目管理器:
# Using environment variables
export ATLAS_PUBLIC_KEY="your-public-key"
export ATLAS_PRIVATE_KEY="your-private-key"
npx mcp-mongodb-atlas
# Or passing keys as arguments
npx mcp-mongodb-atlas "your-public-key" "your-private-key"使用 Cline(VSCode 扩展)
要在 VSCode 中与 Cline 一起使用,请将服务器配置添加到您的 MCP 设置文件中:
{
"mcpServers": {
"atlas": {
"command": "npx",
"args": ["mcp-mongodb-atlas"],
"env": {
"ATLAS_PUBLIC_KEY": "your-public-key",
"ATLAS_PRIVATE_KEY": "your-private-key"
},
"disabled": false,
"autoApprove": []
}
}
}MCP 设置文件位于:
macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonWindows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
使用光标
要与 Cursor 一起使用,请转到设置中的“Cursor 设置”>“MCP”,然后添加具有以下配置的新服务器:
名称:
atlas(或您喜欢的任何名称)命令:
npx mcp-mongodb-atlas参数:提供您的 API 密钥作为参数
## Suggested Command
npx mcp-mongodb-atlas <public_key> <private_key>较新版本可以使用以下命令设置~/.cursor/mcp.json文件:
{
"mcpServers": {
"atlas": {
"command": "npx",
"args": ["mcp-mongodb-atlas"],
"env": {
"ATLAS_PUBLIC_KEY": "your-public-key",
"ATLAS_PRIVATE_KEY": "your-private-key"
},
"disabled": false,
"autoApprove": []
}
}
}环境变量(可选):
ATLAS_PUBLIC_KEY:您的 MongoDB Atlas 公钥ATLAS_PRIVATE_KEY:您的 MongoDB Atlas 私钥
使用 Claude Desktop
要与 Claude Desktop 一起使用,请添加服务器配置:
在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"atlas": {
"command": "npx",
"args": ["mcp-mongodb-atlas"],
"env": {
"ATLAS_PUBLIC_KEY": "your-public-key",
"ATLAS_PRIVATE_KEY": "your-private-key"
}
}
}
}API 密钥
您需要 MongoDB Atlas API 密钥才能使用此工具。要创建 API 密钥,请执行以下操作:
登录您的 MongoDB Atlas 帐户
转到访问管理器 > API 密钥
创建具有适当权限的新 API 密钥
保存公钥和私钥
发展
克隆存储库并安装依赖项:
git clone https://github.com/mongodb-developer/mcp-mongodb-atlas.git
cd mcp-mongodb-atlas
npm install构建项目:
npm run build对于使用自动重建的开发:
npm run watch调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们建议使用 MCP Inspector:
npm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
执照
麻省理工学院
Available Tools
6 toolscreate_atlas_clusterC
Creates a new Atlas cluster in an existing Atlas project.
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the Atlas project. | |
| clusterName | Yes | The name of the cluster to create. | |
| region | Yes | The cloud provider region to deploy the cluster in. eg. US_EAST_1 | |
| cloudProvider | Yes | The cloud provider (e.g., AWS, GCP, AZURE). | |
| tier | Yes | The instance size (e.g., M0, M2, M5). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Creates', implying a write/mutation operation, but fails to mention critical behavioral aspects such as permissions required, whether this is a long-running operation, potential costs, or what happens on failure. This leaves significant gaps in understanding how the tool behaves beyond its basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes essential information, earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of creating a cluster (a significant infrastructure operation) with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits, error handling, return values, or operational context, leaving the agent poorly equipped to use this tool effectively in real scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, providing clear documentation for all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between parameters or providing examples. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Creates') and resource ('new Atlas cluster in an existing Atlas project'), making the purpose unambiguous. It distinguishes from siblings like 'list_atlas_clusters' by specifying creation rather than listing. However, it doesn't explicitly differentiate from 'setup_atlas_network_access' or 'create_atlas_user' in terms of resource type, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides minimal guidance by mentioning 'in an existing Atlas project', which implies a prerequisite but doesn't specify when to use this tool versus alternatives. There's no explicit direction on when to choose this over other tools like 'setup_atlas_network_access' or what scenarios warrant cluster creation, leaving the agent with little context for decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_atlas_userB
Creates a new database user for an existing Atlas project. User will have atlasAdmin role.
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the Atlas project. | |
| username | Yes | The username for the database user. | |
| password | Yes | The password for the database user. | |
| roles | No | An array of roles for the user. Default is [atlasAdmin]. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states the action is a creation operation and mentions the default role, but lacks details on permissions required, whether the operation is idempotent, rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose and includes key details (project requirement and default role). There is no wasted verbiage, and every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (mutation with 4 parameters), no annotations, and no output schema, the description is moderately complete. It covers the basic purpose and default role but lacks details on behavioral aspects like error handling, response format, or integration with sibling tools. It's adequate but has clear gaps for a creation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description adds minimal value beyond the schema by mentioning the default role ('atlasAdmin'), which is partially covered in the schema's description of the 'roles' parameter. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Creates a new database user') and the resource ('for an existing Atlas project'), with specific role information ('atlasAdmin role'). It distinguishes from siblings like 'create_atlas_cluster' (creates clusters) and 'list_atlas_projects' (lists projects), though it doesn't explicitly mention these distinctions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context ('for an existing Atlas project'), suggesting this tool should be used when a project already exists. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'setup_atlas_network_access' or prerequisites beyond project existence.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_atlas_connection_stringsC
Retrieves connection strings for a cluster in an existing Atlas project.
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the Atlas project. | |
| clusterName | Yes | The name of the cluster. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data, implying a read-only operation, but lacks details on authentication needs, rate limits, error conditions, or what the output format entails (e.g., types of connection strings). This leaves significant gaps in understanding how the tool behaves in practice.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool that retrieves data. It does not explain what connection strings are returned (e.g., MongoDB URI formats, driver-specific strings) or any behavioral aspects like permissions or response structure, leaving the agent with insufficient context to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting both parameters ('projectId' and 'clusterName'). The description adds no additional meaning beyond this, such as format examples or constraints, but the schema adequately covers the basics, meeting the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Retrieves') and resource ('connection strings for a cluster in an existing Atlas project'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'list_atlas_clusters' or 'setup_atlas_network_access' in terms of specific use cases or data returned, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as when to retrieve connection strings instead of listing clusters or setting up network access. It mentions 'existing Atlas project' but does not specify prerequisites or exclusions, leaving usage context vague.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_atlas_clustersC
Lists all clusters in an Atlas project.
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the Atlas project. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks critical details such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or error handling. This leaves significant gaps for an agent to understand how to invoke it safely.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like safety, performance, or output format, which are crucial for a list operation. While concise, it fails to provide enough context for reliable agent use without additional assumptions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with 'projectId' clearly documented. The description implies the parameter by mentioning 'in an Atlas project' but adds no additional semantic context beyond what the schema provides, such as format examples or sourcing instructions. This meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Lists') and resource ('all clusters in an Atlas project'), making the purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'list_atlas_projects' or 'get_atlas_connection_strings', which would require mentioning specific scope or output differences.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a project ID), exclusions, or comparisons to siblings like 'list_atlas_projects' for broader listings or 'get_atlas_connection_strings' for cluster-specific details.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_atlas_projectsB
Lists all Atlas projects that the API key has access to.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden but only states that it lists projects accessible by the API key. It misses key behavioral details like pagination, rate limits, error handling, or response format, leaving significant gaps for agent understanding.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words, clearly front-loading the core action. It's appropriately sized for a simple list operation with no parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It fails to explain what the output includes (e.g., project details, format) or behavioral aspects like permissions or limitations, making it insufficient for full agent comprehension.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Since there are 0 parameters and schema description coverage is 100%, the baseline is high. The description adds no parameter information, which is acceptable here as no parameters exist, but it doesn't compensate for any gaps (none present).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Lists') and resource ('all Atlas projects'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_atlas_clusters' beyond the resource name, missing explicit distinction in scope or function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as 'list_atlas_clusters' or 'get_atlas_connection_strings'. It lacks context on prerequisites, timing, or exclusions, offering only a basic statement of function.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
setup_atlas_network_accessC
Sets up network access for an existing Atlas project. Accepts list of IP addresses or CIDR blocks.
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the Atlas project. | |
| ipAddresses | Yes | An array of IP addresses or CIDR blocks for network access. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but offers minimal behavioral context. It states the tool 'Sets up network access' (implying a write/mutation operation) but doesn't disclose permissions needed, whether changes are reversible, rate limits, or what happens to existing network settings. This is inadequate for a mutation tool without annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with two concise sentences that directly address the tool's function and parameter scope. It's front-loaded with the core purpose and avoids unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, the description is insufficient. It lacks crucial details like expected response format, error conditions, side effects, or how this tool interacts with sibling operations (e.g., whether network access affects cluster creation).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds minimal value by mentioning 'IP addresses or CIDR blocks' for the ipAddresses parameter, but doesn't provide additional syntax, format details, or constraints beyond what the schema states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Sets up network access') and target resource ('for an existing Atlas project'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling tools like 'create_atlas_cluster' or 'list_atlas_projects', which would require a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., project must exist), exclusions, or compare with sibling tools like 'get_atlas_connection_strings' for related network tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
- First observed
create_atlas_cluster - First observed
create_atlas_user - First observed
get_atlas_connection_strings - First observed
list_atlas_clusters - First observed
list_atlas_projects - First observed
setup_atlas_network_access
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose targeting specific Atlas resources: clusters, users, connection strings, projects, and network access. There is no overlap in functionality, making it easy for an agent to select the correct tool for any given task.
All tools follow a consistent verb_noun pattern with 'atlas' as a prefix (e.g., create_atlas_cluster, list_atlas_projects). The naming is uniform and predictable, using snake_case throughout without any deviations.
With 6 tools, the count is reasonable for managing MongoDB Atlas resources, covering key operations like creation, listing, and setup. It is slightly lean but sufficient for core tasks, though additional tools for updates or deletions could enhance coverage.
The tools provide good coverage for core Atlas operations, including creation and listing of clusters and projects, user management, and network setup. However, there are minor gaps, such as missing update or delete operations for clusters and users, which agents might need to work around.
Maintenance
Related MCP Connectors
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables large language models to interact directly with MongoDB databases, allowing them to query collections, inspect schemas, and manage data through natural language.34 npmMIT

MongoDB MCP Serverofficial
AlicenseBqualityAmaintenanceA Model Context Protocol server that enables AI assistants to interact with MongoDB Atlas resources through natural language, supporting database operations and Atlas management functions.2898,382 npm1,142Apache 2.0- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas, allowing users to perform database operations and manage Atlas resources through natural language.2298,382 npmApache 2.0
- AlicenseCqualityDmaintenanceA Model Context Protocol server that provides access to the MongoDB Atlas API, enabling management of clusters, users, projects, backups, and more through MCP tools.769 npm3MIT