MCP Catalogs
首页

mongodb-mcp-server

by mongodb-js·1,023·综合分 55

MongoDB MCP Server 连接 MongoDB 数据库和 Atlas 集群,提供数据库操作和 Atlas 管理工具。

databasedeveloper-toolscloud-storage
241
Forks
30
活跃 Issue
本月
最近提交
2 天前
收录于

概述

MongoDB MCP Server 是一个通过模型上下文协议与 MongoDB 数据库交互的综合实现。它提供三类工具:MongoDB Atlas 工具用于集群管理,MongoDB 数据库工具用于 CRUD 操作,以及 MongoDB Assistant 工具用于高级功能。服务器支持多种身份验证方法,包括直接连接字符串和 Atlas API 凭据,并具有只读模式等内置安全功能。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:AI 查询和分析 MongoDB 数据库而无需直接数据库访问
:通过支持 MCP 的客户端自动化 MongoDB Atlas 集群管理
:构建能够访问 MongoDB 数据作为上下文资源的 RAG 应用程序
:这个 MCP 服务器可以连接到本地 MongoDB 实例和 Atlas 集群吗?
:是否提供只读模式?

什么时候选它

当您使用 MongoDB 数据库或 Atlas 集群,并且需要安全地让 AI 访问您的数据而不构建自定义集成时选择此工具。

什么时候不要选它

如果您默认需要写访问权限(必须明确移除 readOnly 标志)或需要支持非 MongoDB 数据库,请避免使用。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • query_database

    Execute queries against MongoDB databases

  • create_document

    Create a new document in a MongoDB collection

  • update_document

    Update an existing document in a MongoDB collection

  • delete_document

    Delete documents from a MongoDB collection

  • list_databases

    List available MongoDB databases

  • list_collections

    List collections in a MongoDB database

  • create_index

    Create an index in a MongoDB collection

  • get_atlas_clusters

    Retrieve MongoDB Atlas clusters

  • create_atlas_cluster

    Create a new MongoDB Atlas cluster

  • get_atlas_performance

    Get performance metrics for Atlas clusters

  • get_atlas_alerts

    Retrieve Atlas alerts

  • get_database_stats

    Get statistics for a MongoDB database

说明:Tool names and descriptions were inferred from the README's structure and categories (MongoDB Atlas Tools, MongoDB Database Tools, MongoDB Assistant Tools) but exact function signatures weren't provided in the documentation. The README ment

可对比工具

supabase-mcpneon-mcppostgres-mcpredis-mcp

安装

安装

通过 NPM (适用于 Claude Desktop)

{
  "mcpServers": {
    "MongoDB": {
      "command": "npx",
      "args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

通过 Docker

{
  "mcpServers": {
    "MongoDB": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-e",
        "MDB_MCP_READ_ONLY=true",
        "-i",
        "mongodb/mongodb-mcp-server:latest"
      ]
    }
  }
}

FAQ

这个 MCP 服务器可以连接到本地 MongoDB 实例和 Atlas 集群吗?
是的,它支持使用连接字符串连接到本地 MongoDB 实例,使用连接字符串或 Atlas API 凭据连接到 MongoDB Atlas 集群。
是否提供只读模式?
是的,服务器包含 --readOnly 标志,可以添加到命令参数中,确保对数据的安全只读访问。

mongodb-mcp-server 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。