MongoDB MCP Server
Provides tools for MongoDB CRUD operations, database and collection listing, and document querying with filtering and limit options.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MongoDB MCP Server π
A powerful Model Context Protocol (MCP) server implementation for MongoDB integration, providing seamless interaction with MongoDB databases through a standardized protocol.
π Author
Syed Asad
Related MCP server: Mongo MCP Server
π Overview
This MCP server implementation provides a robust interface for interacting with MongoDB databases through the Model Context Protocol. It supports operations on databases, collections, and documents with proper async/await patterns and error handling.
β¨ Features
π Full MongoDB CRUD operations support
π Secure connection handling with MongoDB Atlas
π¦ Async/await patterns for optimal performance
π‘οΈ Comprehensive error handling
π¦ Docker support for easy deployment
π Query execution with proper type hints
π Quick Start
Using uvx (Python)
# Run directly with uvx
uvx mongodb-mcp-bridge
# With SSE transport for remote connections
uvx mongodb-mcp-bridge --transport=sseUsing npx (Node.js)
# Run directly with npx
npx mongodb-mcp-bridge
# With SSE transport for remote connections
npx mongodb-mcp-bridge --transport=sseEnvironment Variables
Set these environment variables before running the server:
# Required
MONGODB_URI="your_mongodb_connection_string"
# Optional
MONGODB_DB="default_database_name"
MCP_PORT="6274" # Default port for MCP InspectorUsing Docker π³
# Build the Docker image
docker build -t mongodb-mcp-server .
# Run the container
docker run -e MONGODB_URI="your_mongodb_uri" -p 6274:6274 mongodb-mcp-serverπ IDE Integration
VS Code Setup
Add this to your VS Code settings.json:
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "mongodbUri",
"description": "MongoDB Connection URI"
}
],
"servers": {
"mongodb": {
"command": "uvx",
"args": ["mongodb-mcp-bridge", "--transport=sse"],
"env": {
"MONGODB_URI": "$(mongodbUri)"
}
}
}
}
}Cursor/Windsurf Setup
For Cursor or Windsurf, configure the MCP server with:
{
"mcp": {
"servers": {
"mongodb": {
"url": "http://localhost:6274"
}
}
}
}π Available Tools
ping
Quick connection test to verify MongoDB connectivity
list_databases
List all available databases in the MongoDB instance
find_documents
Query documents in a collection with filtering options
Parameters:
database: Database namecollection: Collection namequery: MongoDB query object (optional)limit: Maximum number of documents to return (default: 10)
π Example Usage
Using the MCP Inspector (http://127.0.0.1:6274):
// List all databases
{
"tool": "list_databases"
}
// Find documents in a collection
{
"tool": "find_documents",
"database": "your_database",
"collection": "your_collection",
"query": {"status": "active"},
"limit": 5
}π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Model Context Protocol (MCP) team for the protocol specification
MongoDB team for the excellent database and drivers
All contributors and users of this project
Made with β€οΈ by Syed Asad
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Model Context Protocol server for Studex tools, notifications, and profile integrations
A Model Context Protocol server for Wix AI tools
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Design domain models and generate deterministic multi-stack code, driven by your coding agent.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a standardized interface for AI assistants to interact with MongoDB databases, enabling CRUD operations, schema analysis, and database management through the Model Context Protocol.1-
- -licenseBqualityNot gradedmaintenanceEnables interaction with MongoDB databases through the Model Context Protocol. Provides basic database connectivity checking and status monitoring capabilities.1-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with MongoDB databases through a complete suite of CRUD operations, administrative tasks, and index management tools. It supports database and collection handling, aggregation pipelines, and comprehensive server monitoring via the Model Context Protocol.208 PyPI3MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with MongoDB databases and MongoDB Atlas for querying data and managing clusters via the Model Context Protocol. It supports both local and cloud-based deployments using connection strings or Atlas API credentials.145,421 npmApache 2.0