MongoDB Agent Skills is an official collection of skills and plugins that help AI coding agents work with MongoDB databases, including Atlas and self-managed deployments. Developers use it for query writing, schema design, query optimization, Atlas Search, and vector search. The catalogue entries are MongoDB’s own agent skills, plugins, and setup instructions.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mongodb/agent-skills --skill mongodb-mcp-setupgit clone --depth 1 https://github.com/mongodb/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mongodb/agent-skills/mongodb-mcp-setup)<a href="https://agentmods.dev/skills/mongodb/agent-skills/mongodb-mcp-setup"><img src="https://agentmods.dev/badge/skills/mongodb/agent-skills/mongodb-mcp-setup.svg" alt="Measured on agentmods" height="20"></a>- Socket pass
- Snyk warn
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.03233 |
| Opus 5 | $0.00028 | $0.01617 |
| Sonnet 5 | $0.00011 | $0.00647 |
| Haiku 4.5 | $0.00006 | $0.00323 |
Grade C, and why
mongodb-mcp-setup scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
chmod 600 ~/.mcp-env Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- **If any `CODEX_*` variables are present** → the user is running **Codex**. Credentials are stored in `~/.codex/config.toml` (macOS/Linux) or `%USERPROFILE%\.codex\config.toml` (Windows), not in shell environment varia This is a copy
100% identical to mongodb-mcp-setup — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 325 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MongoDB MCP Server Setup
This skill guides users through configuring the MongoDB MCP server for use with an agentic client.
Overview
The MongoDB MCP server requires authentication. Users have three options:
-
Connection String (Option A): Direct connection to a specific cluster
- Quick setup for single cluster
- Requires
MDB_MCP_CONNECTION_STRINGenvironment variable
-
Service Account Credentials (Option B): MongoDB Atlas Admin API access
- Recommended for Atlas users - simplifies authentication and data access
- Access to Atlas Admin API and dynamic cluster connection via
atlas-connect-cluster - No manual DB user credential management
- Requires
MDB_MCP_API_CLIENT_IDandMDB_MCP_API_CLIENT_SECRETenvironment variables
-
Atlas Local (Option C): Local development with Docker
- Best for local testing - zero configuration required
- Runs Atlas locally in Docker, requires Docker installed
- No credentials or cloud cluster access
This is an interactive step-by-step guide. The agent detects the user's environment and provides tailored instructions, but never asks for or handles credentials — users add those directly to their shell profile or agentic client config in Step 5. Make this clear to the user whenever credentials come up in Steps 3a and 3b.
Step 0: Detect Client
Before anything else, determine which agentic client the user is running. This controls how credentials are configured in Step 1 and Step 5.
Run:
env | grep "^CODEX_"
- If no
CODEX_*variables are present → the user is running a shell-based client (Claude, Cursor, Gemini CLI, Copilot CLI, etc.). Credentials are configured via shell profile environment variables. - If any
CODEX_*variables are present → the user is running Codex. Credentials are stored in~/.codex/config.toml(macOS/Linux) or%USERPROFILE%\.codex\config.toml(Windows), not in shell environment variables. The desktop app does not inherit shell env vars when launched from Finder, Launchpad, or the Windows Start menu.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 325 lines · 57 tokens per session scan C a2916a602732
mongodb-mcp-setup is a skill published in the GitHub repository mongodb/agent-skills (182 stars, last pushed 5d ago), licensed Apache-2.0. It adds 57 tokens to every session and 3,233 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 2 findings (asks for root, reads agent configuration directories). It is 100% identical to mongodb-mcp-setup, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
azure-documentdb
Expert knowledge for Azure DocumentDB development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using DocumentDB search (BM25/vector), Data API, MongoDB compatibility, change…
mongodb-atlas-checker
Verify MongoDB Atlas setup and configuration for backend applications. Checks connection strings, environment variables, connection pooling, and ensures proper setup for Next.js and NestJS applications. Use when verifying MongoDB Atlas setup, checking connection strings or environment variables, or troubleshooting…
mongodb-migration-expert
Database schema design, indexing, and migration guidance for MongoDB-based applications. Use when adding or changing MongoDB collections, indexes, or fields, designing schema for multi-tenant or large datasets, or planning forward-only migrations.
database-schema-design
Use when designing database schemas, creating migrations, modeling data relationships, optimizing database queries, adding indexes, or selecting between SQL and NoSQL storage.
deprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset…
nosqli
NoSQL injection — MongoDB operator injection ($ne, $gt, $where, $regex), CouchDB / Firebase / Redis attack patterns, auth bypass, blind extraction.