MongoDB MCP Server πŸš€

by syedasad-kiwi

215 downloads Not rated yet MIT license
GitHub

About

A powerful Model Context Protocol (MCP) server implementation for MongoDB integration

Details

License
MIT license

Explore

- πŸ”„ Full MongoDB CRUD operations support
- πŸ” Secure connection handling with MongoDB Atlas
- 🚦 Async/await patterns for optimal performance
- πŸ›‘οΈ Comprehensive error handling
- πŸ“¦ Docker support for easy deployment
- πŸ” Query execution with proper type hints

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  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 MongoDB MCP Server πŸš€
    Command (node, npx, python, etc.)

    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

Set these environment variables before running the server:


Add this to your VS Code settings.json:

json
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "mongodbUri",
"description": "MongoDB Connection URI"
}
],
"servers": {
"mongodb": {
"command": "uvx",
"args": ["mongodb-mcp-bridge", "--transport=sse"],
"env": {
"MONGODB_URI": "$(mongodbUri)"
}
}
}
}
}

For Cursor or Windsurf, configure the MCP server with:

json
{
"mcp": {
"servers": {
"mongodb": {
"url": "http://localhost:6274"
}
}
}
}

Using the MCP Inspector (http://127.0.0.1:6274):

json
// List all databases
{
"tool": "list_databases"
}

// Find documents in a collection
{
"tool": "find_documents",
"database": "your_database",
"collection": "your_collection",
"query": {"status": "active"},
"limit": 5
}
```

database

Database name

collection

Collection name

query

MongoDB query object (optional)

limit

Maximum number of documents to return (default: 10)

1. ping
- Quick connection test to verify MongoDB connectivity

2. list_databases
- List all available databases in the MongoDB instance

3. find_documents
- Query documents in a collection with filtering options
- Parameters:
- database: Database name
- collection: Collection name
- query: MongoDB query object (optional)
- limit: Maximum number of documents to return (default: 10)

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "mongodb mcp server \ud83d\ude80": {
            "mongodb-mcp-bridge": {
                "command": "uvx",
                "args": [
                    "mongodb-mcp-bridge"
                ]
            }
        }
    }
}

McpServers

{
    "mongodb-mcp-bridge": {
        "command": "uvx",
        "args": [
            "mongodb-mcp-bridge"
        ]
    }
}

A powerful Model Context Protocol (MCP) server implementation for MongoDB integration, providing seamless interaction with MongoDB databases through a standardized protocol.

🌟 Author

Syed Asad

πŸ“‹ Overview

This MCP server implementation provides a robust interface for interacting with MongoDB databases through the Model Context Protocol. It supports operations on databases, collections, and documents with proper async/await patterns and error handling.

✨ Features

- πŸ”„ Full MongoDB CRUD operations support
- πŸ” Secure connection handling with MongoDB Atlas
- 🚦 Async/await patterns for optimal performance
- πŸ›‘οΈ Comprehensive error handling
- πŸ“¦ Docker support for easy deployment
- πŸ” Query execution with proper type hints

πŸš€ Quick Start

Using uvx (Python)

```bash

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.