About Mongodb Go MCP
Mongodb Go MCP is an MCP server published by CdTgr in the Data category: 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.
The repository has 2 stars and 0 forks, with the last commit 8 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/CdTgr/mongodb_go_mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Mongodb Go MCP
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
MCP Server for MongoDB in Golang
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.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.