mongodb-mcp-setup
Guide users through configuring key MongoDB MCP server options.
Skill by mongodbOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mongodb-mongodb-mcp-setup
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/mongodb-mcp-setup
What's inside
- Skill name
mongodb-mcp-setup- Description
- Guide users through configuring key MongoDB MCP server options. Use this skill when a user has the MongoDB MCP server installed but hasn't configured the required environment variables, or when they ask about connecting to MongoDB/Atlas and don't have the credentials set up.
- License
- Apache-2.0
- Metadata
- version: 1.0.0
- Instructions
- 318 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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: 1. **Connection String** (Option A): Direct connection to a specific cluster - Quick setup for single cluster - Requires `MDB_MCP_CONNECTION_STRING` environment variable 2. **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_ID` and `MDB_MCP_API_CLIENT_SECRET` environment variables 3. **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: ```bash 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. Carry this **client type** (Codex vs. shell-based) forward through every subsequent step. ## Step 1: Check Existing Configuration Check whether credentials are already configured. **For shell-based clients** — check the current environment: ```bash env | grep "^MDB_MCP" | sed '/^MDB_MCP_READ_ONLY=/!s/=.*/=[set]/' ``` **For Codex** — search `~/.codex/config.toml` (macOS/Linux) or `%USERPROFILE%\.codex\config.toml` (Windows): ```bash grep -E 'MDB_MCP_(CONNECTION_STRING|API_CLIENT_ID|API_CLIENT_SECRET|READ_ONLY)' ~/.codex/config.toml 2>/dev/null | sed '/MDB_MCP_READ_ONLY/!s/[[:space:]]*=[[:space:]].*/ = "[set]"/' ``` **Interpretation (both):** - If `MDB_MCP_CONNECTION_STRING` appears → connection string auth is configured - If both `MDB_MCP_API_CLIENT_ID` and `MDB_MCP_API_CLIENT_SECRET` appear → service account auth is configured. If only one is present, treat it as incomplete. - If `MDB_MCP_READ_ONLY` appears → read-only mode is enabled **Partial Configuration Handling:** - User wants to add read-only to existing setup (has auth, no read-only flag) → skip to Step 4 - User wants to switch authentication methods → explain they should remove the old credentials first (from `config.toml` for Codex, from their shell profile for shell-based clients), then proceed with Steps 2–5 - User wants to update credentials → skip to Step 5 **Important**: If the user wants an Atlas Admin API action (managing clusters, creating users, performance advisor) but only has `MDB_MCP_CONNECTION_STRING`, explain they need service account credentials and offer to walk through setup. ## Step 2: Present Configuration Options If no valid configuration exists, present the options: **Connection String (Option A)** — Best for: - Single cluster access - Existing database credentials - Self-hosted MongoDB or no Atlas Admin API needs **Service Account Credentials (Option B)** — Best for: - MongoDB Atlas users (recommended) - Multi-cluster switching - Atlas Admin API access (cluster management, user creation, performance monitoring) **Atlas Local (Option C)** — Best for: - Local development/testing without cloud setup - Fastest setup with Docker, no credentials required Ask the user which option they'd like to proceed with. ## Step 3a: Connection String Setup If the user chooses Option A: ### 3a.1: Explain How to Find the Connection String Explain where and how to obtain their connection string: **For MongoDB Atlas:** 1. Go to [cloud.mongodb.com](https://cloud.mongodb.com) 2. Select your cluster → click **Connect** 3. Choose **Drivers** or **Shell** → copy the connection string 4. Replace `<username>` and `<password>` with your database user credentials **For self-hosted MongoDB:** - The connection string is typically configured by your DBA or in your application config - Format: `mongodb://username:password@host:port/database` **Expected formats:** - `mongodb://username:password@host:port/database` - `mongodb+srv://username:password@cluster.mongodb.net/database` - `mongodb://host:port` (local, no auth)
From mongodb/agent-skills, Apache-2.0.
More from mongodb/agent-skills
- 0.794score
mongodb-search-and-ai
mongodbOfficial
Covers everything about search in MongoDB: Atlas Search (full-text), Vector Search (semantic), and Hybrid Search.
SkillAFreshness: A★ 190Claude Code +9 - 0.785score
mongodb-qe-size-estimation
mongodbOfficial
Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption (QE) enabled.
SkillAFreshness: A★ 190Claude Code +9 - 0.691score
mongodb-connection
mongodbOfficial
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-atlas-stream-processing
mongodbOfficial
Manages MongoDB Atlas Stream Processing (ASP) workflows.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-schema-design
mongodbOfficial
MongoDB schema design patterns and anti-patterns.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-query-optimizer
mongodbOfficial
Help with MongoDB query optimization and indexing.
SkillCFreshness: C★ 190Claude Code +9 - 0.685score
mongodb-natural-language-querying
mongodbOfficial
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents.
SkillCFreshness: C★ 190Claude Code +9 - 0.616score
review-skill
mongodbOfficial
Review a proposed Agent Skill for structural validity and content quality before publishing.
SkillDFreshness: D★ 190Claude Code +9
Signals
- Stars
- 190
- Forks
- 42
- Open issues
- 0
- Last commit (this folder)
- Jul 20, 2026 (3 months ago)
- Last release
- Mar 25, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- Apache-2.0
- Repository
- github.com/mongodb/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from mongodb
- 0.794score
mongodb-search-and-ai
mongodbOfficial
Covers everything about search in MongoDB: Atlas Search (full-text), Vector Search (semantic), and Hybrid Search.
SkillAFreshness: A★ 190Claude Code +9 - 0.785score
mongodb-qe-size-estimation
mongodbOfficial
Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption (QE) enabled.
SkillAFreshness: A★ 190Claude Code +9 - 0.691score
mongodb-connection
mongodbOfficial
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-query-optimizer
mongodbOfficial
Help with MongoDB query optimization and indexing.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-atlas-stream-processing
mongodbOfficial
Manages MongoDB Atlas Stream Processing (ASP) workflows.
SkillCFreshness: C★ 190Claude Code +9 - 0.691score
mongodb-schema-design
mongodbOfficial
MongoDB schema design patterns and anti-patterns.
SkillCFreshness: C★ 190Claude Code +9
Cite this page
mongodb-mcp-setup skill. Agent Mart. https://agentmart.dev/skills/mongodb-mongodb-mcp-setup (last updated 2026-10-24)