npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mongodb-mcp-bridge

v0.1.0

Published

MCP server implementation for MongoDB integration

Readme

MongoDB MCP Server 🚀

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)

# Run directly with uvx
uvx mongodb-mcp-bridge

# With SSE transport for remote connections
uvx mongodb-mcp-bridge --transport=sse

Using npx (Node.js)

# Run directly with npx
npx mongodb-mcp-bridge

# With SSE transport for remote connections
npx mongodb-mcp-bridge --transport=sse

Environment Variables

Set these environment variables before running the server:

# Required
MONGODB_URI="your_mongodb_connection_string"

# Optional
MONGODB_DB="default_database_name"
MCP_PORT="6274"  # Default port for MCP Inspector

Using Docker 🐳

# Build the Docker image
docker build -t mongodb-mcp-server .

# Run the container
docker run -e MONGODB_URI="your_mongodb_uri" -p 6274:6274 mongodb-mcp-server

🔗 IDE Integration

VS Code Setup

Add this to your VS Code settings.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)"
        }
      }
    }
  }
}

Cursor/Windsurf Setup

For Cursor or Windsurf, configure the MCP server with:

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

📚 Available Tools

  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)

🔍 Example Usage

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

// 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
}

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

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

🙏 Acknowledgments

  • Model Context Protocol (MCP) team for the protocol specification
  • MongoDB team for the excellent database and drivers
  • All contributors and users of this project

Made with ❤️ by Syed Asad