MongoDB
The MCP MongoDB Server enables interaction with MongoDB databases through a standardized interface, allowing both read and write operations.
Read Operations: Query documents, execute aggregation pipelines, count documents, and get collection schema information.
Write Operations: Update documents, insert new documents, and create indexes (when not in read-only mode).
Smart ObjectId Handling: Convert between string IDs and MongoDB ObjectId with configurable modes.
Read-Only Mode: Protect against write operations in production environments.
Server Information: Retrieve MongoDB server details, including version and storage engine.
Collection Management: List available collections and inspect their schemas.
LLM Integration: Enhanced interaction with collection completions and schema inference.
Flexible Configuration: Set connection parameters via environment variables or command-line options.
Provides access to MongoDB databases, allowing LLMs to inspect collection schemas and execute MongoDB operations like queries, aggregations, updates, inserts, and creating indexes
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MongoDBshow me the schema for the users collection"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP MongoDB Server
A Model Context Protocol server that enables LLMs to interact with MongoDB databases. This server provides capabilities for inspecting collection schemas and executing MongoDB operations through a standardized interface.
Demo

Related MCP server: MongoDB MCP Server for LLMs
Key Features
Smart ObjectId Handling - Configurable auto/none/force modes for string-to-ObjectId conversion
Read-Only Mode - Protection against write operations, uses secondary read preference
Schema Inference - Automatic collection schema detection from document samples
Query & Aggregation - Full MongoDB query and aggregation pipeline support with optional explain plans
Write Operations - Insert, update, and index creation (when not in read-only mode)
Collection Completions - Auto-complete collection names for LLM integration
Installation
npx -y mcp-mongo-server mongodb://localhost:27017/databaseUsage
# Start server with MongoDB URI
npx -y mcp-mongo-server mongodb://muhammed:kilic@localhost:27017/database
# Connect in read-only mode
npx -y mcp-mongo-server mongodb://muhammed:kilic@localhost:27017/database --read-onlyEnvironment Variables
Variable | Description |
| MongoDB connection URI |
| Enable read-only mode ( |
Documentation
Integration Guide - Claude Desktop, Windsurf, Cursor, Docker
Available Tools - Query, aggregate, update, insert, and more
Development - Setup, scripts, and debugging
License
MIT - see LICENSE for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceA Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.Last updated45174MIT
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated452MIT
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated45MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.Last updated511MIT
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP (Model Context Protocol) server for Appwrite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kiliczsh/mcp-mongo-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server