Token导航 LogoToken导航

Agent Skill · 研究检索

mongodb-mcp-setup(MongoDB MCP 设置)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

mongodb-mcp-setup 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 70,834。

总安装 198周安装 8GitHub Stars 652下载 62核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mongodb-mcp-setup(MongoDB MCP 设置)
来源仓库:https://github.com/fcakyon/claude-codex-settings
仓库路径:skills/mongodb-mcp-setup
安装命令:
npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-mcp-setup
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-mcp-setup

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

指导用户配置 MongoDB MCP Server 以实现与代理客户端的连接。提供连接字符串与 Atlas 服务账户两种认证方式可选方案。支持动态集群连接与 Atlas Admin API 访问权限自动管理。未配置认证信息时将引导用户参考文档完成环境初始化步骤。

mongodb-mcp-setup 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/mongodb-mcp-setup

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mongodb-mcp-setup 怎么安装?

在终端执行 npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-mcp-setup。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mongodb-mcp-setup 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mongodb-mcp-setup 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

mongodb-mcp-setup 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

mongodb-mcp-setup 用的人多吗?

公开数据是累计安装 198 次,近一周安装 8 次,下载 62 次,GitHub 652 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mongodb-mcp-setup 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
mongodb-mcp-setup

MongoDB MCP 设置 · 本页

198652接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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

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

  1. 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 in Step 5. Make this clear to the user whenever credentials come up in Steps 3a and 3b.

Step 1: Check Existing Configuration

Before starting the setup, check if the user already has the required environment variables configured.

Run this command to check for existing configuration (masking values to avoid exposing credentials):

env | grep "^MDB_MCP" | sed '/^MDB_MCP_READ_ONLY=/!s/=.*/=[set]/'

Interpretation:

  • If MDB_MCP_CONNECTION_STRING is set → connection string auth is configured
  • If both MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET are set → service account auth is configured. If only one is set, treat it as incomplete.
  • If MDB_MCP_READ_ONLY=true → read-only mode is enabled

Partial Configuration Handling:

  • User wants to add read-only to existing setup (has auth, no MDB_MCP_READ_ONLY) → skip to Step 4
  • User wants to switch authentication methods → explain they should remove the old variables from their shell profile first, then proceed with Steps 2–5
  • User wants to update credentials → skip to Step 5 (profile editing instructions)

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
  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)

Proceed to Step 4 (Determine Read-Only Access).

Step 3b: Service Account Setup

If the user chooses Option B:

3b.1: Guide Through Atlas Service Account Creation

Direct the user to create a MongoDB Atlas Service Account:

Full documentation: https://www.mongodb.com/docs/mcp-server/prerequisites/

Walk them through the key steps:

  1. Navigate to MongoDB Atlas — cloud.mongodb.com
  2. Go to Access Manager → Service Accounts → Create Service Account
  3. Set Permissions — Grant Organization Member or Project Owner (see docs for exact permission mappings)
  4. Generate Credentials — Create Client ID and Secret

- ⚠️ The Client Secret is shown only once — save it immediately before leaving the page

  1. Note both values — you'll need Client ID and Client Secret for Step 5

3b.2: API Access List Configuration

⚠️ CRITICAL: The user MUST add their IP address to the service account's API Access List, or all Atlas Admin API operations will fail.

Steps:

  1. On the service account details page, find API Access List
  2. Click Add Access List Entry
  3. Add your current IP address. Use a specific IP or CIDR range whenever possible.

- ⚠️ 0.0.0.0/0 allows access from any IP — this is a significant security risk. Only use it as a last resort for temporary testing and remove it immediately afterward. It should never be used in production.

  1. Save changes

This is more secure than global Network Access settings as it only affects API access, not database connections.

Proceed to Step 4 (Determine Read-Only Access).

Step 3c: Atlas Local Setup

If the user chooses Option C:

3c.1: Check Docker Installation

Verify Docker is installed:

docker info

If not installed, direct them to: https://www.docker.com/get-started

3c.2: Confirm Setup Complete

Atlas Local requires no credentials — the user is ready to go:

  • Create deployments: atlas-local-create-deployment
  • List deployments: atlas-local-list-deployments
  • All operations work out of the box with Docker

Skip Steps 4 and 5 (no configuration needed) and proceed to Step 6 (Next Steps).

Step 4: Determine Read-Only vs Read-Write Access

Only applies to Options A and B. Skip to Step 6 for Option C.

Ask whether they want read-only or read-write access:

  • Read-Write (default): Full data access, modifications allowed

