MCP Servers · Publisher repository

MongoDB MCP Server

MongoDB's official MCP server for inspecting schemas, running queries, and assisting with database operations, including a read-only mode.

1.1k StarsApache-2.0TypeScriptUpdated today
01

Project overview

MongoDB MCP Server is a MCP server built around mongoDB's official MCP server for inspecting schemas, running queries, and assisting with database operations, including a read-only mode. Its value is practical: browse databases and collections and run mongodb queries are available from one documented project, while the repository remains inspectable before it is added to an agent workflow.

02

Core capabilities

01

Browse databases and collections

Browse databases and collections is documented in the repository README or its component instructions. Review the linked source for current behavior and requirements.

02

Run MongoDB queries

Run MongoDB queries is documented in the repository README or its component instructions. Review the linked source for current behavior and requirements.

03

Inspect collection structure

Inspect collection structure is documented in the repository README or its component instructions. Review the linked source for current behavior and requirements.

04

Assist database troubleshooting

Assist database troubleshooting is documented in the repository README or its component instructions. Review the linked source for current behavior and requirements.

03

Setup and connection

Set up MongoDB MCP Server from its public GitHub instructions, keep the initial permission scope small, and verify it with a low-risk task before regular use.

AI AGENT INSTALL

Let an AI Agent install it

Send this prompt to Codex, Claude Code, or another AI agent that can work with your local environment.

Help me set up MongoDB MCP Server.
Project URL: https://github.com/mongodb-js/mongodb-mcp-server

Read the repository README and license first. Confirm the current host, prerequisites, destination paths, and permissions. Follow the repository's documented method, keep credentials out of files and logs, and start with the least-privilege or read-only option where available. Afterward, run a small verification and report the exact changes, commands, configuration path, and result. Ask before overwriting files or requesting broader access.
01Before you start
  • Node.js and npx
  • A dedicated least-privilege MongoDB account
  • An MCP host with stdio configuration support
02Copy the install command or configuration
{"mcpServers":{"mongodb":{"command":"npx","args":["-y","mongodb-mcp-server@latest","--readOnly"],"env":{"MDB_MCP_CONNECTION_STRING":"mongodb://USER:PASSWORD@HOST:PORT/DATABASE"}}}}
03Complete the setup steps
  1. 1
    Review prerequisites and scope

    Read the README, confirm the target host, and prepare these prerequisites: Node.js and npx; A dedicated least-privilege MongoDB account; An MCP host with stdio configuration support. Check destination paths and permissions before making changes.

  2. 2
    Apply the documented setup

    Run the documented command: npx -y mongodb-mcp-server@latest --readOnly

  3. 3
    Verify with a small task

    Restart the MCP host and confirm that MongoDB MCP Server appears in the server list. Call one low-risk read-only tool and check that it returns an expected result without authentication errors.

How to verify the setup

Restart the MCP host and confirm that MongoDB MCP Server appears in the server list. Call one low-risk read-only tool and check that it returns an expected result without authentication errors.

Before using it
  • The connection string is a sensitive credential
  • Read-only access can still expose sensitive data
04

Use cases

SCENARIO 01

Query application data with an agent

Query application data with an agent is a practical fit when the repository's documented prerequisites and permission model match the current environment.

SCENARIO 02

Inspect collections and indexes

Inspect collections and indexes is a practical fit when the repository's documented prerequisites and permission model match the current environment.

SCENARIO 03

Troubleshoot MongoDB queries

Troubleshoot MongoDB queries is a practical fit when the repository's documented prerequisites and permission model match the current environment.

05

Assessment

This assessment is based on the repository README, component documentation, license, and maintenance metadata. Official implementation with a read-only option; Connection works with common MCP clients. The main trade-offs are also clear: The connection string is a sensitive credential; Read-only access can still expose sensitive data. No local installation or functional test was claimed during cataloging.

Why it may be useful

  • Official implementation with a read-only option
  • Connection works with common MCP clients

What to know first

  • The connection string is a sensitive credential
  • Read-only access can still expose sensitive data
06

README

MongoDB MCP Server


Overview

MongoDB's official MCP server for inspecting schemas, running queries, and assisting with database operations, including a read-only mode. MongoDB's official MCP server for inspecting schemas, running queries, and assisting with database operations, including a read-only mode.

Getting started

  • Set up MongoDB MCP Server from its public GitHub instructions, keep the initial permission scope small, and verify it with a low-risk task before regular use.
  • The repository describes MongoDB MCP Server as mongoDB's official MCP server for inspecting schemas, running queries, and assisting with database operations, including a read-only mode.
  • Its main capabilities include browse databases and collections, run mongodb queries, inspect collection structure, assist database troubleshooting. The documented facts include official mongodb project, read-only mode, connection-string authentication, runs through npx.
  • Restart the MCP host and confirm that MongoDB MCP Server appears in the server list. Call one low-risk read-only tool and check that it returns an expected result without authentication errors.

Configuration

{"mcpServers":{"mongodb":{"command":"npx","args":["-y","mongodb-mcp-server@latest","--readOnly"],"env":{"MDB_MCP_CONNECTION_STRING":"mongodb://USER:PASSWORD@HOST:PORT/DATABASE"}}}}
Read the complete README on GitHub