# MongoDB MCP Server

> Official server that lets your AI query MongoDB databases and Atlas clusters, inspect collections and indexes, with a read-only mode for safety.

- Kind: MCP server
- Page: https://ownlyplans.com/bhaskar/mongodb-mcp-server/
- Licence: See the original project for its licence

## Install

```bash
claude mcp add-json mongodb '{"command":"npx","args":["-y","mongodb-mcp-server@latest","--readOnly"],"env":{"MDB_MCP_CONNECTION_STRING":"mongodb://localhost:27017/myDatabase"}}'
```

## Files

- MongoDB MCP Server config: https://ownlyplans.com/bhaskar/mongodb-mcp-server/mongodb-mcp-server-config/ (Add this to your MCP client's config, or use the install line.)
- Official setup docs: https://github.com/mongodb-js/mongodb-mcp-server#readme (Client-specific setup, options and permissions.)

## About

The official MongoDB server connects your AI tool to a database or an Atlas cluster. It can list collections, read schemas and indexes, run queries and aggregations, and help you design better queries.

Start with the --readOnly flag so the AI can look but not change anything. Use a connection string for a development database, not production, until you trust the setup.

---
Also available as JSON: https://ownlyplans.com/bhaskar/mongodb-mcp-server/?format=json
MCP server: https://ownlyplans.com/mcp
