MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

M
Mongodb Go MCP

This project implements a MongoDB-compatible server in Golang, allowing clients to connect and interact with it as if it were a standard MongoDB server. The server supports basic CRUD operations, authentication, and other MongoDB features.

Created 2/24/2026
Updated about 7 hours ago
Repository documentation and setup instructions

MCP Server for MongoDB in Golang

Go Reference

This project implements a MongoDB-compatible server in Golang, allowing clients to connect and interact with it as if it were a standard MongoDB server. The server supports basic CRUD operations, authentication, and other MongoDB features.

Features

The following mongodb features are supported:

  • Aggregate
  • CountDocuments
  • DeleteMany
  • DeleteOne
  • FindOneAndDelete
  • FindOneAndReplace
  • FindOneAndUpdate
  • FindOne
  • Find
  • InsertMany
  • InsertOne
  • UpdateMany
  • UpdateOne
  • ListCollections

Configurations

The server can be configured to run with the following environment variables:

DB_URL=
DB_NAME=
READ_ONLY=false
ALLOW_AGGREGATES=false

| Variable | Description | Required | Default | | --- | --- | --- | --- | | DB_URL | The connection string for the MongoDB instance to connect to. | Yes | None | | DB_NAME | The name of the MongoDB database to use. If not provided, the server will require the database name to be specified in each query. | No | None | | READ_ONLY | If set to "true" or "1", the server will operate in read-only mode, disallowing any write operations. | No | false | | ALLOW_AGGREGATES | If set to "true" or "1", the server will allow aggregate operations. | No | false |

Usage

To run the server, use the following command:

go run main.go

Testing with MCP

Install the MCP Inspector using the following command:

npm install -g @modelcontextprotocol/inspector

Now, set your environment variables and run the server:

mcp-inspector go run .

Installing and running the project for production

Install the project with the following command:

go install github.com/CdTgr/mongodb_go_mcp/cmd/mongodb_go_mcp@latest

Now, you can freely connect your favourite MCP client to the server with the following execution command:

mongodb_go_mcp

Note: Make sure to set the required environment variables before running the server.

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/CdTgr/mongodb_go_mcp
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "cdtgr-mongodb-go-mcp": { "command": "git", "args": [ "clone", "https://github.com/CdTgr/mongodb_go_mcp" ] } } }