logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mongo-data-accessor

Facilitates controlled interaction and structured querying of data housed within MongoDB instances via a unified protocol endpoint, encompassing capabilities for inventory traversal, data retrieval with dynamic filtering/shaping, and secure transactional execution supported by comprehensive audit trails and robust exception management.

Author

mongo-data-accessor logo

rtcface

No License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

mongodbapiscollectionsmongodb collectionsmanagement mongodbrequests rtcface

Model Context Protocol Interface for MongoDB Access

This server component establishes an MCP abstraction layer over a running MongoDB instance, enabling external agents to manipulate and inspect data collections using standardized protocol messages.

Core Capabilities

Inventory Management

  • Enumerate Collections: Provides a listing of all accessible MongoDB collections as defined MCP entities.
  • Each collection resource is resolvable via a mongodb:// Uniform Resource Identifier (URI).
  • Output conforms to MCP resource metadata structures.

Data Retrieval Operations

  • Fetch Records: Execute read operations against specified MongoDB collections.
  • Target collection identification uses the mongodb://collection-name scheme.
  • Supports parameterization for complex query predicates (filtering) and field shaping (projections).
  • Imposes a maximum record count of 100 per default retrieval call.

Exposed Tools

  • Data Query Executor: A structured mechanism for submitting complex MongoDB queries.
  • Requires specification of the target collection name.
  • Accepts optional arguments for filter (query criteria) and projection (field selection).
  • Optional limit parameter controls batch size (defaults to 100).

Reliability and Auditing

  • Secure handling of database connection credentials.
  • Comprehensive logging of all executed operations written to logs/server.log.
  • Graceful failure mechanisms for connection disruptions or query execution errors.
  • Rigorous input sanitization for collection identifiers and query syntax.

Deployment Configuration

  • Database connection string derived from the MONGODB_URI environment variable.
  • Tunable client parameters to optimize latency and connection security.
  • Timestamped logging framework capturing operational flow and diagnostics.

Technical Underpinnings

  • Implemented using @modelcontextprotocol/sdk build version 1.10.2.
  • Leverages MongoDB Node.js Driver version 6.16.0.
  • Fully adheres to MCP server specifications for tool and resource exposure.

Exposed Abstractions

Operational Tools

  • query
  • Functionality: Executes complex read operations against collections, applying filtering and projection rules.
  • Parameters:
    • collection: String, mandatory name of the target database collection.
    • filter: Optional JSON object representing the MongoDB query predicate.
    • projection: Optional JSON object specifying field inclusion/exclusion.
    • limit: Optional integer specifying the maximum document count (default 100).

Represented Resources

The server exposes MongoDB collections as addressable resources:

  • Collections (mongodb://<collection-name>)
  • Each collection maps directly to an MCP resource endpoint.
  • Document payloads are transmitted in standard JSON encoding.
  • Filtering and shaping logic is primarily engaged through the dedicated query tool.

Integration Notes (Claude Desktop)

To activate this accessor within your local Claude Desktop environment, integrate the following configuration stanza into your claude_desktop_config.json file:

See Also

`