MongoDB & Mongoose

MongoDB & Mongoose

MongoDB MCP Server with Mongoose Schema and Validation.

1
Stars
2
Forks
0
Releases

Overview

MongoDB Mongoose MCP is an MCP server that lets Claude interact with MongoDB databases using either the native MongoDB driver for direct operations or Mongoose schemas for validation and hooks when available. It supports core data operations: querying (including filtering and projection), aggregation, inserting, updating, and soft deleting documents, with a clear separation between schema-based (Mongoose) and schemaless workflows. When a SCHEMA_PATH is provided, the MCP loads Mongoose models from that directory so operations benefit from defined schemas, validation, and lifecycle hooks; if no schemas are supplied, operations run directly against collections. The server exposes MCP commands such as find, listCollections, insertOne, updateOne, deleteOne (soft delete), count, and aggregate, along with index tools like createIndex, dropIndex, and indexes. Prerequisites include Node.js v18+ and MongoDB. To use with Claude Desktop, configure claude_desktop_config.json under mcpServers.mongodb-mongoose, setting MONGODB_URI and SCHEMA_PATH accordingly. A sample schema in the repo shows common fields such as isDeleted and deletedAt for soft delete, and the SCHEMA_PATH should reflect the folder containing your models (filenames matching collection names).

Details

Owner
nabid-pf
Language
TypeScript
License
Updated
2025-12-07

Features

Claude-driven MongoDB operations

Query, aggregation, insert, update, and manage MongoDB collections directly from Claude.

Optional Mongoose schema support

Supports Mongoose schemas to enable data validation and hooks when available via SCHEMA_PATH.

Soft delete

Implements soft delete for safe removal of documents.

Schema-based vs schemaless operations

Keeps schema-based (Mongoose) and schemaless operations separate for clarity and reliability.

MCP query tools

Supports MCP query and data manipulation commands: find, listCollections, insertOne, updateOne, deleteOne (soft delete), count, and aggregate.

Index management tools

Supports MCP index operations: createIndex, dropIndex, and indexes.

Tags

MongoDBMongooseMCPClaudeSchema validationSoft deleteAggregationIndexing