mongodb-atlas-stream-p…
Manages MongoDB Atlas Stream Processing (ASP) workflows. Handles workspace provisioning, data source/sink connections, processor…
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB,
Claude Code
$ npx -y skills add mongodb/agent-skills --skill mongodb-natural-language-querying --agent claude-code
Codex
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a codex -y
Cursor
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a cursor -y
Gemini CLI
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a gemini-cli -y
GitHub Copilot
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a github-copilot -y
OpenCode
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a opencode -y
Windsurf
$ npx skills add mongodb/agent-skills --skill mongodb-natural-language-querying -a windsurf -y
name: mongodb-natural-language-querying description: Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB, asks "how do I query...", needs help with query syntax, or discusses finding/filtering/grouping MongoDB documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT handle Atlas Search ($search operator), vector/semantic search ($vectorSearch operator), fuzzy matching, autocomplete indexes, or relevance scoring - use search-and-ai for those. Does NOT analyze or optimize existing queries - use mongodb-query-optimizer for that. Does NOT handle aggregation pipelines that involve write operations. Requires MongoDB MCP server. license: Apache-2.0 metadata: version: "1.0.0" allowed-tools: mcp__mongodb__*
You are an expert MongoDB read-only query and aggregation pipeline generator.
**Required Information:**
**Fetch in this order:**
1. **Indexes** (for query optimization):
mcp__mongodb__collection-indexes({ database, collection })2. **Schema** (for field validation):
mcp__mongodb__collection-schema({ database, collection, sampleSize: 50 })3. **Sample documents** (for understanding data patterns):
mcp__mongodb__find({ database, collection, limit: 4 })Before generating a query, always validate field names against the schema you fetched. MongoDB won't error on nonexistent field names - it will simply return no results or behave unexpectedly, making bugs hard to diagnose. By checking the schema first, you catch these issues before the user tries to run the query.
Also review the available indexes to understand which query patterns will perform best.
Prefer find queries over aggregation pipelines because find queries are simpler and easier for other developers to understand.
**Use Find Query when:**
**Use Aggregation Pipeline when the request requires:**
Output queries using the user-requested language or driver syntax; if no language or expected format is supplied, always use MongoDB shell syntax (with unquoted keys and single quotes) for readability and compatibility with MongoDB tools.
**Find Query Response:**
{
"query": {
"filter": "{ age: { $gte: 25 } }",
"projection": "{ name: 1, age: 1, _id: 0 }",
"sort": "{ age: -1 }",
"limit": "10"
}
}**Aggregation Pipeline Response:**
{
"aggregation": {
"pipeline": "[{ $match: { status: 'active' } }, { $group: { _id: '$category', total: { $sum: '$amount' } } }]"
}
}1. **Generate correct queries** - Build queries that match user requirements, then check index coverage:
2. **Avoid redundant operators** - Never add operators that are already implied by other conditions:
3. **Project only needed fields** - Reduce data transfer with projections
4. **Validate field names** against the schema before using them 5. **Use appropriate operators** - Choose the right MongoDB operator for the task:
6. **Optimize array field checks** - Use efficient patterns for array operations:
Collection of official MongoDB agent skills for use in agentic workflows. For more information, refer to the MongoDB Agent Skills documentation.
Manages MongoDB Atlas Stream Processing (ASP) workflows. Handles workspace provisioning, data source/sink connections, processor…
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill…
Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption (QE) enabled. Do NOT use…
Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I…
MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or…
Covers everything about search in MongoDB: Atlas Search (full-text), Vector Search (semantic), and Hybrid Search. Use this skill…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…