Lets LLMs work with MongoDB directly: query collections, inspect schemas and manage data.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add mongo --env MONGO_URI='<MONGO_URI>' --env MONGODB_URI='<MONGODB_URI>' -- npx -y @smithery/cli install mongo-mcp --client claude~/.codex/config.toml
[mcp_servers.mongo]
command = "npx"
args = ["-y", "@smithery/cli", "install", "mongo-mcp", "--client", "claude"]
env = { MONGO_URI = "<MONGO_URI>", MONGODB_URI = "<MONGODB_URI>" }
# codex mcp add mongo --env MONGO_URI='<MONGO_URI>' --env MONGODB_URI='<MONGODB_URI>' -- npx -y @smithery/cli install mongo-mcp --client claude~/.cursor/mcp.json
{
"mcpServers": {
"mongo": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mongo-mcp",
"--client",
"claude"
],
"env": {
"MONGO_URI": "<MONGO_URI>",
"MONGODB_URI": "<MONGODB_URI>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"mongo": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mongo-mcp",
"--client",
"claude"
],
"env": {
"MONGO_URI": "<MONGO_URI>",
"MONGODB_URI": "<MONGODB_URI>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"mongo": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mongo-mcp",
"--client",
"claude"
],
"env": {
"MONGO_URI": "<MONGO_URI>",
"MONGODB_URI": "<MONGODB_URI>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"mongo": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mongo-mcp",
"--client",
"claude"
],
"env": {
"MONGO_URI": "<MONGO_URI>",
"MONGODB_URI": "<MONGODB_URI>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"mongo": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mongo-mcp",
"--client",
"claude"
],
"env": {
"MONGO_URI": "<MONGO_URI>",
"MONGODB_URI": "<MONGODB_URI>"
}
}
}
}Environment variables
MONGO_URIMONGODB_URI
Replace the placeholders with your own credentials and keep them out of version control.