MongoDB MCP Server
@mongodb-js
关于 MongoDB MCP Server
A Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:[email protected]/myDatabase"
}
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is MongoDB MCP Server?
It is a Model Context Protocol server for interacting with MongoDB databases and MongoDB Atlas. It allows AI assistants to perform read‑only (or optionally write) database operations and manage Atlas resources using either a MongoDB connection string or Atlas API service account credentials.
How to use MongoDB MCP Server?
Requires Node.js v22.13 or later. Configure it in your MCP client (e.g., VS Code, Cursor, Claude Desktop) by running npx -y mongodb-mcp-server@latest with the --readOnly flag by default. Pass credentials via environment variables (MDB_MCP_CONNECTION_STRING or MDB_MCP_API_CLIENT_ID/MDB_MCP_API_CLIENT_SECRET). Docker images are also available.
Key features of MongoDB MCP Server
- Supports MongoDB Atlas tools (API‑based) and database tools (driver‑based).
- Provides MongoDB assistant tools for common help tasks.
- Reads database schemas, collections, and indexes as resources.
- Configurable via environment variables, command‑line arguments, or MCP client configuration.
- Runs as a standalone service or inside a Docker container.
- Defaults to read‑only mode; remove
--readOnlyto enable writes.
Use cases of MongoDB MCP Server
- Query and explore MongoDB databases through a conversational AI assistant.
- Manage Atlas clusters, projects, and API keys using service account credentials.
- Retrieve database schemas and indexes for documentation or migration planning.
- Deploy as a microservice on public clouds such as Azure.
FAQ from MongoDB MCP Server
What are the prerequisites to run MongoDB MCP Server?
Node.js v22.13 or later is required. A MongoDB connection string or Atlas API service account credentials must be provided.
Is the server read‑only by default?
Yes. All configuration examples include the --readOnly flag. Remove it if you need write operations.
Can I run MongoDB MCP Server using Docker?
Yes. A Docker image mongodb/mongodb-mcp-server:latest is available. Pass environment variables via -e flags or through an MCP configuration file.
How do I pass credentials securely?
The README strongly recommends using environment variables (MDB_MCP_CONNECTION_STRING, MDB_MCP_API_CLIENT_ID, MDB_MCP_API_CLIENT_SECRET) instead of command‑line arguments to avoid exposing secrets in process lists or logs.
Which MCP clients are supported?
Configuration examples are provided for Windsurf, VS Code, Claude Desktop, Cursor, Copilot CLI, and Opencode CLI.
数据库 分类下的更多 MCP 服务器
Neon MCP Server
neondatabaseMCP server for interacting with Neon Management API and databases
PostgreSQL Model Context Protocol (PG-MCP) Server
stuzeroChroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma

Sqlite
modelcontextprotocolModel Context Protocol Servers
评论