
mongo mcp
一个支持只读操作的 MongoDB MCP 服务器,可与 Cursor IDE 集成。
Repository Info
About This Server
一个支持只读操作的 MongoDB MCP 服务器,可与 Cursor IDE 集成。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Server for MongoDB
A MongoDB MCP (Model-Context-Protocol) server that supports read-only operations. This server can be safely integrated with Cursor IDE, allowing MongoDB database queries through the MCP protocol.
Features
- Read-only operations for enhanced database security
- Support for basic MongoDB query operations
- Seamless integration with Cursor IDE
- Compatible with Python 3.9 and above
Installation
- Ensure Python 3.9 or higher is installed on your system
- Clone this repository:
git clone https://github.com/nick887/mongo-mcp.git cd mongo-mcp - Install dependencies using uv:
uv venv source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate # Windows uv pip install -e .
Configuration
Cursor MCP Configuration
Add the following MCP configuration to your Cursor settings:
{
"mcpServers": {
"mongodb-readonly": {
"command": "uv",
"args": [
"--directory",
"/PATH/TO/mongo-mcp",
"run",
"mcp-server-mongo"
],
"env": {
"db_uri": "mongodb://your-mongodb-connection-string"
}
}
}
}
Configuration notes:
/PATH/TO/mongo-mcp: Replace with your actual project pathdb_uri: Replace with your MongoDB connection string
Supported Operations
The server supports the following MongoDB read-only operations:
- Document queries (find)
- Aggregation operations (aggregate)
- Count operations (count)
- Server information retrieval (serverInfo)
- Collection listing (listCollections)
Security Notes
- This server only supports read operations; write, update, and delete operations are not supported
- It is recommended to use a database user with read-only privileges
- Ensure database connection strings are not hardcoded in the source code
License
This project is licensed under the Apache License 2.0 - see below for details:
Copyright 2025 nick887
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributing
Issues and Pull Requests are welcome!
Quick Start
Clone the repository
git clone https://github.com/nick887/mongo-mcpInstall dependencies
cd mongo-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.