---
title: "MongoDB MCP Server for ToolPiper · ModelPiper"
description: "Query and manage MongoDB and Atlas clusters from the assistant. MongoDB's official MCP server connects to a cluster directly or to Atlas via the Admin API. With a connection string it can run find and aggregate queries,"
canonical: "https://modelpiper.com/mcp-tools/mongodb"
---

# MongoDB MCP Server for ToolPiper · ModelPiper

> Query and manage MongoDB and Atlas clusters from the assistant. MongoDB's official MCP server connects to a cluster directly or to Atlas via the Admin API. With a connection string it can run find and aggregate queries,

M

# MongoDB MCP Server

✓ verified

Query and manage MongoDB and Atlas clusters from the assistant.

Install MongoDB in ToolPiper

Don't have ToolPiper? We'll take you to the download.

[Open repository →](https://github.com/mongodb-js/mongodb-mcp-server)

Publisher

[MongoDB](https://github.com/mongodb-js/mongodb-mcp-server)

License

Apache-2.0

Transport

Local subprocess

Tools

5

## What this server does

MongoDB's official MCP server connects to a cluster directly or to Atlas via the Admin API. With a connection string it can run find and aggregate queries, list databases and collections, infer schemas, and (unless you set read-only mode) insert and update documents. Point it at a connection string with a least-privilege user so the assistant sees only what it should. The server reads MDB\_MCP\_CONNECTION\_STRING from the environment; pass a read-only user or a replica for analytics work.

## Tools included

-   find
    
    Run a find query against a collection.
    
-   aggregate
    
    Run an aggregation pipeline.
    
-   list\_collections
    
    List collections in a database.
    
-   count
    
    Count documents matching a filter.
    
-   collection\_schema
    
    Infer the schema of a collection.
    

The authoritative list comes from the server's tools/list at runtime. This catalog entry may lag the upstream until the next ToolPiper release.

## Install in ToolPiper

ToolPiper handles the JSON configuration. Click Install, fill in any required tokens, and the server is ready in your chat.

Install MongoDB in ToolPiper

Don't have ToolPiper? We'll take you to the download.

## Install in another client

Install in another MCP client (Claude Desktop, Cursor, Continue, Cline)

Claude Desktop Cursor Continue Cline

Add this to ~/Library/Application Support/Claude/claude\_desktop\_config.json.

```
{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server"
      ]
    }
  }
}
```

Copy

## Example prompts

-   "List the collections in the analytics database and show me the schema of events."
    
    Copy
-   "How many users signed up in the last 7 days?"
    
    Copy
-   "Aggregate orders by status and return the totals."
    
    Copy

## Security notes

The connection string contains database credentials and grants whatever the user can do. Use a read-only user for analytics, and never point it at production with a write-capable account unless you mean it. Set MDB\_MCP\_READ\_ONLY=true to block writes. Treat the string like a password.

## Related tools

-   [
    
    P
    
    ### Postgres
    
    ✓ verified
    
    Query Postgres databases with read-only SQL.
    
    DataLocal subprocess1 tool
    
    
    
    
    
    ](/mcp-tools/postgres)
-   [
    
    S
    
    ### SQLite
    
    ✓ verified
    
    Query SQLite databases and run business-intelligence prompts.
    
    DataLocal subprocess4 tools
    
    
    
    
    
    ](/mcp-tools/sqlite)
-   [
    
    R
    
    ### Redis
    
    ✓ verified
    
    Interact with Redis key-value stores from the assistant.
    
    DataLocal subprocess4 tools
    
    
    
    
    
    ](/mcp-tools/redis)
-   [
    
    A
    
    ### AWS Knowledge Base
    
    ✓ verified
    
    Retrieve answers from an AWS Bedrock Knowledge Base.
    
    DataLocal subprocess1 tool
    
    
    
    
    
    ](/mcp-tools/aws-kb-retrieval)

[← Back to all MCP tools](/mcp-tools)
