About furey/mongodb-lens
furey/mongodb-lens is an MCP server published by furey in the Data category: 🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases. Conduid read 42 tools from its source: add-connection-alias, aggregate-data, analyze-query-patterns, analyze-schema, bulk-operations, clear-cache and 36 more. It is published to npm as mongodb-lens and starts with npx.
The repository has 207 stars and 31 forks, is licensed MIT, and its last commit was on 21 Nov 2026. The latest release is 9.1.4 (23 Apr 2025). It follows 9.1.3 (14 Apr 2025), and the 5 most recent releases go back to 9.0.0 (3 Apr 2025). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include data, database and mongodb.
Install
claude mcp add mongodb-lens -- npx -y mongodb-lensnpx -y mongodb-lensgit clone https://github.com/furey/mongodb-lensTools (42)
add-connection-aliasAdd a new MongoDB connection alias| Parameter | Type | Description |
|---|---|---|
| alias * | string | Alias name for the connection |
| uri * | string | MongoDB connection URI |
aggregate-dataA `$out` or `$merge` stage writes to a collection, and `$out` replaces an existing collection| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| limit | number | Maximum number of results to return |
| pipeline * | string | Aggregation pipeline as JSON string array |
analyze-query-patternsAnalyze query patterns and suggest optimizations| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name to analyze |
| duration | number | Duration to analyze in seconds |
analyze-schemaAutomatically infer schema from collection| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| sampleSize | number | Number of documents to sample |
bulk-operationsCan perform batch deletions when configured to do so| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| operations * | string | Array of operations as JSON string |
| token | string | Confirmation token from previous request |
clear-cacheClear memory caches to ensure fresh data| Parameter | Type | Description |
|---|---|---|
| target | string | Cache type to clear (default: all) |
collation-queryFind documents with language-specific collation rules| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter | string | Query filter as JSON string |
| locale * | string | Locale code (e.g., "en", "fr", "de") |
| sort | string | Sort specification as JSON string |
| strength | number | Collation strength (1-5) |
compare-schemasCompare schemas between two collections| Parameter | Type | Description |
|---|---|---|
| sampleSize | number | Number of documents to sample |
| sourceCollection * | string | Source collection name |
| targetCollection * | string | Target collection name |
connect-mongodbConnect to a different MongoDB URI or alias| Parameter | Type | Description |
|---|---|---|
| uri * | string | MongoDB connection URI or alias to connect to |
connect-originalConnect back to the original MongoDB URI used at startupcount-documentsCount documents with optional filter| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter | string | MongoDB query filter (JSON string) |
create-collectionCreate a new collection with options| Parameter | Type | Description |
|---|---|---|
| name * | string | Collection name |
| options | string | Collection options as JSON string (capped, size, etc.) |
create-databaseCreate a new MongoDB database with option to switch| Parameter | Type | Description |
|---|---|---|
| name * | string | Database name to create |
create-indexCreate new index on collection| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| keys * | string | Index keys as JSON object |
| options | string | Index options as JSON object |
create-timeseriesCreate a time series collection for temporal data| Parameter | Type | Description |
|---|---|---|
| expireAfterSeconds | number | Optional TTL in seconds |
| granularity | string | Time series granularity |
| metaField | string | Field that contains metadata for grouping |
| name * | string | Collection name |
| timeField * | string | Field that contains the time value |
create-userCreates users with permissions that could enable further changes| Parameter | Type | Description |
|---|---|---|
| password * | string | Password |
| roles * | string | Roles as JSON array, e.g. [{"role": "readWrite", "db": "mydb"}] |
| username * | string | Username |
current-databaseGet the name of the current databasedelete-documentRemoves documents matching specified criteria| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter * | string | Filter as JSON string |
| token | string | Confirmation token from previous request |
distinct-valuesGet unique values for a field| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| field * | string | Field name to get distinct values for |
| filter | string | Optional filter as JSON string |
drop-collectionPermanently deletes collections and all their documents| Parameter | Type | Description |
|---|---|---|
| name * | string | Collection name to drop |
| token | string | Confirmation token from previous request |
drop-databasePermanently deletes entire databases| Parameter | Type | Description |
|---|---|---|
| name * | string | Database name to drop |
| token | string | Confirmation token from previous request |
drop-indexRemoves indexes (can impact query performance)| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| indexName * | string | Name of the index to drop |
| token | string | Confirmation token from previous request |
drop-userRemoves database users and their access permissions| Parameter | Type | Description |
|---|---|---|
| token | string | Confirmation token from previous request |
| username * | string | Username to drop |
explain-queryAnalyze query performance| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter * | string | MongoDB query filter (JSON string) |
| verbosity | string | Explain verbosity level |
export-dataExport query results to formatted JSON or CSV| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| fields | string | Comma-separated list of fields to include (for CSV) |
| filter | string | Filter as JSON string |
| format | string | Export format |
| limit | number | Maximum documents to export |
| sort | string | Sort specification as JSON string (e.g. {"date": -1} for descending) |
find-documentsRun queries with filters and projections| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter | string | MongoDB query filter (JSON string) |
| limit | number | Maximum number of documents to return |
| projection | string | Fields to include/exclude (JSON string) |
| skip | number | Number of documents to skip |
| sort | string | Sort specification (JSON string) |
generate-schema-validatorGenerate a JSON Schema validator for a collection| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| strictness | string | Validation strictness level |
geo-queryRun geospatial queries with various operators| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| field * | string | Geospatial field name |
| geometry * | string | GeoJSON geometry as JSON string |
| limit | number | Maximum number of documents to return |
| maxDistance | number | Maximum distance in meters (for near queries) |
| operator * | string | Geospatial operator type |
get-statsGet database or collection statistics| Parameter | Type | Description |
|---|---|---|
| name | string | Collection name (for collection stats) |
| target * | string | Target type |
gridfs-operationManage large files with GridFS| Parameter | Type | Description |
|---|---|---|
| bucket | string | GridFS bucket name |
| filename | string | Filename for info/delete operations |
| limit | number | Maximum files to list |
| operation * | string | GridFS operation type |
insert-documentInsert one or multiple documents into a collection| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| document * | string | Document as JSON string or array of documents |
| options | string | Options as JSON string (including "ordered" for multiple documents) |
list-collectionsList collections in the current databaselist-connectionsList all configured MongoDB connection aliaseslist-databasesList all accessible MongoDB databasesrename-collectionCan overwrite existing collections when using the drop target option| Parameter | Type | Description |
|---|---|---|
| newName * | string | New collection name |
| oldName * | string | Current collection name |
| token | string | Confirmation token from previous request |
shard-statusGet sharding status for database or collections| Parameter | Type | Description |
|---|---|---|
| collection | string | Collection name (if target is collection) |
| target | string | Target type |
text-searchPerform full-text search across text-indexed fields| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| language | string | Optional language for text search |
| limit | number | Maximum results to return |
| searchText * | string | Text to search for |
transactionExecutes multiple operations in a transaction (potential for complex changes)| Parameter | Type | Description |
|---|---|---|
| operations * | string | JSON array of operations with collection, operation type, and parameters |
update-documentUpdates documents which could overwrite existing data| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| filter * | string | Filter as JSON string |
| options | string | Options as JSON string |
| update * | string | Update operations as JSON string |
use-databaseSwitch to a specific database| Parameter | Type | Description |
|---|---|---|
| database * | string | Database name to use |
validate-collectionRun validation on a collection to check for inconsistencies| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
watch-changesWatch for changes in a collection using change streams| Parameter | Type | Description |
|---|---|---|
| collection * | string | Collection name |
| duration | number | Duration to watch in seconds |
| operations | array | Operations to watch |
Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 6.6K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by package-lock.json.
- ✓No dynamic code executionScanned 2 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdiomongodb-lens.js:4
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- No file writes or deletes
- Lockfile
- package-lock.json
Pattern matches on the source text of 2 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 6.6K words, fetched a month ago. The original in the repository is authoritative.
Read full README