Mongo

by QuantGeekDev

Recommended
108 stars
2 downloads
Not rated
GitHub

About

A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.

Details

Author
QuantGeekDev
Repository
QuantGeekDev/mongo-mcp
GitHub stars
108
Downloads
2
License
MIT License
Categories
Database, Community, Other, AI
Tags
#data

- 🔍 Collection schema inspection
- 📊 Document querying and filtering
- 📈 Index management
- 📝 Document operations (insert, update, delete)

Setting up with Highlight

Follow these steps to add this server as a custom Highlight plugin:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mongo
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 mongo-mcp
    • Argument 2 mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npx by adding the server configuration to your Claude Desktop config file (MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%/Claude/claude_desktop_config.json). The command uses npx mongo-mcp "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin". Alternatively, install automatically via Smithery with npx -y @smithery/cli install mongo-mcp --client claude. Prerequisites: Node.js 18+ and npx. A local test sandbox can be set up using Docker Compose and the provided seed script.

find

Query documents with filtering and projection.

listCollections

List available collections in the database.

insertOne

Insert a single document into a collection.

updateOne

Update a single document in a collection.

deleteOne

Delete a single document from a collection.

createIndex

Create a new index on a specified field in a collection.

dropIndex

Remove an index from a collection.

indexes

List all indexes for a specified collection.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mongo": {
            "env": {},
            "args": [
                "mongo-mcp",
                "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "mongo-mcp",
        "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "mongo-mcp",
        "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "mongo-mcp",
        "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
    ],
    "command": "npx"
}

A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.

- 🔍 Collection schema inspection
- 📊 Document querying and filtering
- 📈 Index management
- 📝 Document operations (insert, update, delete)

https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe654

To get started, find your mongodb connection url and add this configuration to your Claude Desktop config file:

MacOS:~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mongodb": { "command": "npx", "args": [ "mongo-mcp", "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin" ] } } }

To install MongoDB MCP Server for Claude Desktop automatically viaSmithery:

npx -y @smithery/cli install mongo-mcp --client claude

- Node.js 18+
- npx
- Docker and Docker Compose (for local sandbox testing only)
- MCP Client (Claude Desktop App for example)

If you don't have a mongo db server to connect to and want to create a sample sandbox, follow these steps

Add this configuration to your Claude Desktop config file:

MacOS:~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mongodb": { "command": "node", "args": [ "dist/index.js", "mongodb://root:example@localhost:27017/test?authSource=admin" ] } } }

The seed script creates three collections with sample data:

- Personal info (name, email, age)
- Nested address with coordinates
- Arrays of interests
- Membership dates

- Product details (name, SKU, category)
- Nested specifications
- Price and inventory info
- Tags and ratings

- Order details with items
- User references
- Shipping and payment info
- Status tracking

Try these prompts with Claude to explore the functionality:

"What collections are available in the database?" "Show me the schema for the users collection" "Find all users in San Francisco"
"Find all electronics products that are in stock and cost less than $1000" "Show me all orders from the user john@example.com" "List the products with ratings above 4.5"
"What indexes exist on the users collection?" "Create an index on the products collection for the 'category' field" "List all indexes across all collections"
"Insert a new product with name 'Gaming Laptop' in the products collection" "Update the status of order with ID X to 'shipped'" "Find and delete all products that are out of stock"

The server provides these tools for database interaction:

- find: Query documents with filtering and projection
- listCollections: List available collections
- insertOne: Insert a single document
- updateOne: Update a single document
- deleteOne: Delete a single document

- createIndex: Create a new index
- dropIndex: Remove an index
- indexes: List indexes for a collection

This project is licensed under the MIT License - see theLICENSEfile for details.

Read and write access to Airtable databases.

BigQuery database integration with schema inspection and query capabilities

Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities

A MCP server that provides real-time cryptocurrency market data through CoinCap's public API without requiring authentication

Universal database MCP server supporting multiple database types including PostgreSQL, Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite

MCP server for autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.

Universal database MCP server supporting mainstream databases.

MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.

Leverages your Schemas and Access Patterns to interact with your DynamoDB Database using natural language.

MCP server acting as an interface to the Frankfurter API for currency exchange data.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.