mongodb-mcp-server
by mongodb-js·★ 1,023·综合分 55
MongoDB MCP Server 连接 MongoDB 数据库和 Atlas 集群,提供数据库操作和 Atlas 管理工具。
概述
MongoDB MCP Server 是一个通过模型上下文协议与 MongoDB 数据库交互的综合实现。它提供三类工具:MongoDB Atlas 工具用于集群管理,MongoDB 数据库工具用于 CRUD 操作,以及 MongoDB Assistant 工具用于高级功能。服务器支持多种身份验证方法,包括直接连接字符串和 Atlas API 凭据,并具有只读模式等内置安全功能。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您使用 MongoDB 数据库或 Atlas 集群,并且需要安全地让 AI 访问您的数据而不构建自定义集成时选择此工具。
什么时候不要选它
如果您默认需要写访问权限(必须明确移除 readOnly 标志)或需要支持非 MongoDB 数据库,请避免使用。
此 server 暴露的工具
从 README 抽取出 12 个工具query_databaseExecute queries against MongoDB databases
create_documentCreate a new document in a MongoDB collection
update_documentUpdate an existing document in a MongoDB collection
delete_documentDelete documents from a MongoDB collection
list_databasesList available MongoDB databases
list_collectionsList collections in a MongoDB database
create_indexCreate an index in a MongoDB collection
get_atlas_clustersRetrieve MongoDB Atlas clusters
create_atlas_clusterCreate a new MongoDB Atlas cluster
get_atlas_performanceGet performance metrics for Atlas clusters
get_atlas_alertsRetrieve Atlas alerts
get_database_statsGet 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
可对比工具
安装
安装
通过 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 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。