mongodb — Claude Code plugin: what it does, how to install
This plugin connects Claude Code to MongoDB through a local MCP server. Use it to inspect data, run queries, and work on indexes.
/plugin install mongodb@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-community
/plugin install mongodb@claude-community
/plugin marketplace add anthropics/claude-plugins-officialWhat mongodb does
The plugin connects Claude Code to MongoDB with a connection string. It starts the MongoDB MCP server locally through npx, giving the agent tools for inspecting databases and collections, running queries and aggregation pipelines, and managing indexes. It covers Community, Enterprise Advanced, a local development container, and an Atlas cluster.
Bundled skills handle MCP and client connection setup, turn plain-language requests into read-only find queries or aggregation pipelines, diagnose slow queries, and suggest indexes. Other skills cover schema patterns, Queryable Encryption sizing, Atlas Search, Vector Search, and Atlas Stream Processing workspaces, connections, and processors.
You need a MongoDB connection string and environment variables for the MCP setup. The Queryable Encryption sizing skill does not apply to collections using Client-Side Field Level Encryption.
What it helps with
- connect Claude Code to a MongoDB database
- inspect collections and run an aggregation
- diagnose a slow MongoDB query
- choose indexes for a query
- shape a MongoDB schema during a SQL migration
Example prompts for the agent
- Set up the MongoDB MCP connection and check the connection string.
- Write a read-only
findquery for orders filtered by status and date. - Investigate this slow query and recommend indexes for it.
How to install mongodb
Plugin marketplace
/plugin install mongodb@claude-plugins-official/plugin marketplace add anthropics/claude-plugins-community/plugin install mongodb@claude-community/plugin marketplace add anthropics/claude-plugins-officialStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about mongodb
How do I install mongodb in Claude Code?
First add the official marketplace with /plugin marketplace add anthropics/claude-plugins-official, then install the plugin using /plugin install mongodb@claude-plugins-official.
What does the mongodb plugin do?
It links Claude Code with MongoDB through a local MCP server. The agent can inspect databases and collections, run queries and aggregations, and manage indexes.
What is required to connect MongoDB?
The MCP setup needs a MongoDB connection string and environment variables. The server runs locally through npx.
Source text
mongodb · Apache-2.0
# MongoDB (Self-Managed MCP) For deployments you manage yourself — **Community**, **Enterprise Advanced**, a local dev container, or an Atlas cluster — this plugin connects your agent using nothing more than a connection string. It runs the [MongoDB MCP server](https://www.mongodb.com/docs/mcp-server/) locally via `npx`, giving your agent tools to explore databases and collections, run queries and aggregations, and manage indexes. To get started, see the [Community & Enterprise Advanced setup guide](../../README.community.md). ## Skills These skills come bundled with the plugin and activate automatically when relevant: - **`mongodb-mcp-setup`** — Walks you through configuring the MCP server's connection string and environment variables. - **`mongodb-connection`** — Reviews and tunes client connection configuration (pools, timeouts, patterns) across driver languages. - **`mongodb-natural-language-querying`** — Turns natural-language requests into read-only `find` queries and aggregation pipelines. - **`mongodb-qe-size-estimation`** — Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption (QE) enabled. Doesn't apply to collections that use Client-Side Field Level Encryption (CSFLE). - **`mongodb-query-optimizer`** — Diagnoses slow queries and recommends indexes to fix them. - **`mongodb-schema-design`** — Applies MongoDB schema design patterns and steers you clear of common anti-patterns, whether modeling from scratch or migrating from SQL. - **`mongodb-search-and-ai`** — Helps build Atlas Search (full-text), Vector Search (semantic), and hybrid search implementations. - **`mongodb-atlas-stream-processing`** — Manages Atlas Stream Processing workspaces, connections, and processors for streaming workloads.
© mongodb · Apache-2.0 · mongodb/agent-skills