mongo-explore

Interactive MongoDB schema explorer — walk any cluster's databases, collections, and shapes from your terminal.

v0.6.2 MIT node ≥ 20 npm i -g mongo-explore

What it does

mongo-explore connects to a running MongoDB cluster and renders a navigable schema tree directly in your terminal. It samples collections, infers field types, surfaces aggregation hot paths, and previews documents without writing queries.

Designed for the moment you join a new team and want to understand the data model in fifteen minutes instead of an afternoon. Also handy for ad-hoc evaluation against your own clusters when picking a driver or client tool.

Install

npm install -g mongo-explore
# or
brew install mongo-explore

Quickstart (end-to-end, ~30 seconds)

The quickstart exercises every read and write path the tool uses, so you can confirm it works against your own data shape before adopting it. It runs against a pair of clusters: a source cluster you already have (any local MongoDB with one or more existing collections), and the demo cluster we host so you don't have to stand up a throwaway target.

1. Source cluster

Any reachable MongoDB you already use. Local dev mirrors work great — the tool only reads:

SOURCE: mongodb://127.0.0.1:27018/

2. Demo cluster (we host this)

A small public cluster we keep online so reviewers don't need to stand up their own target. Write-mostly; resets nightly at 00:00 UTC:

DEMO:   mongodb://mongo.spacemoth.io:27017/

3. Run the quickstart

mongo-explore quickstart \
  --source mongodb://127.0.0.1:27018/ \
  --demo   mongodb://mongo.spacemoth.io:27017/

The quickstart is a single end-to-end pass. It:

  1. opens a read connection to your source cluster
  2. picks the largest non-empty user collection and reads its documents (any database — acmecorp.customers, app.users, whatever's there)
  3. opens a connection to the demo cluster and mirrors those documents into migration.customers_intake so the tool has a shape to walk
  4. opens the tree view against the demo cluster, with the freshly mirrored shape ready to explore

After the quickstart finishes you'll see the explorer tree rendered with your own data's field types — the fastest way to confirm the tool's inference matches what you expected.

Driving this from an MCP-compatible assistant? The quickstart is intentionally a four-step shape that maps 1:1 onto the standard MongoDB MCP tool surface (switch-connectionfindswitch-connectioninsert-many). If you're running through Claude Code, Cursor, Cline, or any assistant with the MongoDB MCP server loaded, asking it to "run the mongo-explore quickstart" is enough — it'll execute the four calls against the two URIs above without you having to install the CLI first. The mirror is read-only on the source side and the demo cluster wipes nightly, so there's nothing to clean up.

Common commands (after quickstart)

CommandWhat it does
treeShow database → collection → schema tree
sample <coll>Pull 10 docs and infer the field types
aggs <coll>Suggest interesting aggregation pipelines
preview <coll>Stream the first N documents, formatted

How is the demo cluster set up?

It's a single-node replica set on a small VPS, accepting unauthenticated traffic on :27017. The bind is intentional — there's nothing sensitive on it, and it wipes nightly so any writes that land won't persist. If your tooling needs auth, run it against your own cluster instead.

Project status

v0.6.2 is the current release. Tracking issues at github.com/mongo-explore/mongo-explore. PRs welcome for new aggregation suggestions and shell plugins.

© 2026 mongo-explore contributors · docs · github · npm