mongodb-mcp-setup

mongodb-mcp-setup is a skill for Codex from PracticalSwan/agent-skills. It costs 57 tokens per session (3,778 once invoked), scanned C, a copy of mongodb-mcp-setup, MIT.

A step-by-step guide for connecting the MongoDB MCP server to MongoDB or MongoDB Atlas, including connection settings and local Docker setup.

In plain words
What is it for?
It is for setting up database access through a connection string, Atlas service account, or a local MongoDB-compatible environment.
Why use it?
It helps resolve missing configuration without requiring the user to give the agent their credentials.

Skill for Codex

Written for Codex: reads ~/.codex or $CODEX_HOME. Also seen: mentions Claude Code; mentions Codex.

Good fit It is for setting up database access through a connection string, Atlas service account, or a local MongoDB-compatible environment.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/practicalswan/agent-skills/mongodb-mcp-setup
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 PracticalSwan/agent-skills --skill mongodb-mcp-setup
Clone the repo
git clone --depth 1 https://github.com/PracticalSwan/agent-skills

Made for: Codex.

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/practicalswan/agent-skills/mongodb-mcp-setup/github.svg)](https://agentmods.dev/skills/practicalswan/agent-skills/mongodb-mcp-setup)
Your own site
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/mongodb-mcp-setup"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/mongodb-mcp-setup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mongodb-mcp-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/mongodb-mcp-setup"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/mongodb-mcp-setup.svg" alt="Reviewed on agentmods" width="80" 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,778 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.
Origin 92% 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.03778
Opus 5 $0.00028 $0.01889
Sonnet 5 $0.00011 $0.00756
Haiku 4.5 $0.00006 $0.00378

Measured today against content hash 4de661e35165, 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 today.

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

92% identical to mongodb-mcp-setup — 61 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.

mongodb-mcp-setup/SKILL.md · 374 lines

How it starts

The opening of the file, as written. The whole thing — 374 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, Copilot CLI, or another compatible client). 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 · 374 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed 4de661e35165
  2. 2d ago Changed e0194b7569b1
  3. 5d ago First seen · 374 lines · 57 tokens per session scan C ea37357c0589

Subscribe to this mod's changes

mongodb-mcp-setup is a skill published in the GitHub repository PracticalSwan/agent-skills (13 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 3,778 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 92% identical to mongodb-mcp-setup, differing in 61 lines, and is treated as a copy.

Related

Other skills, from other repositories

dbx

DBX CLI for database schema exploration and read-only queries. When the user needs to list connections, explore tables, describe schemas, run queries, or generate AI-friendly schema context from DBX-managed databases. Do NOT use for write operations unless the user explicitly confirms with --allow-writes.

t8y2/dbx · 61 tokens

azure-mgmt-mongodbatlas-dotnet

Manage MongoDB Atlas Organizations as Azure ARM resources using Azure.ResourceManager.MongoDBAtlas SDK. Use when creating, updating, listing, or deleting MongoDB Atlas organizations through Azure Marketplace integration. This SDK manages the Azure-side organization resource, not Atlas clusters/databases directly.

microsoft/skills · 64 tokens

nosqli

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

PurpleAILAB/Decepticon · 38 tokens

prisma-mongodb-upgrade

Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma Next. Triggers on "upgrade prisma mongodb"…

nitrocloudofficial/nitrostack · 95 tokens

byted-volcengine-mongodb

An operations tool for Volcengine MongoDB, a document database that stores data in flexible, JSON-like records. It can query managed MongoDB instances and return details for further explanation or diagnosis.

bytedance/agentkit-samples · 82 tokens

dynamic

Fullstack development with bkend.ai BaaS — authentication, database, API integration. Triggers: fullstack, BaaS, login, signup, database, web app.

ww-w-ai/bkit-claude-code · 38 tokens