Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Db Mongo

ASecurity

Query MongoDB databases configured in .env (DB_MONGO_N_*). Use when the user asks to query, explore, or audit data in a MongoDB database. Picks connection by label (e.g. 'orders-dev', 'analytics-prod') or numeric index. Read-only by default — writes refused unless DB_MONGO_N_ALLOW_WRITE=true on that block.

529 stars
0 votes
0 copies
0 views
Added 5/29/2026
ai-agentspythongobashrailsgitdatabase

Works with

cursorcli

Security Analysis

A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned 5/29/2026

$npx -y skills add evolution-foundation/evo-nexus --skill db-mongo --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Db Mongo?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Db Mongo
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/evolution-foundation-db-mongo/badge)](https://www.skillsdirectory.com/skills/evolution-foundation-db-mongo)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: db-mongo
description: "Query MongoDB databases configured in .env (DB_MONGO_N_*). Use when the user asks to query, explore, or audit data in a MongoDB database. Picks connection by label (e.g. 'orders-dev', 'analytics-prod') or numeric index. Read-only by default — writes refused unless DB_MONGO_N_ALLOW_WRITE=true on that block."
metadata:
  openclaw:
    requires:
      env:
        - DB_MONGO_1_LABEL
      bins:
        - python3
    primaryEnv: DB_MONGO_1_LABEL
    files:
      - "scripts/*"
      - "references/*"
---

# db-mongo

Query MongoDB databases declared in `.env`. Same numbered block pattern as every other `db-*` and `SOCIAL_*_N_*` integration.

## Setup — one-time, per database

Add a block to `.env` (gitignored). Two ways to define a connection:

### Option A — URI (recommended for Atlas / managed)

```env
DB_MONGO_1_LABEL=orders-dev
DB_MONGO_1_URI=mongodb+srv://user:pw@cluster0.abc.mongodb.net/orders?retryWrites=true
# DB_MONGO_1_DATABASE=orders          # optional if in URI
# DB_MONGO_1_ALLOW_WRITE=false
# DB_MONGO_1_QUERY_TIMEOUT=30
# DB_MONGO_1_MAX_ROWS=1000
```

### Option B — components

```env
DB_MONGO_2_LABEL=analytics-prod
DB_MONGO_2_HOST=mongo.prod.internal
DB_MONGO_2_PORT=27017
DB_MONGO_2_DATABASE=analytics
DB_MONGO_2_USER=agent_readonly
DB_MONGO_2_PASSWORD=...
# DB_MONGO_2_AUTH_SOURCE=admin        # optional
# DB_MONGO_2_TLS=true                 # optional
```

URI wins when both are set. `LABEL` is always required.

## Usage

All commands output a single JSON line on stdout (safe to pipe).

### List configured connections
```bash
python3 .claude/skills/db-mongo/scripts/db_client.py accounts
```

### Health-check a connection (MongoDB ping)
```bash
python3 .claude/skills/db-mongo/scripts/db_client.py test orders-dev
```

### Find documents
```bash
# All (up to MAX_ROWS)
python3 .claude/skills/db-mongo/scripts/db_client.py find orders-dev customers

# With filter (JSON)
python3 .claude/skills/db-mongo/scripts/db_client.py find orders-dev customers \
  '{"status": "active"}' 20
```

### Aggregation pipeline
```bash
python3 .claude/skills/db-mongo/scripts/db_client.py aggregate orders-dev orders \
  '[{"$match": {"status": "paid"}}, {"$group": {"_id": "$product", "total": {"$sum": "$amount"}}}]'
```

### Explore database
```bash
# List collections
python3 .claude/skills/db-mongo/scripts/db_client.py collections orders-dev

# DB stats (size, object count, index size)
python3 .claude/skills/db-mongo/scripts/db_client.py stats orders-dev
```

## Output shape

Successful find/aggregate:
```json
{
  "ok": true,
  "query_id": "uuid-v4",
  "label": "orders-dev",
  "collection": "customers",
  "documents": [{"_id": "...", "email": "a@b.com"}],
  "row_count": 1,
  "truncated": false,
  "execution_time_ms": 12
}
```

## Guardrails

- **Read-only by default.** Aggregation pipelines containing `$out` or `$merge` (write stages) are refused unless `ALLOW_WRITE=true`. `find` is always safe; no separate write commands are exposed in v1.
- **Query timeout** applied at the server selection, socket, and connect levels.
- **Result size** capped at `MAX_ROWS` (default 1000). For aggregations we stop iterating the cursor at that point.
- **Credentials** never leave `.env`; `accounts` strips password before returning.

## Error codes

- `no_connections`, `not_found`, `ambiguous`, `config_error` — same as other `db-*` skills
- `driver_missing` — `pymongo` not installed
- `connection_failed` — network, auth, TLS, or timeout
- `invalid_filter` / `invalid_pipeline` — JSON parse failed
- `write_blocked` — aggregation with `$out`/`$merge` on `ALLOW_WRITE=false`
- `usage` — wrong CLI args

## Workflow

1. `accounts` to confirm the connection label.
2. `collections` to see what's in there.
3. `find` or `aggregate` with the smallest query that answers the question.
4. If a pipeline is expensive, ask the user whether to `$limit` earlier or add indexes before running.

## Dependencies

- Python 3.10+
- `pymongo` — not pre-installed; `uv pip install pymongo` on first use.

## Deep-dive references

Mongo isn't covered by PlanetScale's `database-skills` upstream. When you need authoritative reference, go to the Mongo docs directly:

- [MongoDB Query Operators](https://www.mongodb.com/docs/manual/reference/operator/query/)
- [Aggregation Pipeline Stages](https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/)
- [Indexing Strategies](https://www.mongodb.com/docs/manual/applications/indexes/)
- [Explain Plan](https://www.mongodb.com/docs/manual/reference/method/cursor.explain/)

Attribution

evolution-foundationevolution-foundation
View sourceSee grades on GitHubMore from evolution-foundation →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →