Environment Variables & Command Line Arguments
- reference
Reference for all environment variables and CLI arguments used to configure the Couchbase MCP Server, including authentication examples.
You can configure the MCP server using environment variables or command line arguments. If you specify both, command line arguments take priority over environment variables.
Configuration Reference
| Environment Variable | CLI Argument | Description | Default | |
|---|---|---|---|---|
|
|
HTTP(S) URL of the Operational Insights cluster, for example |
Required |
|
|
|
Username for basic authentication. See Configuring Authentication. |
Required (or mTLS) |
|
|
|
Password for basic authentication. See Configuring Authentication. |
Required (or mTLS) |
|
|
|
Path to the client certificate for mTLS. Use either a PEM certificate (paired with the client key path) or a PKCS#12 bundle ( |
Required if using mTLS |
|
|
|
Path to the client certificate’s private key file (PEM). Leave unset when the client certificate path is a PKCS#12 bundle that already contains the key. See Configuring Authentication. |
Required for a PEM client certificate |
|
|
|
Decryption password for the client key or PKCS#12 bundle, if it’s encrypted. Omit if the file is unencrypted. |
None |
|
|
|
Path to the server trust store (CA certificate) file. The server uses it to verify the server certificate during authentication, for example with self-signed or untrusted certificates. |
||
|
|
Prevent all data modifications. See Read-Only Mode for details. |
|
|
|
|
Transport mode selection: |
|
|
|
|
Host for HTTP transport mode |
|
|
|
|
Port for HTTP transport mode. Overrides the server default of |
None |
|
|
|
Number of worker processes. The Operational Insights server supports only |
|
|
|
|
Run HTTP transport mode without session state, for replicas behind a load balancer without sticky sessions. See Stateless Mode and Workers. |
|
|
|
|
Maximum size, in bytes, of a query tool result. Unset means no limit, and the full result comes back. When set, reading stops once the limit is reached, and the response reports |
Unset |
|
|
|
Timeout, in seconds, for the requests that the async query tools make to the cluster. It must be a positive integer, and the maximum is |
|
|
|
|
Tools to disable. See Disabling Tools |
None |
|
|
|
Tools requiring user confirmation before execution. See Elicitation/Confirmation for Tool Calls |
None |
|
|
|
JWKS endpoint for verifying JWT signatures (Streamable HTTP only). See OAuth. |
None |
|
|
|
Expected JWT |
None |
|
|
|
Expected JWT |
None |
|
|
|
JWT signing algorithm. See OAuth. |
|
|
|
|
Public base URL of this server. Enables Protected Resource Metadata / DCR discovery. See OAuth. |
None |
|
|
|
Custom label for the read scope, for IdPs using a different naming convention. See OAuth. |
|
|
|
|
Custom label for the write scope, for IdPs using a different naming convention. See OAuth. |
|
|
|
|
Minimum log level: |
|
|
|
|
Log output sinks: |
|
|
|
|
Base path for the per-level log files. Used when the |
|
|
|
|
Deprecated — use |
|
|
|
|
Maximum size (MB) per log file before rotation, for all levels unless overridden per level. See Logging. |
|
|
|
|
Number of rotated backup files kept per level, in addition to the live file, for all levels unless overridden per level. See Logging. |
|
|
|
|
Rotation size in MB for the |
Inherits |
|
|
|
Rotation size in MB for the |
Inherits |
|
|
|
Rotation size in MB for the |
Inherits |
|
|
|
Rotation size in MB for the |
Inherits |
|
|
|
Rotated backups kept for the |
Inherits |
|
|
|
Rotated backups kept for the |
Inherits |
|
|
|
Rotated backups kept for the |
Inherits |
|
|
|
Rotated backups kept for the |
Inherits |
|
|
|
Turns audit logging on. See Audit Logging. |
|
|
|
|
Comma-separated list of audit sinks. Allowed values are |
|
|
|
|
Path of the audit log file. Needed when |
None |
|
|
|
Size (MB) that the live audit file can reach before rotation. |
|
|
|
|
Age that the live audit file can reach before rotation, as |
|
|
|
|
Number of rotated backups kept for each audit file, not counting the live file. |
|
|
|
|
Includes tool arguments in audit records, verbatim and without redaction. |
|
|
|
|
Numeric event IDs to turn off, as a comma-separated list or a path to a file. The server refuses to turn off write or security events. |
None |
You can also set both the rotation size and backup count per log level (error, warning, info, debug) — see Per-Level Overrides.
|
Configuring Authentication
For authentication, you need either:
-
Username and Password (basic authentication)
or
-
Client Certificate and Key paths (mTLS authentication)
If you specify both, mTLS takes priority.
Optionally, you can specify a CA root certificate path to validate server certificates (useful for self-signed certificates).
Example Configurations
The following examples use uvx to run the server.
You can replace these with the corresponding docker run commands - see Streamable HTTP for the Docker HTTP configuration.
|
How to: Basic Auth
Provide an Operational Insights username and password. For Basic Authentication setup, see Manage Users and Roles (self-managed).
{
"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"
}
}
}
}
How to: Connect with Certificates
-
Connection string: Use
http://for unencrypted connections orhttps://for TLS. -
TLS certificates: If using TLS with self-signed or untrusted certificates, set
CB_OPERATIONAL_INSIGHTS_CA_CERT_PATHto your CA root certificate. -
mTLS: For certificate-based authentication, use
CB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PATHandCB_OPERATIONAL_INSIGHTS_CLIENT_KEY_PATHinstead of username/password. For a PKCS#12 bundle (.p12or.pfx), set onlyCB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PATH. If the client key or bundle is encrypted, also setCB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PASSWORD. mTLS requires anhttps://connection string.
Basic auth with custom CA:
{
"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_OPERATIONAL_INSIGHTS_CA_CERT_PATH": "/path/to/ca-certificate.pem"
}
}
}
}
mTLS (no username/password):
{
"mcpServers": {
"couchbase-oi": {
"command": "uvx",
"args": ["couchbase-mcp-server", "operational-insights"],
"env": {
"CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING": "https://your-oi-endpoint",
"CB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PATH": "/path/to/client-certificate.pem",
"CB_OPERATIONAL_INSIGHTS_CLIENT_KEY_PATH": "/path/to/client.key",
"CB_OPERATIONAL_INSIGHTS_CA_CERT_PATH": "/path/to/ca-certificate.pem"
}
}
}
}
How to: mTLS Based Auth
For environments requiring certificate-based authentication. For mTLS setup, see Configure Client Certificate Authentication.
{
"mcpServers": {
"couchbase-oi": {
"command": "uvx",
"args": ["couchbase-mcp-server", "operational-insights"],
"env": {
"CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING": "https://your-oi-endpoint",
"CB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PATH": "/path/to/client-certificate.pem",
"CB_OPERATIONAL_INSIGHTS_CLIENT_KEY_PATH": "/path/to/client.key"
}
}
}
}