Guide · Agent skill
How to use the MongoDB Operations Expert agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The MongoDB Operations Expert skill is a set of instructions that tells an AI agent to reason about MongoDB the way a specialist would. It covers schema design, queries, aggregation pipelines, indexes and common performance mistakes. This guide explains what the skill changes, how to install it, how to ask for help so it triggers, and what to keep in mind before acting on its advice.
Quick start
- 1Download the ZIP. Download the mongodb skill ZIP from this page.
- 2Unzip the skill. Unzip the file so you have a mongodb folder containing SKILL.md.
- 3Place the folder. Move the folder into ~/.claude/skills/ for personal use, or into your project's .claude/skills/ folder for one project.
- 4Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP instead.
- 5Ask a MongoDB question. Describe your schema, query or index problem in plain language and mention MongoDB.
- 6Verify performance. Run explain("executionStats") on your own deployment and share the output so the agent can check the advice.
What is an agent skill and what does this one do?
An agent skill is a folder containing a SKILL.md file with instructions that an AI agent reads when a request matches the skill. This one is named mongodb and is described as a MongoDB operations expert for queries, aggregation pipelines, indexes, and schema design.
Once active, the agent follows a set of MongoDB principles when you ask for help. It favours designing schemas around access patterns rather than relational normalization, and it suggests indexes to support your query patterns.
- Decide whether to embed or reference related data, based on how it is read and updated.
- Write queries and aggregation pipelines, placing $match early and using $lookup, $facet and $merge where they fit.
- Choose and audit indexes, including the ESR rule for compound indexes and partial or TTL indexes.
- Flag pitfalls such as unbounded arrays, unindexed COLLSCAN queries and leading-wildcard $regex.
What the skill does not do
The skill only changes how the agent reasons and writes advice. It does not connect to any database by itself. To have the agent run queries against your database, you need a MongoDB deployment or client tooling, which this skill does not include.
Install the mongodb skill
Download the ZIP from the skill's page on this directory and unzip it. The skill ships as a single file, SKILL.md, inside the mongodb folder.
For a personal install, place the unzipped folder in ~/.claude/skills/. To scope it to one project, place it in that project's .claude/skills/ folder instead.
In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
~/.claude/skills/How to trigger the skill with natural requests
You do not need a special command. Describe your MongoDB task in plain language, and mention MongoDB or your collections so the agent recognises the context. The skill's description covers queries, aggregation pipelines, indexes and schema design, so requests about those topics are the best fit.
- Should I embed the addresses in the user document or keep them in a separate collection? Our app reads them together.
- This aggregation over orders takes 8 seconds. Rewrite the pipeline so it filters earlier.
- Which indexes should I create for a query that filters on status, sorts by createdAt and ranges over total?
- Review this schema for unbounded arrays and tell me what to change.
Examples of useful guidance
The skill tells the agent to verify performance before deploying, using explain("executionStats"). It also asks for a schemaVersion field so future migrations are easier.
For slow queries, the agent will look for missing indexes and full collection scans. For index design, it will apply the ESR rule: equality fields first, sort fields second, range fields last.
- Use a partial index with partialFilterExpression when only a subset of documents is queried.
- Use a TTL index for sessions, logs or other temporary data that should expire automatically.
- Use db.collection.getIndexes() and the $indexStats aggregation stage to find unused indexes, then drop them.
db.collection.aggregate([{$indexStats:{}}])Safety notes: scripts and network
This skill runs no scripts and uses no network access. It is a text file of instructions. Any database action comes from tools you connect yourself.
The guidance is general. The agent cannot verify your deployment's actual state from this file alone, so review any index change or schema migration against your real data and workload before applying it to production.
Tips for getting better answers
Give the agent real context: document shapes, query text, index definitions and approximate collection sizes. The advice depends heavily on access patterns, which the agent cannot see unless you share them.
- Paste the output of explain("executionStats") when asking about slow queries.
- State how often each field is read and how often it is updated, since that drives embed-versus-reference decisions.
- Ask for the trade-offs, not just the answer, when a change affects write performance.
What people use it for
- Deciding whether to embed or reference user addresses, order items or comments.
- Rewriting a slow aggregation pipeline so $match runs before $group.
- Designing a compound index using the ESR rule for a filtered and sorted list query.
- Reviewing a schema for unbounded arrays that could hit the 16MB document limit.
- Setting up a TTL index to expire session documents automatically.
Frequently asked questions
How do I install the MongoDB agent skill?
Download the ZIP from this page and unzip it. Put the mongodb folder in ~/.claude/skills/ for personal use, or in a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
Does this skill need a MongoDB database to work?
The skill itself is only instructions, so it gives advice without a connection. To have the agent run queries against your data, you need a MongoDB deployment or client tooling, which is not included.
Is the MongoDB agent skill free?
The skill is listed under the Apache-2.0 licence. This page does not state pricing, so check the licence and the directory listing for any terms.
Does this skill work with PostgreSQL or MySQL?
No. The skill is specific to MongoDB, and its advice on embedding, aggregation and indexes would not apply to relational databases such as PostgreSQL or MySQL.
Does the skill run scripts or access the network?
According to the listing, it runs no scripts and uses no network access. It consists of a single SKILL.md file of instructions.
Can I use this skill to change my production database directly?
It is not recommended without review. The guidance is general and the agent cannot verify your deployment's actual state from this file alone, so check every index change or migration against your real data first.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits backend developers designing or reviewing a MongoDB data model, and engineers chasing slow queries or aggregation pipelines. It gives consistent conventions such as schemaVersion fields and ESR index ordering. If you use PostgreSQL, MySQL or another non-MongoDB database, or you want an agent to change production data unsupervised, pick a different tool.
Download the skill