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

mcp-data-accessor-service

Facilitates natural language interaction with backend data stores, enabling fundamental CRUD (Create, Read, Update, Delete) and aggregation tasks. Initially supports document databases like MongoDB, with future expansion targeting relational systems (PostgreSQL) and high-speed key-value stores (Redis, CockroachDB).

Author

mcp-data-accessor-service logo

manpreet2000

MIT License

Quick Info

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

Tags

mongodbdatabasesdatabaseintegrates mongodbmongodb plansmcp database

MCP Data Accessor Utility

This implements a Model Context Protocol (MCP) server designed to translate instructions from Large Language Models (LLMs) into executable database operations using plain English.

Presently configured for MongoDB persistence layer access. Upcoming features will incorporate:

  • PostgreSQL connectivity
  • CockroachDB functionality
  • Redis interfacing
  • Further extensions...

Core Capabilities

  • Execution of database maneuvers via textual commands.
  • Current MongoDB tooling supports:
  • Enumerating available data collections.
  • Fetching records via flexible criteria (filtering/field selection).
  • Introducing new document entries.
  • Erasing matching records.
  • Running complex data aggregation routines.
  • Planned support for heterogeneous backends:
  • PostgreSQL: Facilitating standard SQL interactions and schema manipulation.
  • CockroachDB: Handling distributed SQL workflows and transactional integrity.
  • Redis: Managing key-value pairs and implementing caching layers.

System Requirements

  • Runtime environment: Node.js version 20.12.2 or newer.
  • A provisioned database instance (MongoDB active; others pending).
  • Access to the Claude Desktop Client application.

Setup Procedure

  1. Obtain the source code repository:
git clone https://github.com/manpreet2000/mcp-database-server.git
cd mcp-database-server
  1. Install required software packages:
npm install
  1. Compile the TypeScript source files:
npm run build

Configuration Guide

To enable the service within your Claude Desktop environment, modify the configuration file located at the path corresponding to your operating system:

macOS Path

~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows Path

%APPDATA%/Claude/claude_desktop_config.json

Integrate the following structure into your claude_desktop_config.json:

{
  "mcpServers": {
    "database": {
      "command": "/path/to/node",
      "args": ["/path/to/mcp-database/dist/index.js"],
      "env": {
        "MONGODB_URI": "your-mongodb-connection-string"
      }
    }
  }
}

Please substitute the placeholders:

  • /path/to/node: Use the full path to your Node.js executable, or simply node if it is in your system PATH.
  • /path/to/mcp-database: The absolute directory location of this cloned project.
  • your-mongodb-connection-string: Your specific MongoDB connection URL.

Operational Examples

MongoDB Interactions

  1. Requesting a list of all active data collections:
Could you show me all the collections in my database?
  1. Retrieving a subset of entries from a specified collection:
Give me 2 records from the chargers collection
  1. Filtering results based on criteria:
Show me all documents in the users collection where status is active
  1. Adding a new data entry:
Add a new user to the users collection with name John and email john@example.com
  1. Removing a matching entry:
Remove the user with email john@example.com from the users collection
  1. Summarizing data via aggregation:
Show me the total count of users by status in the users collection

Exposed Tool Functions

1. getCollections

Lists every collection present in the presently linked data source.

2. getCollection

Fetches records from a designated collection, allowing optional constraints:

  • collectionName: Identifier for the target collection.
  • limit: Upper bound on the number of returned documents (default: 10, max: 1000).
  • query: A JSON object specifying filtering conditions.
  • projection: A JSON object defining fields to include or omit.

3. insertOne

Inserts a single new record into a collection:

  • collectionName: Target collection identifier.
  • document: The object payload to be written.

4. deleteOne

Eliminates the first document that satisfies the specified matching criteria:

  • collectionName: Target collection identifier.
  • query: The predicate used to locate the document for removal.

5. aggregate

Executes a multi-stage aggregation sequence:

  • collectionName: Target collection identifier.
  • pipeline: An array representing the sequence of aggregation stages.
  • options: Supplementary configuration parameters for the aggregation run.

Planned Data Store Expansion

PostgreSQL

  • Execution of arbitrary SQL statements.
  • Table schema administration tasks.
  • Support for ACID transactions.

CockroachDB

  • Workflows for distributed SQL operations.
  • Multi-region deployment handling.
  • Schema evolution management.

Redis

  • Basic key-value read/write operations.
  • Utility functions for cache invalidation/management.
  • Support for Pub/Sub messaging patterns.
  • Interaction with advanced data structures (Lists, Sets, Hashes).

Security Directives

  • Strictly avoid storing sensitive credentials (connection URIs) within version control systems.
  • Rely exclusively on environmental variables for secret management.
  • Adhere to the specific security guidelines of each connected database system.

Community Involvement

We welcome external contributions! Feel encouraged to propose changes via Pull Requests. For significant architectural modifications, kindly open an issue beforehand to initiate discussion.

Licensing

Distributed under the MIT License. Refer to the LICENSE file for specifics.

See Also

`