JUHE API Marketplace
Dwhyte avatar
MCP Server

MCP MongoDB Server

An MCP server that provides tools to query and interact with MongoDB user collections, supporting filtering, sorting, and retrieval operations.

0
GitHub Stars
3/14/2026
Last Updated
No Configuration
Please check the documentation below.
  1. Home
  2. MCP Servers
  3. mcp-mongodb

README Documentation

MCP MongoDB Server

An MCP (Model Context Protocol) server that provides tools to interact with MongoDB databases, specifically designed to query user collections.

Features

  • Query Users: Search and filter users with MongoDB queries
  • Get User by ID: Retrieve specific users by their ID
  • Count Users: Get total count of users with optional filtering
  • Flexible Filtering: Support for MongoDB query operators
  • Sorting and Projection: Advanced query capabilities

Prerequisites

  • Node.js 18+
  • MongoDB instance (local or cloud)
  • TypeScript knowledge

Installation

  1. Install dependencies:

    npm install
    
  2. Set up environment variables:

    cp .env.example .env
    

    Edit .env with your MongoDB connection details:

    MONGODB_URI=mongodb://localhost:27017
    MONGODB_DB_NAME=your_database_name
    
  3. Build the project:

    npm run build
    

Usage

Starting the Server

npm start

Or for development with auto-reload:

npm run dev

Available Tools

1. query_users

Query users with optional filters, sorting, and projection.

Parameters:

  • filter (object, optional): MongoDB filter object
  • limit (number, optional): Maximum results (default: 10)
  • sort (object, optional): Sort criteria
  • projection (object, optional): Fields to include/exclude

Example:

{
  "filter": {"age": {"$gte": 25}},
  "limit": 5,
  "sort": {"name": 1},
  "projection": {"_id": 1, "name": 1, "email": 1}
}
2. get_user_by_id

Retrieve a specific user by their ID.

Parameters:

  • userId (string, required): The user ID to search for

Example:

{
  "userId": "507f1f77bcf86cd799439011"
}
3. count_users

Count total users with optional filtering.

Parameters:

  • filter (object, optional): MongoDB filter object

Example:

{
  "filter": {"status": "active"}
}

MongoDB Connection

The server supports various MongoDB connection types:

Local MongoDB

MONGODB_URI=mongodb://localhost:27017
MONGODB_DB_NAME=myapp

MongoDB with Authentication

MONGODB_URI=mongodb://username:password@localhost:27017/myapp
MONGODB_DB_NAME=myapp

MongoDB Atlas

MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/myapp
MONGODB_DB_NAME=myapp

Development

Project Structure

├─

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.aiFeatured on ShowMeBestAI
Copyright © 2026 JUHEDATA HK LIMITED - All rights reserved