Skip to main content
Glama
MongoDB Atlas MCP Server

MongoDB Atlas MCP Server

Official

MongoDB Atlas MCP 服务器

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

演示视频

MongoDB Atlas MCP 服务器演示

观看演示视频,了解 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.json

  • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

  • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

使用光标

要与 Cursor 一起使用,请转到设置中的“Cursor 设置”>“MCP”,然后添加具有以下配置的新服务器:

  1. 名称: atlas (或您喜欢的任何名称)

  2. 命令: npx mcp-mongodb-atlas

  3. 参数:提供您的 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": []
    }
  }
}
  1. 环境变量(可选):

    • 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 密钥,请执行以下操作:

  1. 登录您的 MongoDB Atlas 帐户

  2. 转到访问管理器 > API 密钥

  3. 创建具有适当权限的新 API 密钥

  4. 保存公钥和私钥

发展

克隆存储库并安装依赖项:

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 tools
create_atlas_clusterC

Creates a new Atlas cluster in an existing Atlas project.

Inputs: projectId (required), clusterName (required), region (required), cloudProvider (required), +1 more.

create_atlas_userB

Creates a new database user for an existing Atlas project. User will have atlasAdmin role.

Inputs: projectId (required), username (required), password (required), roles.

get_atlas_connection_stringsC

Retrieves connection strings for a cluster in an existing Atlas project.

Inputs: projectId (required), clusterName (required).

list_atlas_clustersC

Lists all clusters in an Atlas project.

Inputs: projectId (required).

list_atlas_projectsB

Lists all Atlas projects that the API key has access to.

Inputs: no named parameters.

setup_atlas_network_accessC

Sets up network access for an existing Atlas project. Accepts list of IP addresses or CIDR blocks.

Inputs: projectId (required), ipAddresses (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An 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.
      MIT
    • A
      license
      B
      quality
      A
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with MongoDB Atlas resources through natural language, supporting database operations and Atlas management functions.
      28
      1,164
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      A 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.
      22
      Apache 2.0
    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server that provides access to the MongoDB Atlas API, enabling management of clusters, users, projects, backups, and more through MCP tools.
      76
      34 npm
      3
      MIT