跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 MongoDB,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
Summary
Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.
试试这样问
MongoDB 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → MongoDB、粘贴凭证、生成 MCP API key — 完成。无 Docker、无
git clone、无本地服务器。
MongoDB + ChatGPT
Query a MongoDB database directly: introspect collections and their field shapes, and run read-only find queries with filter, projection, sort and limit. Installs read-only; credentials are held encrypted rather than in the connection string.
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
MONGODB_HOST, MONGODB_PORT, MONGODB_DATABASE, MONGODB_USER, MONGODB_PASSWORD, MONGODB_AUTH_SOURCE
步骤 1 — 获取凭证
Setup
- Create a user with only
readon the database the agent should see:use admin db.createUser({ user: "amcp_reader", pwd: "change-me", roles: [{ role: "read", db: "shop" }] }) - Set
MONGODB_HOST,MONGODB_PORT(27017),MONGODB_DATABASE,MONGODB_USERandMONGODB_PASSWORD.
MONGODB_AUTH_SOURCE is the field that decides whether this works at all. MongoDB authenticates a user against the database the user was created in, not the one you want to read. A root or admin account created the usual way lives in admin, so MONGODB_AUTH_SOURCE must be admin even though MONGODB_DATABASE is shop. …
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 ChatGPT 中添加连接器
ChatGPT 通过 Connectors 功能 (Plus / Pro / Team / Enterprise 套餐) 支持 MCP 服务器。免费套餐不支持自定义连接器。
- 打开 ChatGPT → Settings → Connectors (或点击 composer 中的 🔧 图标 → Manage connectors)。
- 点击 "Add custom connector"。
- 填入:
- Name:
MongoDB - MCP server URL:
https://cloud.anythingmcp.com/mcp - Authentication: Bearer token → 粘贴 MCP API key
- Name:
- 点击 Connect。
可用工具
| Tool | What it does |
|---|---|
mongodb_schema | Introspect the database: every collection, its estimated document count and the field names and types inferred from a sampled document |
mongodb_find | Run a read-only find |
mongodb_find_recent | Read the most recent documents of one collection, newest first by a timestamp field |
mongodb_matching | Return the documents of one collection matching a filter, projecting only their ids, so a population can be sized without transferring it |
mongodb_query_examples | Show worked MongoDB query specs for this connector: filters, operators, projection, sort and the limits that apply |
FAQ
ChatGPT 免费套餐能用自定义 MCP Connectors 吗? 不能 — 需要 Plus、Pro、Team 或 Enterprise。
下一步
这份指南对你有帮助吗?