Integrations
Enables direct interaction with MongoDB databases, offering tools for collection schema inspection, document querying and filtering, index management, and document operations (insertion, updates, deletion).
🗄️ LLMS 的 MongoDB MCP 服务器
模型上下文协议 (MCP) 服务器,使 LLM 能够直接与 MongoDB 数据库交互。通过自然语言无缝查询集合、检查架构并管理数据。
✨ 特点
- 🔍 集合模式检查
- 📊 文档查询和过滤
- 📈 索引管理
- 📝 文档操作(插入、更新、删除)
演示视频
https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe654
🚀 快速入门
首先,找到您的 mongodb 连接 URL,并将此配置添加到您的 Claude Desktop 配置文件中:
MacOS : ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows : %APPDATA%/Claude/claude_desktop_config.json
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 MongoDB MCP 服务器:
先决条件
- Node.js 18+
- NPX
- Docker 和 Docker Compose(仅用于本地沙盒测试)
- MCP 客户端(例如 Claude 桌面应用程序)
测试沙盒设置
如果您没有可连接的 Mongo DB 服务器,并且想要创建示例沙箱,请按照以下步骤操作
- 使用 Docker Compose 启动 MongoDB:
- 使用测试数据填充数据库:
配置 Claude 桌面
将此配置添加到您的 Claude Desktop 配置文件:
MacOS : ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows : %APPDATA%/Claude/claude_desktop_config.json
本地开发模式:
测试沙盒数据结构
种子脚本使用示例数据创建三个集合:
用户
- 个人信息(姓名、电子邮件、年龄)
- 嵌套地址及坐标
- 一系列的兴趣
- 会员日期
产品
- 产品详情(名称、SKU、类别)
- 嵌套规范
- 价格和库存信息
- 标签和评分
订单
- 订单详情及商品
- 用户参考
- 运输和付款信息
- 状态跟踪
🎯 示例提示
尝试与 Claude 一起执行这些提示来探索其功能:
基本操作
高级查询
指数管理
文档操作
📝 可用工具
服务器提供了以下用于数据库交互的工具:
查询工具
find
:使用过滤和投影查询文档listCollections
:列出可用的集合insertOne
:插入单个文档updateOne
:更新单个文档deleteOne
:删除单个文档
索引工具
createIndex
:创建新索引dropIndex
:删除索引indexes
:列出集合的索引
📜 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
模型上下文协议服务器使 LLM 能够直接与 MongoDB 数据库交互,从而允许用户通过自然语言查询集合、检查模式和管理数据。