mongo-mcp
Provides tools for managing users in a MongoDB database, allowing Claude to list, find, add, and delete users via natural language.
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., "@mongo-mcplist all users"
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.
mongo-mcp
A local MCP (Model Context Protocol) server that connects Claude Desktop to a real MongoDB database running in Docker. Supports listing, finding, adding, and deleting users via natural language in Claude.
What It Does
Exposes four tools Claude can call:
Tool | What it does |
| Returns all users in the database |
| Finds a user by name or email |
| Adds a new user with duplicate email check |
| Deletes a user by their MongoDB |
Prerequisites
Requirement | Version |
v18 or higher | |
Latest | |
Latest |
Step 1 — Install Docker Desktop
Download Docker Desktop from docker.com/products/docker-desktop
Run the installer — all defaults are fine
When prompted to enable WSL2, click Yes
Restart your computer after installation
Open Docker Desktop and wait for it to fully start (whale icon appears in system tray)
If your WSL is outdated, open PowerShell as Administrator and run:
wsl --updateVerify Docker works by opening a regular PowerShell (not as Administrator) and running:
docker --versionStep 2 — Run MongoDB in Docker
Pull the official MongoDB image (one time only):
docker pull mongoStart a MongoDB container:
docker run -d --name mongodb -p 27017:27017 mongoWhat each flag means:
-d— runs in the background so it doesn't lock your terminal--name mongodb— gives the container a name you can reference later-p 27017:27017— maps MongoDB's port to your machine so Node.js can connect vialocalhost:27017
Verify it's running:
docker psYou should see mongodb in the list with status Up.
Test that MongoDB is responding:
docker exec -it mongodb mongosh --eval "db.runCommand({ ping: 1 })"You should see { ok: 1 }.
Managing the container day to day
You only need docker run once. After that:
# Start MongoDB
docker start mongodb
# Stop MongoDB
docker stop mongodb
# Check if it's running
docker psStep 3 — Clone and Install
git clone https://github.com/YOUR_USERNAME/mongo-mcp.git
cd mongo-mcp
npm installStep 4 — Verify the Server Runs
Make sure MongoDB is running first (docker start mongodb), then:
node server.jsYou should see:
Connected to MongoDBThe server will sit and wait — that's normal. Hit Ctrl+C to stop it.
Step 5 — Connect to Claude Desktop
Claude Desktop reads its config from a JSON file. The correct path depends on how Claude was installed.
Finding your config file
Microsoft Store / MSIX install:
Run this in PowerShell to open the file Claude actually reads:
$pkg = (Get-AppxPackage -Name "*Claude*").PackageFamilyName
$cfg = Join-Path $env:LOCALAPPDATA "Packages\$pkg\LocalCache\Roaming\Claude\claude_desktop_config.json"
notepad $cfg⚠️ The "Edit Config" button inside Claude Desktop opens a different file that the Store version does not read. Always use the PowerShell command above.
Classic install:
%APPDATA%\Claude\claude_desktop_config.jsonConfig format
Add mongo-mcp to the mcpServers block. Merge it in alongside any existing servers — do not overwrite the whole file.
{
"mcpServers": {
"mongo-mcp": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"C:\\Users\\YOUR_USERNAME\\mongo-mcp\\server.js"
]
}
}
}Replace:
C:\\Program Files\\nodejs\\node.exewith your actual Node.js path. Find it withwhere.exe nodein PowerShell.YOUR_USERNAMEwith your Windows username.
⚠️ Windows paths in JSON require double backslashes. A single
\will cause the config to fail silently.
Fully restart Claude Desktop
Closing the window is not enough — Claude keeps running in the system tray.
Right-click the Claude icon in the system tray
Select Quit
Relaunch Claude Desktop
Verify the connection
$pkg = (Get-AppxPackage -Name "*Claude*").PackageFamilyName
$logDir = Join-Path $env:LOCALAPPDATA "Packages\$pkg\LocalCache\Roaming\Claude\logs"
Get-Content "$logDir\mcp.log" -Tail 20You should see:
[info] [mongo-mcp] Server started and connected successfully
[info] [mongo-mcp] Message from server: {"result":{"tools":[{"name":"list_users"...}]}}Testing
Ask Claude these in order:
"List all users"— should say no users yet"Add a user named Dharhshini with email d@example.com""Add a user with email d@example.com"— should block duplicate"List all users"— should show the new user"Find the user named Dharhshini""Find the user with email d@example.com""Delete the user with ID [paste _id from step 4]""List all users"— should be empty again
Project Structure
mongo-mcp/
├── server.js # MCP server with all four tools
├── package.json
└── README.mdTroubleshooting
Symptom | Likely cause | Fix |
| MongoDB container not running | Run |
Server not appearing in Claude | Wrong config path or single backslashes | Use the PowerShell command to find config, double all backslashes |
Tools don't appear | Claude not fully restarted | Right-click tray → Quit, then relaunch |
| Copied ID incorrectly | Copy the full |
Built With
Model Context Protocol SDK —
@modelcontextprotocol/sdkMongoDB Node.js Driver —
mongodbZod —
zod
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/DharhshiniVJ/mongo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server