MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add mongodb-server-for-llms --env MONGO_URI='<MONGO_URI>' -- node --version '#' Should show v18.0.0 or higher~/.codex/config.toml
[mcp_servers.mongodb-server-for-llms]
command = "node"
args = ["--version", "#", "Should", "show", "v18.0.0", "or", "higher"]
env = { MONGO_URI = "<MONGO_URI>" }
# codex mcp add mongodb-server-for-llms --env MONGO_URI='<MONGO_URI>' -- node --version '#' Should show v18.0.0 or higher~/.cursor/mcp.json
{
"mcpServers": {
"mongodb-server-for-llms": {
"command": "node",
"args": [
"--version",
"#",
"Should",
"show",
"v18.0.0",
"or",
"higher"
],
"env": {
"MONGO_URI": "<MONGO_URI>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"mongodb-server-for-llms": {
"type": "stdio",
"command": "node",
"args": [
"--version",
"#",
"Should",
"show",
"v18.0.0",
"or",
"higher"
],
"env": {
"MONGO_URI": "<MONGO_URI>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"mongodb-server-for-llms": {
"command": "node",
"args": [
"--version",
"#",
"Should",
"show",
"v18.0.0",
"or",
"higher"
],
"env": {
"MONGO_URI": "<MONGO_URI>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"mongodb-server-for-llms": {
"command": "node",
"args": [
"--version",
"#",
"Should",
"show",
"v18.0.0",
"or",
"higher"
],
"env": {
"MONGO_URI": "<MONGO_URI>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"mongodb-server-for-llms": {
"command": "node",
"args": [
"--version",
"#",
"Should",
"show",
"v18.0.0",
"or",
"higher"
],
"env": {
"MONGO_URI": "<MONGO_URI>"
}
}
}
}Environment variables
MONGO_URI
Replace the placeholders with your own credentials and keep them out of version control.