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 分