AITeamGuide

AITeamGuide Hub · MCP server

MongoDB MCP Server

MongoDB's official MCP server for querying and managing MongoDB databases and Atlas clusters.

MCP server★ 1.1k starsApache-2.0Software developmentOps & IT

View on GitHub

Key facts

Type
MCP server
Jobs it fits
Query and manage a database
Fields
Software development, Ops & IT
Works with
Any MCP client, Claude Code, Cursor, VS Code
GitHub
mongodb-js/mongodb-mcp-server
Licence
Apache-2.0
Stars
1,146 as of October 21, 2026
Last updated
October 21, 2026 (last push to GitHub)
Author
@mongodb-js
Submitted by
@aiteamguide
Added to the Hub
October 21, 2026

Install / Use it

Apache-2.0Local MCP server

Download ZIP View source

Cursor

Add to Cursor

Replace the placeholder values (API keys, tokens) with your own after adding it.

Or paste into ~/.cursor/mcp.json

{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest",
        "--readOnly"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Claude Code

Run in your terminal

claude mcp add --transport stdio mongodb --env MDB_MCP_CONNECTION_STRING=mongodb://localhost:27017/myDatabase -- npx -y mongodb-mcp-server@latest --readOnly

Replace the placeholder values (API keys, tokens) with your own after adding it.

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config), then restart Claude

{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest",
        "--readOnly"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Replace the placeholder values (API keys, tokens) with your own after adding it.

VS Code

Add to VS Code

Replace the placeholder values (API keys, tokens) with your own after adding it.

Or from the command line

code --add-mcp '{"name":"mongodb","type":"stdio","command":"npx","args":["-y","mongodb-mcp-server@latest","--readOnly"],"env":{"MDB_MCP_CONNECTION_STRING":"mongodb://localhost:27017/myDatabase"}}'

Codex

Run in your terminal

codex mcp add mongodb --env MDB_MCP_CONNECTION_STRING=mongodb://localhost:27017/myDatabase -- npx -y mongodb-mcp-server@latest --readOnly

Replace the placeholder values (API keys, tokens) with your own after adding it.

Safety: Runs code from a third-party repo. Review the source and the permissions before installing.

Commands and configs are taken from the project's README and re-wrapped in each app's documented format. If they differ, the README wins.

Prefer a ready-made product?

Commercial agents for the same job, with real prices: all coding agents.

More from the Hub

Summary written by AITeamGuide in our own words. GitHub numbers come from the public GitHub API and refresh daily. Maintainer and want a correction or removal? Tell us. Got something similar? Submit it to the Hub.