Agent-Assisted Development
Give your LLM or agent context to leverage MongoDB features more effectively:
Agent Skills
MongoDB Agent Skills are pre-built, reusable instructions that teach AI coding agents how to perform common MongoDB tasks—from setting up connections and designing schemas to writing queries and optimizing performance. The following skills are available when you use the MongoDB plugins for Claude, Cursor, or Gemini. For installation instructions, see MongoDB Agent Skills.
Infrastructure
MongoDB MCP Setup
Guides the agent through setting up the MongoDB MCP (Model Context Protocol) Server, which enables direct interaction with your MongoDB databases. This skill helps configure authentication credentials and connection settings.
MongoDB Connection
Optimize MongoDB client connection configuration (pools, timeouts, patterns) to configure connection pools, debug or troubleshoot connection errors, and optimize performance issues related to connections. Inlcudes building serverless functions with MongoDB, creating API endpoints that use MongoDB, optimizing high-traffic MongoDB applications, creating long-running tasks and concurrency, or debugging connection-related failures.
Data Modeling
Schema Design
Guides developers through MongoDB schema design best practices. This skill helps design efficient document structures, implement validation rules, and optimize schemas for specific use cases.
Advanced Features
Atlas Stream Processing
Comprehensive skill for building, operating, and debugging MongoDB Atlas Stream Processing pipelines. Handles workspace provisioning, data source/sink connections, processor lifecycle operations, debugging diagnostics, and tier sizing. Supports Kafka, Atlas clusters, S3, HTTPS, and Lambda integrations for streaming data workloads and event processing.
Natural Language Querying
Translates natural language descriptions into MongoDB queries and aggregation pipelines. This skill uses collection schemas, sample documents, and index information to generate accurate, optimized queries. Supports complex operations like geospatial queries, text search, and multi-collection joins. Distinct from MongoDB Atlas Search and Vector Search (see Search and AI Recommendations skill below).
Query Optimizer
Analyzes and optimizes MongoDB query performance. This skill ensures queries are properly indexed, debugs slow queries using Atlas Performance Advisor, and provides best practice recommendations for aggregation pipelines.
Search and AI Recommendations
Provides guidance for implementing MongoDB Atlas Search and AI-powered recommendations. This skill helps configure search indexes, build search queries, and integrate AI capabilities into applications.
Use MongoDB Documentation with AI
Use the MongoDB MCP Server to access documentation and ask questions.
The MongoDB MCP Server includes tools to search MongoDB documentation using natural language:
list-knowledge-sources: Lists available MongoDB documentation sources and their versions. For example, manual, drivers, Atlas.search-knowledge: Searches the MongoDB documentation knowledge base with a natural language query and returns relevant content chunks with links.
Example
Ask your AI agent:
"How do I create a compound index in MongoDB?"
The agent uses the search-knowledge tool to find relevant documentation
and returns text excerpts with URLs to the full pages.
You can optionally filter searches by specific documentation sources or versions.
Interact with any page in MongoDB documentation as markdown to use as context for your LLM. You can copy a page as markdown using the documentation UI, or have your agent access the markdown directly from the page URL.
Using the Documentation UI
To copy a page as markdown using the documentation UI:
Open the page in your browser.
Press the Copy page button in the top right corner of the page.
You can then paste the markdown into a file for your agent to use or into a chat with your LLM.
Using the Page URL
To derive the markdown version of the page from the page URL:
Remove the trailing slash from the end of the page URL.
Append
.mdto the trimmed URL.
You can have your agent access the markdown directly from the resulting URL.
Example
The current documentation page URL is:
https://www.mongodb.com/docs/build-with-ai/
The markdown version of this page is available at:
https://www.mongodb.com/docs/build-with-ai.md
You can chat with the page directly from the documentation UI using our MongoDB AI Assistant. This feature is available on most pages in the documentation.
To chat with the page:
Open the page in your browser.
Press the button in the top right corner of the page next to the Copy page button.
Select Ask a Question from the drop-down menu.
This opens a chat window where you can ask questions about the page. The LLM uses the page content as context to generate a response.
The MongoDB documentation provides an llms.txt file at:
https://www.mongodb.com/docs/llms.txt
This file contains a list of MongoDB documentation pages that are relevant to LLMs. You can use this file to provide your LLM with context about MongoDB concepts and use cases.