Docs Menu
Docs Home
/ /

Enable or Disable MongoDB MCP Server Features

The MongoDB MCP Server has various options that you can enable or disable. For example: read-only mode, specific MCP tools, telemetry about system use, and database index checks.

You can limit the MCP Server to perform only read operations using read-only mode.

Default is to allow cluster write operations. Typically, always enable read-only mode.

To enable read-only mode with a command line option, use:

--readOnly

To enable read-only mode using an environment variable, set the MDB_MCP_READ_ONLY environment variable to true:

export MDB_MCP_READ_ONLY=true

When you enable read-only mode, a message is added to the MCP Server log that indicates the tools that perform write operations are prevented from running.

To restrict access to Atlas and database operations, you can disable specific MCP Server tools or categories of tools.

To disable tools, set the disabledTools MCP Server configuration option, which is an array of strings. Each string can be a tool name or tool category.

The following table shows the tool names that you can disable:

Tool Name
Description
Example Operations Disabled

create

Create resources

  • Create cluster

  • Insert document

update

Update resources

  • Update document

  • Rename collection

delete

Delete resources

  • Delete document

  • Drop collection

read

Read resources

  • Find

  • Aggregate

  • List clusters

metadata

Read metadata

  • List databases

  • List collections

  • Read collection schema

The following table shows the tool categories that you can disable:

Tool Category
Description
Example Operations Disabled

atlas

Atlas tools

  • List clusters

  • Create cluster

mongodb

Database tools

  • Find

  • Aggregate

To disable tools with the disabledTools command line option, use a space-separated list. For example:

--disabledTools create update delete atlas

To disable tools with the MDB_MCP_DISABLED_TOOLS environment variable, use a comma-separated string. For example:

export MDB_MCP_DISABLED_TOOLS="create,update,delete,atlas"

To prevent the MCP Server from collecting data about usage, you can disable telemetry.

To disable telemetry using an environment variable, set either of these:

export MDB_MCP_TELEMETRY=disabled
export DO_NOT_TRACK=1

To disable telemetry using a command line option, use:

--telemetry disabled

To ensure query operations use an index, enable the index check option. When enabled, the MCP Server rejects queries that perform a collection scan to improve performance and ensure queries are optimized.

To enable the index check with a command line option, use:

--indexCheck

To enable the index check with an environment variable, use:

export MDB_MCP_INDEX_CHECK=true

If you enable the index check, the MCP Server logs an error message if a query is rejected because it doesn't use an index.

  • MongoDB MCP Server Configuration Options

  • MongoDB MCP Server Configuration Methods

  • Start MongoDB MCP Server as a Standalone Service

  • Export Data from MongoDB MCP Server

  • Troubleshoot MongoDB MCP Server

Back

Methods

On this page