New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@mcpolyglot/connector-mongo

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcpolyglot/connector-mongo

MongoDB connector for mcpolyglot. Sample-based schema inference, read-only find / aggregate primitives, prompt-injection-safe results.

latest
Source
npmnpm
Version
0.2.3
Version published
Maintainers
1
Created
Source

@mcpolyglot/connector-mongo

MongoDB connector for mcpolyglot. Sample-based schema inference, read-only find / aggregate primitives, prompt-injection-safe results.

Tools exposed

For every Mongo source mcpolyglot generates:

  • <id>.list_collections — all collections with a sampled-field schema for each.
  • <id>.describe_collection — one collection's sampled-field schema (paths, types, nullability).
  • <id>.find — read-only find with filter, projection, sort, and a bounded limit.
  • <id>.aggregate — read-only aggregation pipeline; mutating stages are rejected.

How read-only is enforced

Mongo doesn't have a one-shot "read-only transaction" knob, so mcpolyglot enforces it at the API surface:

  • Only find and aggregate are exposed — no update, insert, delete, or drop primitives.
  • Aggregation pipelines are walked before they reach the driver. Any stage with $out or $merge (the two stages that write back) is rejected with forbidden.read_only.
  • Every operation is bounded by maxTimeMS so a runaway aggregation can't pin the cluster.
  • Schema is inferred from a 25-doc $sample per collection — no full-collection scans on list_collections.

Driver is an optional dep

mongodb is declared as an optional dep. Install it once with your project and you're set.

Docs

MIT licensed.

FAQs

Package last updated on 04 Oct 2026

Related posts