npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

compass-web

v0.4.2

Published

MongoDB Compass that runs on a browser

Readme

MongoDB Compass Web

npm

A port of the MongoDB Compass to Web. The frontend is rebuilt and re-packaged from the original @mongodb-js/compass-web v1.46.2. It provides an easy way deploy a MongoDB GUI and access it on a browser, while keeping most of the MongoDB Compass features.

Supported Cloud Providers

  • MongoDB Atlas
  • Amazon DocumentDB
  • Azure Cosmos DB

screenshot

screenshot

Supported Features

The following features from Compass Desktop have been ported to Compass Web.

  • Export query results to JSON/CSV (since 0.2.2)
  • Import data from JSON/CSV (since 0.2.3)
  • Gen AI (since 0.3.0)
  • MongoDB connections edit (since 0.4.0)
  • Mongo shell (since 0.5.0)

📦 Installation

  • npm

Install compass-web npm package. Make sure node-gyp works in your environment.

npm install compass-web -g

compass-web --mongo-uri="mongodb://localhost:27017"
  • Docker

Use Docker image haohanyang/compass-web

docker pull haohanyang/compass-web

docker run -it --name compass-web -e CW_MONGO_URI="mongodb://localhost:27017" haohanyang/compass-web
  • Docker Compose
services:
  compass:
    image: haohanyang/compass-web
    container_name: compass-web
    environment:
      - CW_MONGO_URI=mongodb://mongo:27017
    depends_on:
      - mongo
    ports:
      - 8080:8080
    links:
      - mongo

  mongo:
    image: mongo
    container_name: compass-web-dev-mongo
    ports:
      - 27017:27017

Access Compass Web on http://localhost:8080

Connection Strings

Pass one or more MongoDB connection strings, separated by spaces, via --mongo-uri. Those connections are fixed and can't change.

compass-web --mongo-uri="mongodb://db1:27017 mongodb+srv://cluster0.example.mongodb.net"

You can add and edit extra connections in the app by adding --enable-edit-connections. If --master-password is specified, the connections are encrypted and saved as connections-<hash>.json. Otherwise, connections are saved in memory, which will be discarded when server restarts.

Command Line Options

All options can be set via CLI flags or environment variables prefixed with CW_ (e.g. --portCW_PORT).

| Flag | Env Var | Type | Default | Description | | ---------------------------------- | ----------------------------------- | ------- | ------------- | --------------------------------------------------------------- | | --mongo-uri | CW_MONGO_URI | string | — | MongoDB connection string(s), space-separated for multiple | | --port | CW_PORT | number | 8080 | Port to run the server on | | --host | CW_HOST | string | localhost | Host to run the server on | | --base-route | CW_BASE_ROUTE | string | — | Base route prefix for all routes, e.g. /app | | --app-name | CW_APP_NAME | string | Compass Web | Application name | | --basic-auth-username | CW_BASIC_AUTH_USERNAME | string | — | Username for Basic HTTP authentication | | --basic-auth-password | CW_BASIC_AUTH_PASSWORD | string | — | Password for Basic HTTP authentication | | --enable-edit-connections | CW_ENABLE_EDIT_CONNECTIONS | boolean | false | Allow users to add/edit connections in the UI | | --master-password | CW_MASTER_PASSWORD | string | — | Master password to encrypt/decrypt saved connection credentials | | --enable-shell | CW_ENABLE_SHELL | boolean | false | Enable the Mongo Shell | | --enable-gen-ai | CW_ENABLE_GEN_AI | boolean | false | Enable GenAI query/aggregation features | | --enable-gen-ai-sample-documents | CW_ENABLE_GEN_AI_SAMPLE_DOCUMENTS | boolean | false | Upload sample documents to the GenAI service | | --openai-api-key | CW_OPENAI_API_KEY | string | — | OpenAI API key for GenAI services | | --openai-model | CW_OPENAI_MODEL | string | gpt-5-mini | OpenAI model used for GenAI | | --query-system-prompt | CW_QUERY_SYSTEM_PROMPT | string | (built-in) | System prompt for query generation | | --aggregation-system-prompt | CW_AGGREGATION_SYSTEM_PROMPT | string | (built-in) | System prompt for aggregation generation |

Example — multiple connections with Basic Auth:

compass-web \
  --mongo-uri="mongodb://db1:27017 mongodb://db2:27017" \
  --port=3000 \
  --basic-auth-username=admin \
  --basic-auth-password=secret

Example — enable shell and connection editing via environment variables:

CW_MONGO_URI="mongodb://localhost:27017" \
CW_ENABLE_SHELL=true \
CW_ENABLE_EDIT_CONNECTIONS=true \
compass-web

Build

Clone the repo and fetch the upstream dependency compass. node-gyp is needed to build the project.

git clone https://github.com/haohanyang/compass-web.git
cd compass-web && git submodule update --init --recursive --single-branch --depth 1

Build the dependencies

bash bootstrap.sh
pnpm i --frozen-lockfile

Build client and server.

pnpm run build-client
pnpm run build-server

Start the app

node dist/server.js --mongo-uri "mongodb://localhost:27017"

Credits

MongoDB Compass

License

Server Side Public License