- Best for: Development, testing, administrative tasks

  • Read-Only: Data reads only, no modifications

- Best for: Production data safety, reporting, compliance

If read-only: include export MDB_MCP_READ_ONLY="true" in the profile snippet in Step 5. If read-write: omit MDB_MCP_READ_ONLY (defaults to read-write).

Proceed to Step 5 (Update Shell Profile).

Step 5: Update Shell Profile

Help the user add the environment variables to their shell profile. Do not ask for or handle credentials — provide exact instructions so the user can add them directly.

5.1: Detect Shell and Profile File

If the user is on Windows, assume PowerShell but ask the user to confirm. For Unix/macOS, detect the shell to determine the correct profile file by running:

echo $SHELL

Based on the result, identify the appropriate profile file using your training data. If unsure which shell or profile they are using, ask them to specify the path.

5.2: Show the Exact Snippet to Add

Tell the user to store credentials in a dedicated ~/.mcp-env file (not directly in their shell profile). This keeps credentials out of files that are often group/world readable by default and prevents accidentally committing them to git. Make sure to adapt the path in the instructions to be in the same folder as the shell profile file.

Step 1: Create/edit ~/.mcp-env (e.g. nano ~/.mcp-env) and add:

For Connection String (Option A):

# MongoDB MCP Server Configuration
export MDB_MCP_CONNECTION_STRING="<paste-your-connection-string-here>"

For Service Account (Option B):

# MongoDB MCP Server Configuration (Atlas Service Account)
export MDB_MCP_API_CLIENT_ID="<paste-your-client-id-here>"
export MDB_MCP_API_CLIENT_SECRET="<paste-your-client-secret-here>"

If read-only was chosen (Step 4), also add:

export MDB_MCP_READ_ONLY="true"

Step 2: Restrict permissions on the file so only the owner can read it:

chmod 600 ~/.mcp-env # adapt command for Windows if needed

Step 3: Source the file from the shell profile. Tell the user to open their profile file (e.g. code ~/.zshrc, nano ~/.zshrc) and add this line:

source ~/.mcp-env

Adjust syntax for the detected shell (e.g. for fish: bass source ~/.mcp-env or set variables directly with set -x; for PowerShell: dot-source a .ps1 file instead).

5.3: After Editing — Reload and Verify

Once the user has saved the file, provide the commands to reload and verify:

Reload the profile:

source ~/.zshrc   # adjust path to match their profile file

Verify the variables are set (masking values to avoid exposing credentials):

env | grep "^MDB_MCP" | sed '/^MDB_MCP_READ_ONLY=/!s/=.*/=[set]/'

Expected output should show the variable name(s) they just added, each with =[set]. If nothing appears, check that source ~/.mcp-env is in the profile file, the profile was reloaded, and ~/.mcp-env was saved.

Proceed to Step 6 (Next Steps).

Step 6: Next Steps

For Options A & B (Connection String / Service Account):

  1. Restart the agentic client: Fully quit the client, then in your terminal run source <profile-file> (e.g. source ~/.zshrc, adjust command and path based on the user shell) to load the new variables into the current shell session. Open the client from that same shell session so it inherits the environment.
  2. Verify MCP Server: After restart, test by performing a MongoDB operation.
  3. Using the Tools:

- Option A: Direct database access tools available - Option B: Additionally has Atlas Admin API tools and atlas-connect-cluster - Important (Option B): Ensure your IP is in the service account's API Access List or all API calls will fail

For Option C (Atlas Local):

  1. Ready to use: No restart or configuration needed!
  2. Next steps:

- Create deployments: atlas-local-create-deployment - List deployments: atlas-local-list-deployments - Use standard database operations once connected

Troubleshooting

  • Variables not appearing after source: Check the profile file path and confirm the file was saved
  • Client doesn't pick up variables: Ensure full restart (quit + reopen), not just a reload
  • Invalid connection string format: Re-check the format; must start with mongodb:// or mongodb+srv://
  • Atlas Admin API errors (Option B): Verify your IP is in the service account's API Access List
  • Read-only mode not working: Check MDB_MCP_READ_ONLY=true is set — run env | grep ^MDB_MCP_READ_ONLY
  • fish/PowerShell: Syntax differs — use set -x (fish) or $env: (PowerShell) instead of export

平台分布

Codex

36.05%
按下载量换算22

Claude

27.01%
按下载量换算17

Cursor

20.14%
按下载量换算12

Gemini CLI

9.82%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills