Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

MongoDB Database Tools

$ mongodump Official High Risk
MongoDB · Database & Data · Apache-2.0 · macos / linux / windows

MongoDB Database Tools bundles mongodump for binary BSON backups (--archive, --gzip), mongorestore (with --dryRun), mongoexport for JSON/CSV exports, and mongoimport. Paired with MONGODB_URI env vars or --config YAML files, it integrates cleanly into CI and agent ops.

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
brew install mongodb/brew/mongodb-database-tools
CLI vs MCP Decision CLI Only

mongodump and mongoexport stream multi-megabyte/gigabyte BSON archives and NDJSON files directly to disk; MCP is unsuitable for bulk backup/restore.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 17 / 25

Fully non-interactive Go binaries (mongodump, mongoexport JSON output, mongorestore --dryRun), though mongodump itself logs progress to stderr rather than structured JSON.

  • Non-interactive suite; mongoexport writes JSON and mongorestore supports --dryRun
Trust & Safety 20 / 25

mongorestore --dryRun and --config YAML credential files improve safety, though mongorestore --drop and mongoimport --drop delete existing collections.

  • --dryRun on mongorestore and --config file support; --drop is destructive
Setup & Portability 13 / 15

Official Go binaries via Homebrew (mongodb/brew/mongodb-database-tools) and installers across macOS, Linux, and Windows.

  • Cross-platform official Go binaries
Utility & Efficiency 13 / 15

Standardizes binary BSON backup/restore and JSON/CSV collection transfer across self-hosted MongoDB and Atlas.

  • Complete toolkit covering BSON archives and JSON/CSV export/import
Maintenance & Lineage 8 / 10

First-party MongoDB suite (mongodb/mongo-database-tools) under Apache-2.0.

  • Official MongoDB repository under Apache-2.0
Docs & Verifiability 7 / 10

Detailed per-tool reference pages at mongodb.com/docs/database-tools/.

  • Official docs at mongodb.com

Security, Auth & Guardrails

Auth Modes
Config File Env API Key No Auth
Credential Storage

Supports --config=<yaml> files for URIs/passwords so credentials are omitted from process listings; commonly wrapped with $MONGODB_URI in scripts.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

Apache-2.0 open-source CLI suite; MongoDB Atlas cluster usage/egress incurs vendor charges.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# MongoDB Database Tools Agent Rules
- Pass connection URIs via `"$MONGODB_URI"` or `--config`, never literal passwords in logged args.
- Run `mongorestore --dryRun` before restoring archives.
- NEVER pass `--drop` to `mongorestore` or `mongoimport` without explicit user approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

Export a collection query to JSON via mongoexport
mongoexport --uri="$MONGODB_URI" --collection=events --limit=50 --out=events.json

Exports up to 50 documents from events as newline-delimited JSON.

Test a BSON archive restore with --dryRun
mongorestore --uri="$MONGODB_URI" --archive=backup.archive.gz --gzip --dryRun

Simulates restoring a compressed BSON archive without writing any documents.

Controlled Writes & Previews

Create a compressed BSON archive backup
mongodump --uri="$MONGODB_URI" --archive=backup.archive.gz --gzip

Streams a consistent compressed BSON archive backup to backup.archive.gz.

Strengths for Agents

  • + mongorestore --dryRun verifies archive integrity and restore plans before mutating data.
  • + --archive + --gzip enables clean single-file or piped BSON backups.

Caveats & Pitfalls

  • ! mongodump status/progress output is plain text rather than JSON.
  • ! Uses a multi-binary suite (mongodump, mongorestore, mongoexport, mongoimport) rather than one unified subcommand binary.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI