Choose the MCP tools
Decide which MCP tools your agents can use and with which limits.
Decide which tools of the MCP server your agents can use. By default the server starts read-only and limits each result.
Requirements
- A user that can run
setClusterParameter.
The options
| Option | Default | What it does |
|---|---|---|
mcpOptions.readOnly | true | Only the tools that read are listed. |
mcpOptions.allowDestructive | false | Without it, the tools that drop or change are not listed. |
mcpOptions.maxDocuments | 100 | Maximum documents in each result. |
mcpOptions.maxBytes | 1 MiB | Maximum bytes in each result. |
Allow writing
db.adminCommand({ setClusterParameter: { mcpOptions: { readOnly: false } } });The roles of the API key always apply, also once writing is on, so the key still needs a role that allows each write.
Check
The MCP client lists insert-many and the other tools that write after the change.
Common problems
- A tool that writes fails with
Unauthorized(13) because the key's roles do not allow it.