mongodb-mcp-setup

mongodb-mcp-setup is a skill for Claude Code, Codex from mongodb/agent-skills. It costs 57 tokens per session (3,233 once invoked), scanned C, a copy of mongodb-mcp-setup, Apache-2.0.

A setup guide for connecting the MongoDB MCP server to a database. It explains connection strings, MongoDB Atlas service-account access, and Atlas Local, which runs MongoDB locally in Docker.

In plain words
What is it for?
Use it when MongoDB connection settings are missing, when configuring Atlas access, or when setting up a local Docker-based development database.
Why use it?
It helps identify the right connection method and required settings without asking the agent to handle secret credentials. The guide adapts its instructions to the user's environment.

Skill for Claude CodeCodex ✓ vendor

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also reads ~/.codex or $CODEX_HOME. Also seen: mentions Codex; mentions Gemini CLI.

Part of the mongodb plugin — 1 skill shipped together

Good fit Use it when MongoDB connection settings are missing, when configuring Atlas access, or when setting up a local Docker-based development database.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mongodb/agent-skills/mongodb-mcp-setup
About the project

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.

mongodb/agent-skills · 182 stars · on GitHub

Install

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.

Any agent
npx skills add mongodb/agent-skills --skill mongodb-mcp-setup
Clone the repo
git clone --depth 1 https://github.com/mongodb/agent-skills

Made for: Claude Code, Codex.

Or install mongodb, the plugin that ships this one along with the rest of its 1 skill.

Wrote 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.

agentmods badge for mongodb-mcp-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/mongodb/agent-skills/mongodb-mcp-setup.svg)](https://agentmods.dev/skills/mongodb/agent-skills/mongodb-mcp-setup)
Your own site
<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>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,233 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 27 May 2026
  • Snyk warn 27 May 2026
How audits are shown
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash a2916a602732, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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
Origin

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.

plugins/mongodb/.agy-plugin/skills/mongodb-mcp-setup/SKILL.md · 325 lines

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:

  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:

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.

Read the full file on GitHub · 325 lines

Changes

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.

  1. 8d ago First seen · 325 lines · 57 tokens per session scan C a2916a602732

Subscribe to this mod's changes

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.

Related

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…

MicrosoftDocs/Agent-Skills · 120 tokens

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…

shipshitdev/skills · 62 tokens

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.

shipshitdev/skills · 51 tokens

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.

Pixel-Process-UG/superkit-agents · 32 tokens

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…

addyosmani/agent-skills · 69 tokens

nosqli

NoSQL injection — MongoDB operator injection ($ne, $gt, $where, $regex), CouchDB / Firebase / Redis attack patterns, auth bypass, blind extraction.

PurpleAILAB/Decepticon · 38 tokens