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
feat(elicitation): add user consent configuration through elicitation MCP-185
Adds an option to require confirmation for certain tools using the new elicitation API. This is not supported by most client yet, only notably VSCode.
Clients which support it will see a confirmation option with a summary before the action is run. If the client doesn't support elicitation, the action will simply be auto-approved.
This option can be confirmed with `confirmationRequiredTools` and has a default set of `drop-database`, `drop-collection`, `delete-many`, `atlas-create-db-user`, `atlas-create-access-list` enabled.
In VSCode one must first click "Respond" (which sets action to "accepted") and then choose a value. I decided to let there be an explcit choice of Yes / No in JSON schema instead of opting to just rely on "Respond" as it is not immediately clear that `Respond = Yes` and I imagine this vagueness in the API spec will lead to confusion across clients so it's best to have an explicit JSON schema value for confirmation.
I also went with enum string Yes / No and not boolean since the displayed value for this is more user friendly.
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,6 +331,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
331
331
|`loggers`|`MDB_MCP_LOGGERS`| disk,mcp | Comma separated values, possible values are `mcp`, `disk` and `stderr`. See [Logger Options](#logger-options) for details. |
332
332
|`logPath`|`MDB_MCP_LOG_PATH`| see note\*| Folder to store logs. |
333
333
|`disabledTools`|`MDB_MCP_DISABLED_TOOLS`| <notset> | An array of tool names, operation types, and/or categories of tools that will be disabled. |
334
+
|`confirmationRequiredTools`|`MDB_MCP_CONFIRMATION_REQUIRED_TOOLS`| create-access-list,create-db-user,drop-database,drop-collection,delete-many | An array of tool names that require user confirmation before execution. **Requires the client to support [elicitation](https://modelcontextprotocol.io/specification/draft/client/elicitation)**. |
334
335
|`readOnly`|`MDB_MCP_READ_ONLY`| false | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. |
335
336
|`indexCheck`|`MDB_MCP_INDEX_CHECK`| false | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. |
336
337
|`telemetry`|`MDB_MCP_TELEMETRY`| enabled | When set to disabled, disables telemetry collection. |
@@ -400,6 +401,14 @@ Operation types:
400
401
-`metadata` - Tools that read metadata, such as list databases, list collections, collection schema, etc.
401
402
-`connect` - Tools that allow you to connect or switch the connection to a MongoDB instance. If this is disabled, you will need to provide a connection string through the config when starting the server.
402
403
404
+
#### Require Confirmation
405
+
406
+
If your client supports [elicitation](https://modelcontextprotocol.io/specification/draft/client/elicitation), you can set the MongoDB MCP server to request user confirmation before executing certain tools.
407
+
408
+
When a tool is marked as requiring confirmation, the server will send an elicitation request to the client. The client with elicitation support will then prompt the user for confirmation and send the response back to the server. If the client does not support elicitation, the tool will execute without confirmation.
409
+
410
+
You can set the `confirmationRequiredTools` configuration option to specify the names of tools which require confirmation. By default, the following tools have this setting enabled: `drop-database`, `drop-collection`, `delete-many`, `atlas-create-db-user`, `atlas-create-access-list`.
411
+
403
412
#### Read-Only Mode
404
413
405
414
The `readOnly` configuration option allows you to restrict the MCP server to only use tools with "read", "connect", and "metadata" operation types. When enabled, all tools that have "create", "update" or "delete" operation types will not be registered with the server.
0 commit comments