Connections & Capabilities
Connects To
Capabilities
Quickstart
Install
npx -y mcp-mongo-server mongodb://localhost:27017/databaseConfig
{
"mcpServers": {
"mongodb-env": {
"command": "npx",
"args": [
"-y",
"mcp-mongo-server"
],
"env": {
"MCP_MONGODB_URI": "mongodb://muhammed:kilic@localhost:27017/database",
"MCP_MONGODB_READONLY": "true"
}
}
}
}Exposed MCP Tools (5)
queryExecutes a MongoDB query against a specified collection.
Read-only operation if read-only mode is enabled.
aggregateExecutes a MongoDB aggregation pipeline against a specified collection.
Read-only operation if read-only mode is enabled.
updateUpdates documents in a MongoDB collection based on a query.
Modifies existing data; potential for data corruption.
insertInserts new documents into a MongoDB collection.
Adds new data to the database.
index creationCreates indexes on MongoDB collections.
Modifies the database schema and can impact performance.
Safety Assessment
This server is relatively safe in read-only mode, allowing data exploration without modification. However, when write operations are enabled, the risk increases significantly, requiring careful management of permissions and query construction to prevent unintended data manipulation or exposure.
- Configurable read-only mode to prevent accidental writes.
- Schema inference helps understand data structure before interaction.
- ObjectId handling prevents common data type errors.
- Verified on MseeP
- Write operations are possible when not in read-only mode.
- Direct access to MongoDB database, requires careful URI management.
- No built-in RBAC; relies on MongoDB's own security.
- Potential for data exfiltration if queries are not carefully constructed.
- Environment variables used for configuration can be exposed.
