build-with-ai
For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt
<!-- Tab options on this page. Append to the .md URL to filter: ?tabs=<id,...> select specific tabs (e.g. ?tabs=nodejs,shell) ?allTabs=true include every tab (no param) default: one tab per tabset
Available tabs: other tabs: docs-in-mcp, markdown, chat-with-page, llms-txt -->
Build with AI
MongoDB provides tools and integrations to help you build effective AI-powered applications. Use the resources on this page to connect LLMs and AI agents with context about MongoDB features and best practices.
Agent-Assisted Development
Give your LLM or AI agent context to leverage MongoDB features more effectively.
-
MongoDB MCP Server: The MongoDB MCP Server connects your AI application to MongoDB features and documentation. You can also query MongoDB clusters using natural language from AI clients that support MCP.
-
MongoDB 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, and Gemini.
View all 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.
Queryable Encryption Size Estimation
Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption enabled. This skill calculates index storage, total disk storage, and memory from your schema, fields, and query types, so you can configure Queryable Encryption without scalability and performance issues. For Queryable Encryption only, not Client-Side Field Level Encryption (CSFLE).
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
Docs in MCP
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.
