MongoDB Mongoose MCP is an MCP server that connects Claude and other Model Context Protocol clients directly to MongoDB databases, offering optional support for Mongoose schemas. Database administrators, backend engineers, and data analysts use this server to inspect collections, run complex queries, manage documents, and maintain indexes through natural language workflows. The server combines the native MongoDB driver for standard operations with Mongoose to enable schema-driven validation and hooks whenever schema definitions are supplied. In addition to standard CRUD commands like find, insertOne, updateOne, and aggregate pipelines, it implements soft deletes to protect document safety during deletions. Users can query data without writing manual MongoDB shell commands while maintaining separation between schemaless flexibility and structured data enforcement. By bridging LLMs with MongoDB databases, it simplifies data inspection, operational monitoring, and database management tasks directly within assistant interfaces.
Category: Databases & Data Stores
Tags: database, mongodb, mongoose, nosql
To integrate MongoDB Mongoose MCP with Claude Desktop, complete the following steps: 1. Ensure you have Node.js version 18 or higher installed on your system. 2. Open Claude Desktop, navigate to Settings, then Developer, and click Edit config to open claude_desktop_config.json. 3. Add the server definition inside the mcpServers object: json { "mcpServers": { "mongodb-mongoose": { "command": "npx", "args": [ "-y", "mongo-mongoose-mcp" ], "env": { "MONGODB_URI": "<your mongodb uri>", "SCHEMA_PATH": "<path to the root folder of all your mongoose schema objects>" } } } } 4. Replace <your mongodb uri> with your actual connection string and set <path to the root folder of all your mongoose schema objects> to point to your schema files. 5. Save the configuration file and restart Claude Desktop.
Part of MCP Servers
You can run it directly via npx without a manual global installation. In Claude Desktop, add an entry to your configuration file pointing to the npx command with the mongo-mongoose-mcp package, supplying your connection string in the MONGODB_URI environment variable and optionally defining SCHEMA_PATH for your models directory.
The server provides tools to list collections, count documents, find records with filters and projections, insert documents, update records, and run aggregation pipelines. It also supports index management, including listing, creating, and dropping indexes, and integrates soft deletions for safe data handling.
It works with Claude Desktop through standard configuration files and can be tested using the MCP inspector tool. Any client supporting the Model Context Protocol that can launch local stdio processes with Node.js can connect to the server.
No, Mongoose schemas are optional. You can use the server for schemaless MongoDB operations using the native driver, or configure the SCHEMA_PATH environment variable to point to schema files if you want validation and hooks applied.
Yes, MongoDB Mongoose MCP is open source software released under the MIT license. You can view the code, report issues, and contribute on its GitHub repository.