CodexSpot
M

MongoDB MCP Server

Connects AI assistants to MongoDB databases through MCP, supporting document find, insert, update, and aggregation pipeline operations.

stdioLocalApiKeynpm

What This Server Exposes

Tools

findinsertupdateaggregate

Resources

  • collection documents
  • aggregation results

Setup Instructions

  1. 1Ensure a MongoDB instance is running locally or use MongoDB Atlas
  2. 2Create a database user with appropriate read/write permissions
  3. 3Add the MongoDB server config to your Claude Desktop configuration
  4. 4Set the MONGODB_URI environment variable with the connection URI
  5. 5Restart Claude Desktop

Configuration

Claude Desktop Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mongodb"
      ],
      "env": {
        "MONGODB_URI": "mongodb://user:password@localhost:27017/dbname"
      }
    }
  }
}

Environment Variables

MONGODB_URI
MongoDB connection URI including credentials, host, port, and database name
Required🔒 Secret

Server Manifest

No official server.json manifest found. Generate one with our MCP server.json Generator →

Compatibility

Claude DesktopClaude Code

Safety Notes

MongoDB URIs contain credentials that grant database access. Use a dedicated user with least-privilege permissions. Never use Atlas admin credentials. Store the URI securely and never commit it to version control.

This listing is for informational purposes only. CodexSpot is not affiliated with MongoDB MCP Server.