MongoDB 官方服务器,支持查询和管理 MongoDB 数据库与 Atlas 集群,可通过参数开启只读模式。
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add mongodb -- npx -y mongodb-mcp-server@latest --readOnly~/.codex/config.toml
[mcp_servers.mongodb]
command = "npx"
args = ["-y", "mongodb-mcp-server@latest", "--readOnly"]
# codex mcp add mongodb -- npx -y mongodb-mcp-server@latest --readOnly~/.cursor/mcp.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}.vscode/mcp.json
{
"servers": {
"mongodb": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server@latest",
"--readOnly"
]
}
}
}