Mongo Scout Mcp

io.github.bluwork由 GitHub 帳號 bluwork 發布v1.0.3更新於 Oct 24, 2026

Scout your MongoDB databases with AI - safety features, live monitoring, and data quality

概覽

AI 產生的概覽

讓助理探索、查詢、監控與診斷 MongoDB 資料庫,並提供資料品質檢查與可選的受控寫入。

可以做什麼
Mongo Scout MCP 將助理連接到 MongoDB 執行個體,提供約 50 個工具,涵蓋探索、查詢、診斷、監控、資料品質、關聯、時間序列、索引、匯出、預覽與寫入。常見工具包括 listCollections、inferSchema、find、aggregate、detectVolumeAnomalies、findDuplicates、findOrphans、getServerStatus、getLiveMetrics、exportCollection,以及 previewUpdate 和 previewDelete。預設以唯讀模式執行,insertOne、updateMany、deleteMany、bulkWrite、dropCollection 等寫入工具僅在啟動讀寫執行個體時可用。
適用情境
當助理需要直接檢查或分析 MongoDB 資料庫時值得加入:了解集合與結構描述、執行查詢與聚合、檢查資料品質(例如重複文件、孤兒參照、缺少欄位、型別不一致)、觀察伺服器與查詢效能,或匯出集合。也適合在真正修改前預覽變更。
執行需求
需要本機 Node.js 執行環境,因為它以 npm 套件 mongo-scout-mcp 發佈並透過 stdio 啟動。MongoDB 連線字串與目標資料庫名稱以命令參數傳入。選用環境變數 ENABLE_LOGGING 與 LOG_DIR 控制檔案記錄。寫入需要以讀寫旗標啟動另一個執行個體。
安裝前請注意
讀寫模式會啟用插入、更新、取代、刪除、重新命名欄位、建立或刪除索引與集合、批次寫入等工具,以及 runAdminCommand;這些操作可能修改或破壞資料,應指向開發資料庫,並先使用預覽與 dry-run 工具。MongoDB 連線字串以命令參數傳入,可能包含憑證。檔案記錄預設關閉;啟用後會把帶參數的工具呼叫寫入 tool-usage.log,把錯誤寫入 error.log,但連線字串會被遮蔽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mongo Scout Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Mongo Scout MCP

Scout your MongoDB databases with AI - A production-ready Model Context Protocol server with built-in safety features, live monitoring, and data quality tools.

[npm] [License]

What You Get

You ask:

"Anything unusual happening with order volume this month?"

Mongo Scout returns:


Volume Analysis: orders

Statistics (last 30 days)

MetricValue
Daily Average2,847 documents
Standard Deviation412
Min / Max1,923 / 3,601

Anomalies Detected

  • Feb 14 — 5,892 documents (+7.4σ) — Valentine's Day spike
  • Feb 22 — 847 documents (-4.9σ) — Payment gateway outage window
  • Mar 1 — 4,201 documents (+3.3σ) — Month-start subscription renewals

Recommendations

  • Feb 22 drop warrants investigation — possible data loss during outage
  • Consider auto-scaling rules for predictable spikes (month boundaries, holidays)
  • Set up alerts for volumes exceeding ±3σ from rolling average

That's detectVolumeAnomalies — one of 50 tools covering exploration, querying, diagnostics, monitoring, data quality, and safe writes.

Quick Start

Claude Code

bash
claude mcp add mongo-scout -- npx -y mongo-scout-mcp mongodb://localhost:27017 mydb

Then ask: "What collections do I have and what do their schemas look like?"

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{  "mcpServers": {    "mongo-scout": {      "command": "npx",      "args": ["-y", "mongo-scout-mcp", "mongodb://localhost:27017", "mydb"],      "type": "stdio"    }  }}
Cursor / VS Code

Add to your MCP settings:

json
{  "mongo-scout": {    "command": "npx",    "args": ["-y", "mongo-scout-mcp", "mongodb://localhost:27017", "mydb"]  }}
Read-Only vs Read-Write

The server runs in read-only mode by default. For write operations, run a separate instance:

json
{  "mcpServers": {    "mongo-scout-readonly": {      "command": "npx",      "args": ["-y", "mongo-scout-mcp", "--read-only", "mongodb://localhost:27017", "mydb"],      "type": "stdio"    },    "mongo-scout-readwrite": {      "command": "npx",      "args": ["-y", "mongo-scout-mcp", "--read-write", "mongodb://localhost:27017", "mydb_dev"],      "type": "stdio"    }  }}
  • mongo-scout-readonly: Safe exploration, no risk of data modification
  • mongo-scout-readwrite: Write operations when explicitly needed

