MongoDB MCP Server

Integrations

  • Provides access to MongoDB collections and documents, allowing querying with filters and projections, listing collections, and retrieving documents with customizable limits.

MCP MongoDB Server

This server implements a Model Context Protocol (MCP) interface for MongoDB, allowing interaction with MongoDB collections and documents through standardized MCP requests.

Features

Resource Management

  • List Collections: Lists all MongoDB collections as MCP resources
    • Each collection is represented with a mongodb:// URI scheme
    • Returns collection names and metadata in MCP resource format

Document Operations

  • Read Documents: Retrieve documents from MongoDB collections
    • Access collections using mongodb://collection-name URI format
    • Supports filtering and projection of documents
    • Default limit of 100 documents per request

Tools

  • Query Builder: Structured querying of MongoDB collections
    • Specify collection name
    • Apply filters and projections
    • Configure result limits

Security & Logging

  • Secure MongoDB connection handling
  • Detailed operation logging to logs/server.log
  • Connection error handling and reporting
  • Input validation for collection names and queries

Configuration

  • MongoDB connection via environment variables (MONGODB_URI)
  • Configurable client options for performance and security
  • Logging system with timestamp and error tracking

Technical Details

  • Built with @modelcontextprotocol/sdk version 1.10.2
  • Uses MongoDB Node.js driver version 6.16.0
  • Implements MCP server capabilities for resources and tools

Components

Tools

  • query
    • Execute MongoDB queries with filtering and projection
    • Input parameters:
      • collection: Name of collection to query
      • filter: MongoDB query filter (optional)
      • projection: Fields to include/exclude (optional)
      • limit: Maximum number of documents to return (default 100)

Resources

The server provides access to MongoDB collections as resources:

  • Collections (mongodb://<collection-name>)
    • Each collection is exposed as a resource
    • Documents are returned in JSON format
    • Supports filtering and projection via query tool

Configuration

Usage with Claude Desktop

To use this server with Claude Desktop, add the following to your claude_desktop_config.json:

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Allows interaction with MongoDB collections and documents through standardized MCP requests, supporting operations like listing collections, reading documents with filtering, and executing structured queries.

  1. Features
    1. Resource Management
    2. Document Operations
    3. Tools
    4. Security & Logging
    5. Configuration
  2. Technical Details
    1. Components
      1. Tools
      2. Resources
    2. Configuration
      1. Usage with Claude Desktop

    Related MCP Servers

    • -
      security
      A
      license
      -
      quality
      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.
      Last updated -
      340
      75
      TypeScript
      MIT License
      • Apple
    • A
      security
      A
      license
      A
      quality
      A Model Context Protocol server that provides access to MongoDB databases. This server enables LLMs to inspect collection schemas and execute read-only queries.
      Last updated -
      8
      1,087
      174
      TypeScript
      MIT License
      • Apple
    • -
      security
      A
      license
      -
      quality
      Full featured MCP Server for MongoDB database analysis.
      Last updated -
      334
      108
      JavaScript
      MIT License
      • Apple
    • -
      security
      A
      license
      -
      quality
      An MCP server that enables users to create and manage MongoDB Atlas clusters, users, and network access through natural language commands.
      Last updated -
      254
      2
      JavaScript
      MIT License
      • Apple
      • Linux

    View all related MCP servers

    Appeared in Searches

    ID: 818ht2vxs2