You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,6 +267,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
267
267
|`logPath`| Folder to store logs. |
268
268
|`disabledTools`| An array of tool names, operation types, and/or categories of tools that will be disabled. |
269
269
|`readOnly`| When set to true, only allows read and metadata operation types, disabling create/update/delete operations. |
270
+
|`indexCheck`| When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. |
270
271
|`telemetry`| When set to disabled, disables telemetry collection. |
271
272
272
273
#### Log Path
@@ -312,6 +313,19 @@ You can enable read-only mode using:
312
313
313
314
When read-only mode is active, you'll see a message in the server logs indicating which tools were prevented from registering due to this restriction.
314
315
316
+
#### Index Check Mode
317
+
318
+
The `indexCheck` configuration option allows you to enforce that query operations must use an index. When enabled, queries that perform a collection scan will be rejected to ensure better performance.
319
+
320
+
This is useful for scenarios where you want to ensure that database queries are optimized.
When index check mode is active, you'll see an error message if a query is rejected due to not using an index.
328
+
315
329
#### Telemetry
316
330
317
331
The `telemetry` configuration option allows you to disable telemetry collection. When enabled, the MCP server will collect usage data and send it to MongoDB.
return`Index check failed: The ${operation} operation on "${database}.${collection}" performs a collection scan (COLLSCAN) instead of using an index. Consider adding an index for better performance. Use 'explain' tool for query plan analysis or 'collection-indexes' to view existing indexes. To disable this check, set MDB_MCP_INDEX_CHECK to false.`;
0 commit comments