Tools

Explore — understand your database

  • listDatabases — all databases in the instance
  • getDatabaseStats — storage and performance statistics
  • listCollections — collections in the current database
  • getCollectionStats — size, document count, index details
  • inferSchema — schema inference from sampled documents

Query — find and analyze documents

  • find — query documents with filtering, sorting, projection
  • aggregate — run aggregation pipelines
  • count — count documents matching a query
  • distinct — unique values for a field
  • textSearch — full-text search across indexed fields
  • explainQuery — query execution plan analysis

Diagnose — spot problems early

  • detectVolumeAnomalies — unusual patterns in document volume
  • analyzeQueryPerformance — query optimization using explain plans

Monitor — watch it live

  • getServerStatus — server performance metrics
  • getCurrentOperations — currently running operations
  • getConnectionPoolStats — connection pool health
  • getProfilerStats — profiler data and slow operations
  • getLiveMetrics — real-time metrics with continuous updates
  • getHottestCollections — collections with highest activity
  • getCollectionMetrics — detailed per-collection metrics
  • getSlowestOperations — slow query tracking
  • runAdminCommand — execute admin commands

Data Quality — trust your data

  • findDuplicates — duplicate documents by field combination
  • findOrphans — orphaned references across collections
  • findMissingFields — documents missing required fields
  • findInconsistentTypes — type inconsistencies across documents
  • validateDocuments — custom validation with MongoDB $expr

Relationships — follow the references

  • exploreRelationships — multi-hop relationship traversal

Time Series — temporal analysis

  • findRecent — documents within a time window
  • findInTimeRange — date range queries with optional grouping

Indexes — manage your indexes

  • listIndexes — all indexes for a collection
  • createIndex — create new indexes
  • dropIndex — remove indexes

Export — get data out

  • exportCollection — JSON, JSONL, or CSV
  • cloneCollection — clone with filtering and index copying

Preview — dry-run before changing anything

  • previewUpdate / previewDelete — see what would change before committing
  • previewBulkWrite — preview bulk operations

Write (read-write only) — safe modifications

  • insertOne / insertMany — insert documents
  • updateOne / updateMany — update with dryRun and maxDocuments limits
  • replaceOne — replace a single document
  • findOneAndUpdate — find and update atomically
  • deleteOne / deleteMany — delete with dryRun and maxDocuments limits
  • bulkWrite — multiple write operations in one call
  • renameField — rename fields with dry-run and index migration
  • createCollection / dropCollection — collection management

Security

  • Read-only by default — write operations must be explicitly enabled
  • All queries are validated and sanitized
  • MongoDB operator injection protection
  • Connection string credential redaction in logs
  • Rate limiting on all operations
  • Response size limits to prevent memory exhaustion

Examples

"What collections do I have and what's the schema of users?"

listCollections()inferSchema({ collection: "users", sampleSize: 50 })

"Find duplicate emails in the users collection."

findDuplicates({ collection: "users", fields: ["email"], options: { limit: 100 } })

"Show me order volume anomalies over the last month."

detectVolumeAnomalies({ collection: "orders", timestampField: "createdAt", options: { groupBy: "day", lookbackPeriods: 30 } })

"What's happening on the server right now?"

getServerStatus()getCurrentOperations()getHottestCollections({ limit: 5, sampleDuration: 5000 })

"Find orders that reference deleted users."

findOrphans({ collection: "orders", localField: "userId", foreignCollection: "users", foreignField: "_id" })

"Export the products collection as CSV."

exportCollection({ collection: "products", options: { format: "csv", flatten: true } })

Configuration

VariableDefaultDescription
ENABLE_LOGGINGfalseEnable file logging
LOG_DIR./logsLog file directory

CLI flags: --read-only (default), --read-write, --mode <mode>

Logging

File logging is disabled by default. Set ENABLE_LOGGING=true to enable. Two log files are created in LOG_DIR:

  • tool-usage.log — every tool call with timestamp, name, and arguments
  • error.log — errors with stack traces

Connection strings are automatically redacted in all output.

ObjectId Format

Both formats accepted:

json
{ "_id": { "$oid": "507f1f77bcf86cd799439011" } }{ "_id": "507f1f77bcf86cd799439011" }

Development

bash
git clone https://github.com/bluwork/mongo-scout-mcp.gitcd mongo-scout-mcppnpm installpnpm buildpnpm test

License

Apache-2.0

來源:README.md,提交 09e3774

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分