Skip to content
Back to search

mongo-mcp

A mongo db server for the model context protocol (MCP)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/quantgeekdev--mongo-mcp/badge.svg)](/listings/quantgeekdev--mongo-mcp)

HTML

<a href="/listings/quantgeekdev--mongo-mcp"><img src="/api/listings/quantgeekdev--mongo-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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"
      ]
    }
  }
}

Installing via Smithery

To install MongoDB MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mongo-mcp):

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

Prerequisites

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

Test Sandbox Setup

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

1. Start MongoDB using Docker Compose:

docker-compose up -d

2. Seed the database with test data:

npm run seed

Configure Claude Desktop

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`

Local Development Mode:

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

Test Sandbox Data Structure

The seed script creates three collections with sample data:

Users

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

Products

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

Orders

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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 180 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # 🗄️ MongoDB MCP Server for LLMS
  2. [![Node.js 18+](https://img.shields.io/badge/node-18%2B-blue.svg)](https://nodejs.org/en/)
  3. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  4. [![smithery badge](https://smithery.ai/badge/mongo-mcp)](https://smithery.ai/server/mongo-mcp)
  5. 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.
  6. ## ✨ Features
  7. - 🔍 Collection schema inspection
  8. - 📊 Document querying and filtering
  9. - 📈 Index management
  10. - 📝 Document operations (insert, update, delete)
  11. ## Demo Video
  12. https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe654
  13. ## 🚀 Quick Start
  14. To get started, find your mongodb connection url and add this configuration to your Claude Desktop config file:
  15. **MacOS**: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
  16. **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
  17. ```json
  18. {
  19. "mcpServers": {
  20. "mongodb": {
  21. "command": "npx",
  22. "args": [
  23. "mongo-mcp",
  24. "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
  25. ]
  26. }
  27. }
  28. }
  29. ```
  30. ### Installing via Smithery
  31. To install MongoDB MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mongo-mcp):
  32. ```bash
  33. npx -y @smithery/cli install mongo-mcp --client claude
  34. ```
  35. ### Prerequisites
  36. - Node.js 18+
  37. - npx
  38. - Docker and Docker Compose (for local sandbox testing only)
  39. - MCP Client (Claude Desktop App for example)
  40. ### Test Sandbox Setup
  41. If you don't have a mongo db server to connect to and want to create a sample sandbox, follow these steps
  42. 1. Start MongoDB using Docker Compose:
  43. ```bash
  44. docker-compose up -d
  45. ```
  46. 2. Seed the database with test data:
  47. ```bash
  48. npm run seed
  49. ```
  50. ### Configure Claude Desktop
  51. Add this configuration to your Claude Desktop config file:
  52. **MacOS**: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
  53. **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
  54. #### Local Development Mode:
  55. ```json
  56. {
  57. "mcpServers": {
  58. "mongodb": {
  59. "command": "node",
  60. "args": [
  61. "dist/index.js",
  62. "mongodb://root:example@localhost:27017/test?authSource=admin"
  63. ]
  64. }
  65. }
  66. }
  67. ```
  68. ### Test Sandbox Data Structure
  69. The seed script creates three collections with sample data:
  70. #### Users
  71. - Personal info (name, email, age)
  72. - Nested address with coordinates
  73. - Arrays of interests
  74. - Membership dates
  75. #### Products
  76. - Product details (name, SKU, category)
  77. - Nested specifications
  78. - Price and inventory info
  79. - Tags and ratings
  80. #### Orders
  81. - Order details with items
  82. - User references
  83. - Shipping and payment info
  84. - Status tracking
  85. ## 🎯 Example Prompts
  86. Try these prompts with Claude to explore the functionality:
  87. ### Basic Operations
  88. ```plaintext
  89. "What collections are available in the database?"
  90. "Show me the schema for the users collection"
  91. "Find all users in San Francisco"
  92. ```
  93. ### Advanced Queries
  94. ```plaintext
  95. "Find all electronics products that are in stock and cost less than $1000"
  96. "Show me all orders from the user john@example.com"
  97. "List the products with ratings above 4.5"
  98. ```
  99. ### Index Management
  100. ```plaintext
  101. "What indexes exist on the users collection?"
  102. "Create an index on the products collection for the 'category' field"
  103. "List all indexes across all collections"
  104. ```
  105. ### Document Operations
  106. ```plaintext
  107. "Insert a new product with name 'Gaming Laptop' in the products collection"
  108. "Update the status of order with ID X to 'shipped'"
  109. "Find and delete all products that are out of stock"
  110. ```
  111. ## 📝 Available Tools
  112. The server provides these tools for database interaction:
  113. ### Query Tools
  114. - `find`: Query documents with filtering and projection
  115. - `listCollections`: List available collections
  116. - `insertOne`: Insert a single document
  117. - `updateOne`: Update a single document
  118. - `deleteOne`: Delete a single document
  119. ### Index Tools
  120. - `createIndex`: Create a new index
  121. - `dropIndex`: Remove an index
  122. - `indexes`: List indexes for a collection
  123. ## 📜 License
  124. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.