使用说明

项目简介

这是一个 MongoDB Atlas MCP Server PoC (概念验证),旨在通过 Model Context Protocol (MCP) 协议,为 LLM 客户端提供访问 MongoDB Atlas 资源的能力。它允许用户通过工具调用,获取 MongoDB Atlas 的项目和集群信息。

主要功能点

  • 资源访问: 提供访问 MongoDB Atlas 项目和集群信息的能力。
  • 工具集成: 已集成 'auth' (身份验证), 'list-clusters' (列出集群), 'list-projects' (列出项目) 工具。
  • OAuth 认证: 使用 OAuth Device Code 流程进行 MongoDB Atlas 身份验证。

安装步骤

  1. 确保已安装 Node.js 和 npm。
  2. 克隆仓库到本地。
  3. 在仓库根目录下运行 'npm install' 安装依赖。
  4. 运行 'npm run build' 构建服务器。

服务器配置

MCP 客户端需要配置以下 JSON 信息以连接到 MongoDB Atlas MCP Server。假设服务器启动命令为 'node dist/index.js':

{
  "servers": {
    "mongodb-atlas": { // 服务器名称,可以自定义
      "type": "stdio",  // 使用 Stdio 传输协议
      "command": "/path/to/mongodb-mcp-server/dist/index.js", // MCP 服务器启动命令的绝对路径,请替换为实际路径
      "args": []        // 启动参数,本服务器无需参数
    }
  }
}

基本使用方法

  1. 在 MCP 客户端(如 VSCode 或 Claude)中添加上述服务器配置。
  2. 在客户端中,可以使用集成的工具来与 MongoDB Atlas 进行交互。例如:
    • 使用 'auth' 工具进行身份验证。
    • 使用 'list-projects' 工具列出 MongoDB Atlas 项目。
    • 使用 'list-clusters' 工具列出 MongoDB Atlas 集群。

信息

分类

数据库与文件