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

OptionDefaultWhat it does
mcpOptions.readOnlytrueOnly the tools that read are listed.
mcpOptions.allowDestructivefalseWithout it, the tools that drop or change are not listed.
mcpOptions.maxDocuments100Maximum documents in each result.
mcpOptions.maxBytes1 MiBMaximum 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.

See also