Read-Only Mode
- reference
Control write access to your Couchbase 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 database. 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
The following tools are disabled when CB_MCP_READ_ONLY_MODE is true (the default):
| Tool | Description | |
|---|---|---|
|
Insert or update a document by ID |
|
|
Insert a new document by ID |
|
|
Replace an existing document by ID |
|
|
Delete a document by ID |
|
|
Mutate one or more paths in a document |
|
|
Run SQL++ queries that modify data |
|
|
Create a non-vector GSI index |
|
|
Build a deferred index |
|
|
Drop an existing index |
|
|
Create a new scope |
|
|
Create a new collection |
|
|
Delete an existing scope |
|
|
Delete an existing collection |
Read-Only Mode (Recommended)
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): All write operations are disabled. SQL++ queries that modify data are also blocked. -
When
false: All tools are loaded and available. SQL++ write queries are allowed.
Mode Behavior
READ_ONLY_MODE |
Result | |
|---|---|---|
|
Read-only KV and Query operations. All writes disabled. |
|
|
All KV and Query 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": {
"command": "uvx",
"args": ["couchbase-mcp-server"],
"env": {
"CB_CONNECTION_STRING": "couchbases://your-connection-string",
"CB_USERNAME": "username",
"CB_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 or RBAC for Capella.