MCP MongoDB Server

MCP MongoDB Server

mcpmongo•bythe-sukhsingh

An MCP server that exposes MongoDB CRUD and collection operations as tools, paired with a terminal Gemini chatbot client for database interaction.

License: ISC•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Exposes MongoDB operations as MCP tools, including find, insert, update, delete, aggregate, and count.
  • •Provides collection management tools to list and create collections.
  • •Connects to MongoDB using a configured URI and database name.
  • •Communicates with clients over Server-Sent Events and works with a Gemini AI client that decides when to call MongoDB tools.

BEST FOR

  • •Querying and modifying MongoDB data through an AI assistant chat interface.
  • •Running aggregation pipelines and counting documents via MCP tool calls.
  • •Building AI assistants that need full CRUD access to a MongoDB database.

ABOUT MCPMONGO

MCP MongoDB Server is cataloged as an MCP server attributed to the-sukhsingh. An MCP server that exposes MongoDB CRUD and collection operations as tools, paired with a terminal Gemini chatbot client for database interaction. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: ISC. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP MongoDB Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the client communicate with the MCP server?

The client connects to the MCP server via Server-Sent Events (SSE).

Who decides when MongoDB tools are used?

User queries go to Gemini AI, which decides when to use MongoDB tools, and tool calls are forwarded to the MCP server for execution.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 234d2533fe44 · 采集于 2026-11-13 12:31:21 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP MongoDB Integration

This project demonstrates the integration of MongoDB with the Model Context Protocol (MCP) to provide AI assistants with database interaction capabilities. It consists of two main components:

  1. MCP MongoDB Server - A server that exposes MongoDB operations as MCP tools
  2. Client-side Gemini Integration - A terminal-based chatbot that uses Google's Gemini AI with access to MongoDB tools

Project Structure

.
├── client-side/            # Client application using Gemini AI
│   ├── index.js            # Main client application
│   └── package.json        # Client dependencies
└── mcp-mongo-project/      # MCP server with MongoDB tools
    ├── src/
    │   ├── index.js        # Server setup and tool definitions
    │   └── services/
    │       └── mcp-service.js  # MongoDB service implementation
    └── package.json        # Server dependencies

Features

  • MongoDB Integration: Full CRUD operations exposed as MCP tools
  • MCP Server: Implements the Model Context Protocol for AI tool use
  • Gemini AI Integration: Connects to Google's Gemini models
  • Terminal Chatbot: Interactive chat interface for database operations

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB instance (local or remote)
  • Google Gemini API key

Function Calling Overview

Setup Instructions

1. Server Setup

# Navigate to the server directory
cd mcp-mongo-project

# Install dependencies
npm install

# Create a .env file with your MongoDB connection details
echo "MONGODB_URI=mongodb://localhost:27017" > .env
echo "MONGODB_NAME=your_database_name" >> .env

# Start the server
npm start

2. Client Setup

# Navigate to the client directory
cd client-side

# Install dependencies
npm install

# Create a .env file with your Gemini API key
echo "GEMINI_API_KEY=your_gemini_api_key" > .env

# Start the client
node index.js

Available MongoDB Tools

The MCP server exposes the following MongoDB operations as tools:

  • findDocuments: Query documents in a collection
  • findOneDocument: Find a single document
  • insertOneDocument: Insert a document
  • insertManyDocuments: Insert multiple documents
  • updateOneDocument: Update a single document
  • updateManyDocuments: Update multiple documents
  • deleteOneDocument: Delete a document
  • deleteManyDocuments: Delete multiple documents
  • aggregateDocuments: Run aggregation pipelines
  • countDocuments: Count documents in a collection
  • listCollections: List all collections
  • createCollection: Create a new collection

Usage Examples

Once both the server and client are running, you can interact with MongoDB through the chat interface:

You: Show me all collections in the database
AI: Found 3 collections in the database
[
  "users",
  "products",
  "orders"
]

You: Find all users with age greater than 30
AI: Found 2 documents in collection 'users'
[
  {
    "_id": "6450a7c63020e15b2a1cf5d2",
    "name": "John Doe",
    "age": 35
  },
  {
    "_id": "6450a7d93020e15b2a1cf5d3",
    "name": "Jane Smith",
    "age": 42
  }
]

How it Works

  1. The MCP server creates a connection to MongoDB and exposes operations as tools
  2. The client connects to the MCP server via Server-Sent Events (SSE)
  3. User queries are sent to Gemini AI, which decides when to use MongoDB tools
  4. Tool calls are forwarded to the MCP server, executed, and results returned
  5. Gemini AI incorporates the database results in its response to the user

Environment Variables

Server (.env file in mcp-mongo-project/)

  • MONGODB_URI: Connection string for MongoDB
  • MONGODB_NAME: Name of the database to use

Client (.env file in client-side/)

  • GEMINI_API_KEY: API key for Google's Gemini AI

Images

Chatbot Interface

Chatbot Interface

Chatbot Interface

License

ISC

Contributing

Feel free to contribute to this project by opening issues or submitting pull requests.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP MongoDB Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcpmongo)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage