Read-Only Mode

  • reference
Control write access to your Operational Insights cluster from the MCP server. Enabled by default for safety.

The MCP server provides configuration options for controlling write operations, ensuring safe interaction between LLMs and your data. Use this mode to start in a safe default that prevents data mutations by not loading write-capable tools. See the Security page for best practices. This mode is enabled by default.

Tools Affected by Read-Only Mode

Read-only mode turns off the following tool when CB_MCP_READ_ONLY_MODE is true (the default):

Tool Description

operational_insights_create_index

Create a secondary index on a collection

operational_insights_cancel_async_query stays available in read-only mode. It stops a query that you started, and it does not change any data.

This is the primary server-side safety switch (CB_MCP_READ_ONLY_MODE) — defense-in-depth on top of database RBAC, which remains the authoritative boundary:

  • When true (default): operational_insights_create_index is not loaded. All the other tools stay available, including operational_insights_cancel_async_query. SQL++ queries run with the server-side readonly option, so the Operational Insights cluster itself rejects data and structure modifications. COPY …​ TO (export) statements are also blocked client-side, including an export that you request with the copy_to_* arguments.

  • When false: All tools are loaded and available, and SQL++ queries run without the readonly option.

Mode Behavior

READ_ONLY_MODE Result

true (default)

Read-only query and index operations. Index creation is turned off, and async query cancellation stays available.

false

All query and index operations allowed.

CB_MCP_READ_ONLY_MODE=true is the recommended safe default to prevent inadvertent data modifications by LLMs.

Configuration Example

To enable write operations:

{
  "mcpServers": {
    "couchbase-oi": {
      "command": "uvx",
      "args": ["couchbase-mcp-server", "operational-insights"],
      "env": {
        "CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING": "https://your-oi-endpoint",
        "CB_OPERATIONAL_INSIGHTS_USERNAME": "username",
        "CB_OPERATIONAL_INSIGHTS_PASSWORD": "password",
        "CB_MCP_READ_ONLY_MODE": "false"
      }
    }
  }
}

Security Guidelines

  • Read-only mode is a defense-in-depth feature, not the primary security boundary.

  • The authoritative control is Couchbase RBAC: You should configure database user permissions so that the credentials used by the MCP server do not have data modification privileges if you want strong guarantees. See RBAC for Couchbase Server.