# MongoDB Query Optimizer

Improve MongoDB query performance and indexes\.

Canonical: https://claudelist.com/listings/skill-mongodb-agent-skills-mongodb-query-optimizer

Category: Skills

Source: vendor · MongoDB

Source checked: 2026-10-14

Website: https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-query-optimizer

Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query writing unless user asks for performance or index help. Prefer indexing as optimization strategy. Use MongoDB MCP when available.

## Install or set up

1. Review this skill’s `SKILL.md` and any prerequisites at the source.
2. From the project where you use Claude Code, run the command below. It installs only this skill into project scope; add `-g` for your personal scope.
3. Restart Claude Code and invoke `/mongodb-query-optimizer` or ask Claude to use the skill. If it does not appear, check `.claude/skills/` and the source’s setup notes.

```sh
npx skills add https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-query-optimizer --agent claude-code
```

Installation guide: https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-query-optimizer
