mcpField
M
MongoDB MCP Server

MongoDB MCP Server

Local
github.com/PrashantSedhainDatabases3Updated 82w ago

About MongoDB MCP Server

MongoDB MCP Server connects MongoDB to MCP clients and command-line integrations through a read-only query tool. It also includes a client application and utilities for connection and transaction management.

Key features

  1. 01Read-only queries against MongoDB collections
  2. 02MongoDB connection utilities
  3. 03Transaction management utilities
  4. 04Included client application

Use cases

  1. 01Retrieve data from MongoDB collections
  2. 02Connect local integrations to MongoDB
  3. 03Run queries through a command-line client

MCP support

The MCP server exposes a `query` tool for retrieving data from MongoDB collections. It currently supports read-only transactions.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MongoDB MCP Server

A Model Context Protocol (MCP) server for MongoDB that allows querying MongoDB collections through a simple interface for local integrations and command line tools.

Overview

This project implements an MCP server that connects to MongoDB and provides a query tool to retrieve data from collections. It currently only supports read-only transactions. Project includes:

  • A MongoDB MCP server that exposes database querying capabilities
  • A client application for interacting with the server
  • Utilities for MongoDB connection and transaction management

Prerequisites

  • Node.js (v16 or higher)
  • npm
  • MongoDB database (local or cloud-based)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/mongo-db-mcp.git
    cd mongo-db-mcp
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file in the root directory with your MongoDB connection string:

    MONGO_CONNECTION_STRING=your_mongodb_connection_string
    

Building the Project

Build the TypeScript code:

npm run build

Running the client

node dist/client/client.js dist/index.js

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.