
Mongodb Query Optimizer
Targeted MongoDB query and index optimization that runs only when a user asks for performance help.
- skills.sh installs
- 7.7K
- GitHub stars
- 207
- last updated
- Aug 21, 2026
What it does
- Covers two workflows: diagnosing a specific query and reviewing cluster-wide slow queries from Atlas
- Uses
collection-indexes,explain, andfindfor query diagnosis, andatlas-get-performance-advisorfor slow logs and index suggestions - Enforces an index-first strategy, preferring a compound index that fully covers the query, following the ESR rule
- Designed for developers who have a MongoDB MCP server connection, with fallback to query-shape advice when tooling is unavailable
Install
$ npx -y skills add mongodb/agent-skills --skill mongodb-query-optimizer -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
MongoDB Query Optimizer
When this skill is invoked
Invoke only when the user wants:
- Query/index optimization or performance help
- Why a query is slow or how to speed it up
- Slow queries on their cluster and/or how to optimize them
Do not invoke for routine query authoring unless the user has requested help with optimization, slow queries, or indexing.
High Level Workflow
General Performance Help
If the user wants to examine slow queries, or is looking for general performance suggestions (not regarding any particular query):
- Use MongoDB MCP server atlas-get-performance-advisor tool to fetch slow query logs and performance advisor output
- Make suggestions based on this information
If Atlas MCP Server for Atlas is not configured or you don’t have enough information to run atlas-get-performance-advisor against the correct cluster, tell the user that general performance analysis requires Atlas MCP Server configuration with API credentials, and suggest they configure it or ask about a specific query instead.
Help with a Specific Query
If the user is asking about a particular query:
Details
- Repository
- github.com/mongodb/agent-skills
- Category
- Databases
- First seen
- May 16, 2026
More from mongodb/agent-skills
All 8Similar to Mongodb Query Optimizer
More Databases
mongodb-natural-language-queryingSkillmongodb/agent-skills5K installsGenerate read-only MongoDB find queries and aggregation pipelines from natural language, grounded in live schema and samples.
mongodb-connectionSkillmongodb/agent-skills5.7K installsOptimize MongoDB client connection pools, timeouts, and patterns across supported driver languages with context-first guidance.
Postgres MCP ProMCP servercrystaldba3.5K starsConnects to PostgreSQL databases for schema browsing, SQL execution, query tuning, and health checks.
PostgreSQL performance Tuner MCP ServerMCP serverisdaniel31 starsAI-assisted PostgreSQL tuning over a live database: slow queries, plans, indexes, bloat, and health.
database-query-optimizationSkillaj-geddes/useful-ai-prompts594 installsPractical query tuning guide that uses EXPLAIN ANALYZE, indexing, and optimization checklists to cut response times.