Loading...

MCP MongoDB Server bridges LLMs and MongoDB, enabling schema inspection, data querying, and manipulation with configurable read-only mode and ObjectId handling.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
MCP MongoDB Server bridges LLMs and MongoDB, enabling schema inspection, data querying, and manipulation with configurable read-only mode and ObjectId handling.
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.
Performance depends on the complexity of the queries and the size of the data. Indexing can significantly improve query performance.
Cost depends on the MongoDB hosting environment and the volume of data processed. Complex aggregations can be resource-intensive.
npx -y mcp-mongo-server mongodb://localhost:27017/database{
"mcpServers": {
"mongodb-env": {
"command": "npx",
"args": [
"-y",
"mcp-mongo-server"
],
"env": {
"MCP_MONGODB_URI": "mongodb://muhammed:kilic@localhost:27017/database",
"MCP_MONGODB_READONLY": "true"
}
}
}
}MCP_MONGODB_URIqueryExecutes 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.
Environment Variable
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.
Autonomy depends on the configured permissions and the specific tools used. Read-only mode provides a degree of safety, but write operations require careful consideration.
Production Tip
Always start in read-only mode and carefully evaluate the impact of write operations before enabling them in production.
The server likely supports recent MongoDB versions, but specific compatibility information is not provided.
Set the `MCP_MONGODB_READONLY` environment variable to `true` or use the `--read-only` flag when starting the server.
Yes, as long as you provide a valid MongoDB URI to your Atlas instance.
Use environment variables and ensure your environment is properly secured. Avoid hardcoding the URI in your application.
Connection pooling is likely handled by the underlying MongoDB driver, but specific details are not provided.
The server offers configurable modes (auto/none/force) for string-to-ObjectId conversion. Choose the mode that best suits your data and application needs.
Resource limits would need to be configured within the MongoDB instance itself, as this server does not provide its own resource management.