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

@quocthai0404/mongo-mcp

v1.0.0

Published

MongoDB MCP Server for AI coding assistants - provides database schema, field types, sample data, and query validation

Readme

mongo-mcp

English | Tiếng Việt

MCP Server hoàn chỉnh cho phép AI coding assistants (GitHub Copilot, Claude, Gemini) truy cập và thao tác MongoDB database.

✨ Tính năng nổi bật

  • 27 công cụ - Đầy đủ CRUD, aggregation, index management
  • PII Masking - Tự động ẩn dữ liệu nhạy cảm
  • Dynamic Database Selection - Chọn database sau khi connect
  • Security Config - Read-only mode và disabled tools

📦 Cài đặt

NPM (Khuyên dùng)

npx mongo-mcp

Từ source

git clone https://github.com/quocthai0404/mongo-mcp.git
cd mongo-mcp
npm install && npm run build

Docker

docker run -e MONGODB_URI="your-uri" ghcr.io/quocthai0404/mongo-mcp

⚙️ Cấu hình VS Code

"mcp": {
  "inputs": [
    {
      "type": "promptString",
      "id": "mongodb-uri",
      "description": "MongoDB URI",
      "password": true
    }
  ],
  "servers": {
    "mongo-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["mongo-mcp"],
      "env": {
        "MONGODB_URI": "${input:mongodb-uri}"
      }
    }
  }
}

🛠️ Các công cụ (27 tools)

Core Database Operations

| Công cụ | Mô tả | | ------------------ | -------------------------------------------- | | list_databases | Liệt kê tất cả databases trong cluster | | use_database | Chọn database để làm việc | | current_database | Xem database hiện tại | | list_collections | Liệt kê collections | | find | Query documents với filter, projection, sort | | count | Đếm documents | | distinct | Lấy giá trị unique của field |

Aggregation & Analysis

| Công cụ | Mô tả | | ---------------- | ------------------------------- | | aggregate | Chạy aggregation pipeline | | explain | Phân tích query execution plan | | db_stats | Thống kê database | | infer_schema | Phân tích schema của collection | | sample_data | Lấy dữ liệu mẫu với PII masking | | validate_query | Validate MongoDB query |

Write Operations

| Công cụ | Mô tả | Safety | | ------------- | ---------------------- | ---------- | | insert_one | Insert 1 document | ✅ | | insert_many | Insert nhiều documents | ✅ | | update_one | Update 1 document | ✅ | | update_many | Update nhiều documents | ✅ | | delete_one | Xóa 1 document | 🔒 confirm | | delete_many | Xóa nhiều documents | 🔒 confirm |

Index Management

| Công cụ | Mô tả | Safety | | -------------- | --------------- | ---------- | | list_indexes | Liệt kê indexes | ✅ | | create_index | Tạo index | ✅ | | drop_index | Xóa index | 🔒 confirm |

Collection/Database Management

| Công cụ | Mô tả | Safety | | ------------------------- | ------------------ | ---------- | | create_collection | Tạo collection | ✅ | | rename_collection | Đổi tên collection | ✅ | | collection_storage_size | Xem storage stats | ✅ | | drop_collection | Xóa collection | 🔒 confirm | | drop_database | Xóa database | 🔒 confirm |

🔒 confirm: Tools yêu cầu confirm: true để thực thi

🔐 Bảo mật

Read-Only Mode

MONGODB_READONLY=true  # Block tất cả write operations

Disabled Tools

MONGODB_DISABLED_TOOLS=drop_database,drop_collection

PII Masking

| Loại | Patterns | Mask | | ----------- | ----------------------- | ----------------- | | Credentials | password, secret, token | [MASKED_SECRET] | | Email | email | [MASKED_EMAIL] | | Phone | phone, mobile | [MASKED_PHONE] | | Financial | credit_card, cvv | [MASKED_CARD] |

📝 Variables

| Variable | Default | Description | | ------------------------ | ---------- | -------------------------------- | | MONGODB_URI | required | Connection string | | MONGODB_TIMEOUT | 30000 | Connection timeout (ms) | | SCHEMA_SAMPLE_SIZE | 1000 | Documents to sample | | MONGODB_READONLY | false | Read-only mode | | MONGODB_DISABLED_TOOLS | "" | Comma-separated tools to disable |

📄 Giấy phép

MIT - Thai Phan (@quocthai0404)