{"id":46126149,"url":"https://github.com/bluwork/mongo-scout-mcp","last_synced_at":"2026-03-02T02:16:28.767Z","repository":{"id":323060003,"uuid":"1066298153","full_name":"bluwork/mongo-scout-mcp","owner":"bluwork","description":"Scout your MongoDB databases with AI - A production-ready MCP server with safety features, live monitoring, and data quality tools","archived":false,"fork":false,"pushed_at":"2026-02-27T23:17:55.000Z","size":156,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T02:26:28.344Z","etag":null,"topics":["ai-assistant","claude","database","mcp","model-context-protocol","mongodb"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T09:48:54.000Z","updated_at":"2026-02-27T23:17:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bluwork/mongo-scout-mcp","commit_stats":null,"previous_names":["bluwork/mcp-mongo-server","bluwork/mongo-scout-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bluwork/mongo-scout-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwork%2Fmongo-scout-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwork%2Fmongo-scout-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwork%2Fmongo-scout-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwork%2Fmongo-scout-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluwork","download_url":"https://codeload.github.com/bluwork/mongo-scout-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwork%2Fmongo-scout-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-assistant","claude","database","mcp","model-context-protocol","mongodb"],"created_at":"2026-03-02T02:16:28.087Z","updated_at":"2026-03-02T02:16:28.760Z","avatar_url":"https://github.com/bluwork.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongo Scout MCP\n\nScout your MongoDB databases with AI - A production-ready Model Context Protocol server with built-in safety features, live monitoring, and data quality tools.\n\n## Setup\n\n### Claude Desktop / Claude Code\n\nAdd to your MCP config (`~/.config/claude-desktop/config.json` or `~/.claude.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"mongo-scout\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"mongo-scout-mcp\",\n        \"mongodb://localhost:27017\",\n        \"mydb\"\n      ],\n      \"type\": \"stdio\"\n    }\n  }\n}\n```\n\n### Recommended: Separate Read-Only and Read-Write Instances\n\nThe server runs in **read-only mode by default** for safety. For write operations, use a separate instance:\n\n```json\n{\n  \"mcpServers\": {\n    \"mongo-scout-readonly\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mongo-scout-mcp\", \"--read-only\", \"mongodb://localhost:27017\", \"mydb\"],\n      \"type\": \"stdio\"\n    },\n    \"mongo-scout-readwrite\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mongo-scout-mcp\", \"--read-write\", \"mongodb://localhost:27017\", \"mydb_dev\"],\n      \"type\": \"stdio\"\n    }\n  }\n}\n```\n\nThis gives you:\n- **mongo-scout-readonly**: Safe exploration without risk of data modification\n- **mongo-scout-readwrite**: Write operations available when explicitly needed\n- Clear separation of capabilities\n- Option to point read-write to a development database for extra safety\n\n### Global Install\n\n```bash\nnpm install -g mongo-scout-mcp\nmongo-scout-mcp mongodb://localhost:27017 mydb\n```\n\n### Standalone Usage\n\n```bash\n# Default read-only mode (safest)\nmongo-scout-mcp\n\n# Explicitly enable read-write mode (use with caution)\nmongo-scout-mcp --read-write\n\n# With custom URI and database in read-only mode\nmongo-scout-mcp mongodb://localhost:27017 mydb\n\n# Read-write mode with custom connection\nmongo-scout-mcp --read-write mongodb://localhost:27017 mydb\n```\n\n### Command Line Options\n\n```\n--read-only          Run server in read-only mode (default)\n--read-write         Run server in read-write mode (enables all write operations)\n--mode \u003cmode\u003e        Set mode: 'read-only' or 'read-write'\n```\n\n## Security\n\n- **Read-only by default** — write operations must be explicitly enabled\n- All queries are validated and sanitized\n- MongoDB operator injection protection\n- Connection string credential redaction in logs\n- Rate limiting on all operations\n- Response size limits to prevent memory exhaustion\n\n## Available Tools\n\n### Read Operations (both modes)\n- **Database**: `listDatabases`, `getDatabaseStats`\n- **Collections**: `listCollections`, `getCollectionStats`\n- **Documents**: `find`, `aggregate`, `count`, `distinct`\n- **Schema**: `inferSchema`\n\n### Write Operations (read-write mode only)\n- **Collections**: `createCollection`, `dropCollection`\n- **Documents**: `insertOne`, `insertMany`, `updateOne`, `updateMany`, `replaceOne`, `findOneAndUpdate`, `deleteOne`, `deleteMany`\n- **Bulk**: `bulkWrite`, `previewBulkWrite`\n- **Preview**: `previewUpdate`, `previewDelete`\n\n### Index Management\n- `listIndexes`, `createIndex`, `dropIndex`\n\n### Search \u0026 Explain\n- `textSearch` — full-text search across collections\n- `explainQuery` — query execution plan analysis\n\n### Data Quality \u0026 Export\n- `findDuplicates` — find duplicate documents based on field combinations\n- `cloneCollection` — clone collections with filtering and index copying\n- `exportCollection` — export to JSON, JSONL, or CSV\n- `findMissingFields` — check for missing required fields\n- `findInconsistentTypes` — detect type inconsistencies across documents\n- `renameField` — rename fields with dry-run and index migration\n- `analyzeQueryPerformance` — query optimization using explain plans\n- `findOrphans` — find orphaned references\n\n### Relationship \u0026 Validation\n- `exploreRelationships` — follow multi-hop relationships and discover dependencies\n- `validateDocuments` — run custom validation using MongoDB `$expr` conditions\n\n### Temporal Queries\n- `findRecent` — find documents within a time window\n- `findInTimeRange` — query between dates with optional grouping\n- `detectVolumeAnomalies` — detect unusual activity patterns\n\n### Monitoring\n- `getServerStatus`, `runAdminCommand`\n- `getConnectionPoolStats`, `getCurrentOperations`\n- `getProfilerStats`\n\n### Live Monitoring\n- `getLiveMetrics` — real-time performance metrics\n- `getHottestCollections` — identify most active collections\n- `getCollectionMetrics` — detailed metrics per collection\n- `getSlowestOperations` — slow query tracking\n\n## Logging\n\nFile logging is **disabled by default**. Enable it with the `ENABLE_LOGGING=true` environment variable:\n\n```json\n{\n  \"mcpServers\": {\n    \"mongo-scout\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mongo-scout-mcp\", \"mongodb://localhost:27017\", \"mydb\"],\n      \"env\": { \"ENABLE_LOGGING\": \"true\", \"LOG_DIR\": \"./logs\" },\n      \"type\": \"stdio\"\n    }\n  }\n}\n```\n\nWhen enabled, two log files are created in `LOG_DIR` (defaults to `./logs`):\n\n- **tool-usage.log**: Every tool call with timestamp, tool name, and arguments\n- **error.log**: Errors with stack traces and the arguments that caused them\n\nConnection strings and sensitive fields are automatically redacted in all log output.\n\n## ObjectId Format\n\nBoth formats accepted for queries:\n\n```json\n{ \"_id\": { \"$oid\": \"507f1f77bcf86cd799439011\" } }\n{ \"_id\": \"507f1f77bcf86cd799439011\" }\n```\n\nResponses use Extended JSON format to preserve type information.\n\n## Examples\n\n### Basic Operations\n```\nfind({ collection: \"users\", query: { age: { $gt: 18 } }, limit: 5, sort: { name: 1 } })\ninsertOne({ collection: \"products\", document: { name: \"Widget\", price: 9.99 } })\ninferSchema({ collection: \"customers\", sampleSize: 50 })\n```\n\n### Data Quality\n```\nfindDuplicates({ collection: \"users\", fields: [\"email\"], options: { limit: 100 } })\nexportCollection({ collection: \"products\", options: { format: \"csv\", flatten: true } })\nfindOrphans({ collection: \"orders\", localField: \"userId\", foreignCollection: \"users\", foreignField: \"_id\" })\n```\n\n### Temporal Queries\n```\nfindRecent({ collection: \"logs\", timestampField: \"createdAt\", timeWindow: { value: 24, unit: \"hours\" } })\ndetectVolumeAnomalies({ collection: \"orders\", timestampField: \"createdAt\", options: { groupBy: \"day\", lookbackPeriods: 30 } })\n```\n\n### Live Monitoring\n```\ngetLiveMetrics({ duration: 30000, interval: 1000 })\ngetHottestCollections({ limit: 5, sampleDuration: 5000 })\ngetSlowestOperations({ minDuration: 100, limit: 10 })\n```\n\n## Development\n\n```bash\ngit clone https://github.com/bluwork/mongo-scout-mcp.git\ncd mongo-scout-mcp\npnpm install\npnpm build\npnpm test\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluwork%2Fmongo-scout-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluwork%2Fmongo-scout-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluwork%2Fmongo-scout-mcp/lists"}