New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

compass-web

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compass-web

MongoDB Compass that runs on a browser

latest
Source
npmnpm
Version
0.3.1
Version published
Maintainers
1
Created
Source

MongoDB Compass Web

npm downloads

A port of the MongoDB Compass to Web. The frontend is rebuilt and re-packaged from the original @mongodb-js/compass-web. It provides an easy way to view and interact with your databases from a browser, while keeping most of the MongoDB Compass features.

Supported Cloud Providers

  • MongoDB Atlas
  • Amazon DocumentDB
  • Azure Cosmos DB

screenshot light theme

screenshot dark theme

screenshot gen ai

Unsupported Features

Not all Compass Desktop features are available on Compass Web. Here is non-exhaustive list unsupported features.

  • Export to JSON/CSV (Supported since 0.2.2)
  • Import from JSON/CSV (Supported since 0.2.3)
  • Gen AI (Supported since 0.3.0)
  • Mongo Shell
  • Proxy

📦 Installation

Install compass-web npm package or pull Docker image haohanyang/compass-web

npm install compass-web -g
docker pull haohanyang/compass-web

🧭 Usage

Start the server with MongoDB connection string(s). The parameters are configured via program arguments or environment variables.

compass-web --mongo-uri "mongodb://localhost:27017"

# or configure via CW_MONGO_URI environment variable
CW_MONGO_URI="mongodb://localhost:27017" compass-web

# or use npx
npx compass-web --mongo-uri "mongodb://localhost:27017"

# multiple connection strings
compass-web --mongo-uri "mongodb://localhost:27017 mongodb+srv://myusername:secrets@default-cluster.mongodb.net/?retryWrites=true&w=majority&appName=default-cluster"

[!NOTE] You may need to add tls=true to your connection string if using Mongo SRV scheme.

Use Docker:

docker run -it -p 8080:8080 -e CW_MONGO_URI="mongodb://localhost:27017" haohanyang/compass-web

Check an example docker-compose.yaml file if you want to use Docker Compose.

⚙️ CLI Parameters

You can configure compass-web using command-line arguments or environment variables (prefixed with CW_).

ParameterTypeEnv VariableDescriptionDefault
--mongo-uristringCW_MONGO_URIRequired. MongoDB connection string(s). Separate multiple URIs with whitespace.Required
--portnumberCW_PORTPort to run the server on.8080
--hoststringCW_HOSTHost to run the server on.localhost
--app-namestringCW_APP_NAMEName of the application on.Compass Web
--org-idstringCW_ORG_IDOrganization ID associated with the connection.default-org-id
--project-idstringCW_PROJECT_IDProject ID associated with the connection.default-project-id
--cluster-idstringCW_CLUSTER_IDCluster ID associated with the connection.default-cluster-id
--basic-auth-usernamestringCW_BASIC_AUTH_USERNAMEUsername for Basic HTTP authentication scheme.null
--basic-auth-passwordstringCW_BASIC_AUTH_PASSWORDPassword for Basic HTTP authentication scheme.null
--openai-api-keystringCW_OPENAI_API_KEYOpenAI API key for GenAI servicesnull
--query-system-promptstringCW_QUERY_SYSTEM_PROMPTSystem prompt for query generationDefined in gen-ai.js
--aggregation-system-promptstringCW_AGGREGATION_SYSTEM_PROMPTSystem prompt for aggregation generationDefined in gen-ai.js
--openai-modelstringCW_OPENAI_MODELOpenAI model used in GenAI servicegpt-5-mini
--enable-gen-ai-featuresboolCW_ENABLE_GEN_AI_FEATURESEnable GenAI featuresfalse
--enable-gen-ai-sample-documentsboolCW_ENABLE_GEN_AI_SAMPLE_DOCUMENTSEnable upload sample documents to GenAI Servicefalse

Settings

Here are editable user preferences you can configure on Settings in the UI:

  • Theme(dark/light)
  • Default Sort for Query Bar

Build

Clone the repo and fetch the upstream dependency compass

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

Keywords

mongodb

FAQs

Package last updated on 05 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts