mcpField
C
Couchbase MCP Server

Couchbase MCP Server

Local
mcp-server.couchbase.comDatabases34Updated today

About Couchbase MCP Server

Couchbase MCP Server is a self-hosted MCP server connecting Couchbase and Operational Insights clusters to MCP clients. It supports schema exploration, queries, document operations, and performance diagnosis, with read-only behavior by default and STDIO or Streamable HTTP transports.

Key features

  1. 01Connect Couchbase and Operational Insights clusters
  2. 02Explore clusters, collections, and schemas
  3. 03Run SQL++, full-text, and vector queries
  4. 04Read and write documents; writes are disabled by default
  5. 05Diagnose query and cluster performance
  6. 06Use STDIO or Streamable HTTP transport

Use cases

  1. 01Check cluster health and running services
  2. 02Inspect schemas and find collection documents
  3. 03Run SQL++, full-text, or vector searches
  4. 04Identify slow queries and index recommendations

MCP support

The MCP server exposes tools for cluster inspection, schema discovery, data queries, and document operations. It supports STDIO and Streamable HTTP with optional OAuth 2.1; it is read-only by default, with writes enabled through configuration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"couchbase": {
"command": "uvx",
"args": [
"couchbase-mcp-server"
],
"env": {
"CB_CONNECTION_STRING": "<CB_CONNECTION_STRING>",
"CB_USERNAME": "<CB_USERNAME>",
"CB_PASSWORD": "<CB_PASSWORD>",
"CB_CA_CERT_PATH": "<CB_CA_CERT_PATH>",
"CB_CLIENT_CERT_PATH": "<CB_CLIENT_CERT_PATH>",
"CB_CLIENT_KEY_PATH": "<CB_CLIENT_KEY_PATH>",
"CB_MCP_READ_ONLY_MODE": "<CB_MCP_READ_ONLY_MODE>",
"CB_MCP_READ_ONLY_QUERY_MODE": "<CB_MCP_READ_ONLY_QUERY_MODE>",
"CB_MCP_TRANSPORT": "<CB_MCP_TRANSPORT>",
"CB_MCP_HOST": "<CB_MCP_HOST>",
"CB_MCP_PORT": "<CB_MCP_PORT>",
"CB_MCP_DISABLED_TOOLS": "<CB_MCP_DISABLED_TOOLS>",
"CB_MCP_CONFIRMATION_REQUIRED_TOOLS": "<CB_MCP_CONFIRMATION_REQUIRED_TOOLS>"
}
}
}
}
Run commanduvx couchbase-mcp-server
Environment variables to set
CB_CONNECTION_STRINGCouchbase connection string. Required for connecting to the cluster.
CB_USERNAMECouchbase database username. Required for basic authentication.
CB_PASSWORDSecretCouchbase database password. Required for basic authentication.
CB_CA_CERT_PATHCouchbase CA certificate path. Required for TLS authentication in non Capella clusters.
CB_CLIENT_CERT_PATHCouchbase client certificate path. Required for mTLS authentication.
CB_CLIENT_KEY_PATHSecretCouchbase client key path. Required for mTLS authentication.
CB_MCP_READ_ONLY_MODECouchbase read only mode. Set to true to allow disable write operations across both KV and query. KV write tools are not loaded and SQL++ queries that modify data are blocked. Set to false to allow data modification queries and tools.
CB_MCP_READ_ONLY_QUERY_MODE[Deprecated] Couchbase read only query mode. Set to true to allow only read-only queries. Set to false to allow data modification queries. Use CB_MCP_READ_ONLY_MODE instead.
CB_MCP_TRANSPORTTransport mode for the server (stdio, http or sse). Default is stdio
CB_MCP_HOSTHost to run the MCP server on (default: 127.0.0.1). Used only for HTTP and SSE transport modes.
CB_MCP_PORTPort to run the MCP server on (default: 8000). Used only for HTTP and SSE transport modes.
CB_MCP_DISABLED_TOOLSTools to disable. Accepts comma-separated tool names (e.g., 'tool_1,tool_2') or a file path containing one tool name per line.
CB_MCP_CONFIRMATION_REQUIRED_TOOLSComma-separated tool names that require user confirmation before execution. Also accepts a file path containing one tool name per line. Requires the MCP client to support elicitation.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypicouchbase-mcp-server0.8.0
ocidocker.io/couchbaseecosystem/mcp-server-couchbase:0.8.0

Tools

20

Saved tool list · updated 3w ago

This tool takes no parameters.

Details

From the project README

Couchbase MCP Server

Couchbase MCP Server is a self-hosted Model Context Protocol (MCP) server that connects AI agents and assistants — Claude, Cursor, Windsurf, VS Code Copilot, JetBrains AI Assistant and any other MCP client — to data in Couchbase Server clusters, on Capella or self-managed, and in self-managed Operational Insights clusters. An agent can inspect your cluster, explore schemas, run SQL++, full-text and vector queries, read and write documents, and diagnose query and cluster performance in natural language.

It is read-only by default, supports STDIO and Streamable HTTP (with OAuth 2.1), and is distributed on PyPI and Docker Hub. Enterprise support is available by licensing Couchbase AI Data Plane, which also entitles use and enterprise support of Couchbase Agent Memory and Couchbase Agent Catalog.

Docs License Python 3.11+ PyPI version Install in Cursor Verified on MseeP Trust Score

Full documentation: docs.couchbase.com/mcp-server

Couchbase Server MCP server

Table of Contents

Why Couchbase MCP Server

  • Safe by default — write tools are not loaded and data-modifying queries are blocked unless you set CB_MCP_READ_ONLY_MODE=false; individual tools can also be disabled or gated behind user confirmation.
  • Couchbase Server and Operational Insights — the operational server connects to Couchbase Capella or a self-managed Couchbase Server cluster with the same configuration; the Operational Insights server connects to self-managed Operational Insights clusters.
  • RBAC-aware — tool controls guide the LLM; the Couchbase user's role-based access control remains the authoritative security boundary.
  • Production transports — STDIO for local desktop clients, or Streamable HTTP with optional OAuth 2.1 (any JWKS-publishing IdP: Auth0, Okta, Keycloak, Entra, Cognito, …), health checks and audit logging for shared deployments. The operational server can also run multiple workers to use more CPU cores.
  • Any MCP client — tested with Claude Desktop, Cursor, Windsurf, VS Code and JetBrains AI Assistant/Junie.

Once connected, you can ask things like:

  • "What buckets, scopes and collections do I have, and what's the schema of the orders collection?"
  • "Find the 10 most recent documents in users where status = 'active'."
  • "What are the 5 slowest queries in the last hour, and are any of them missing a covering index?"
  • "Is this cluster healthy, and which services are running?"
  • "Insert a new document into products with these fields: …" (requires CB_MCP_READ_ONLY_MODE=false)

Choosing a Server

This package ships two MCP servers. Each one is started by its own subcommand, connects to a different kind of cluster, and has its own tools. Pick the one that matches your cluster, follow its section for setup and tools, then use Common Configuration for the settings both share. To use both, register each as a separate server in your MCP client.

Operational serverOperational Insights server
Use it withA Couchbase cluster (Capella or self-managed)A self-managed Operational Insights cluster (not available on Capella)
Subcommandoperational (the default)operational-insights
Connection stringcouchbase:// / couchbases://HTTP(S) URL, e.g. http://localhost:8095
Credential variablesCB_CONNECTION_STRING, CB_USERNAME, …CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING, CB_OPERATIONAL_INSIGHTS_USERNAME, …
Tools52 — cluster health, schema, KV, SQL++, indexes, full-text and vector search, query performance13 — schema, SQL++ (sync and async), indexes, exports
Default HTTP port80008001
Default log filemcp_server.logmcp_server_operational_insights.log

The subcommand is optional for the operational server today — a bare couchbase-mcp-server starts it — but naming it keeps your configuration unambiguous. Options go after the subcommand: couchbase-mcp-server operational --transport=http. Check the installed version with uvx couchbase-mcp-server --version.

Operational Server

The operational server connects to a Couchbase cluster on Capella or self-managed Couchbase Server, using the couchbase Python SDK.

Operational Quick Start

You need a running Couchbase cluster — the Capella free tier is the quickest way to get one (you can import a sample dataset) — and an MCP client. Add one of these configurations to your client (see Client Setup for where each client keeps it). If the client already has other servers, add couchbase to the existing mcpServers object.

From PyPI with uvx (requires uv and Python 3.11+):

{
  "mcpServers": {
    "couchbase": {
      "command": "uvx",
      "args": ["couchbase-mcp-server", "operational"],
      "env": {
        "CB_CONNECTION_STRING": "couchbases://connection-string",
        "CB_USERNAME": "username",
        "CB_PASSWORD": "password"
      }
    }
  }
}

With Docker (requires only Docker):

{
  "mcpServers": {
    "couchbase": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "CB_CONNECTION_STRING=couchbases://connection-string",
        "-e", "CB_USERNAME=username",
        "-e", "CB_PASSWORD=password",
        "couchbase/mcp-server:latest", "operational"
      ]
    }
  }
}
From source
git clone https://github.com/couchbase/mcp-server-couchbase.git
{
  "mcpServers": {
    "couchbase": {
      "command": "uv",
      "args": [
        "--directory", "path/to/cloned/repo/mcp-server-couchbase/",
        "run", "src/mcp_server.py", "operational"
      ],
      "env": {
        "CB_CONNECTION_STRING": "couchbases://connection-string",
        "CB_USERNAME": "username",
        "CB_PASSWORD": "password"
      }
    }
  }
}

path/to/cloned/repo/mcp-server-couchbase/ is the path to your clone — keep the trailing slash. After pulling updates, run uv sync to update dependencies.

Operational Connection and Authentication

Use either a username and password or a client certificate (mTLS). If both are set, the certificate is used.

Environment VariableCLI ArgumentDescription
CB_CONNECTION_STRING--connection-stringConnection string to the cluster. Required
CB_USERNAME / CB_PASSWORD--username / --passwordBasic authentication
CB_CLIENT_CERT_PATH / CB_CLIENT_KEY_PATH--client-cert-path / --client-key-pathmTLS authentication
CB_CA_CERT_PATH--ca-cert-pathRoot certificate for a self-signed/untrusted server certificate (not needed for Capella)
mTLS example
{
  "mcpServers": {
    "couchbase": {
      "command": "uvx",
      "args": ["couchbase-mcp-server", "operational"],
      "env": {
        "CB_CONNECTION_STRING": "couchbases://connection-string",
        "CB_CLIENT_CERT_PATH": "/path/to/client-certificate.pem",
        "CB_CLIENT_KEY_PATH": "/path/to/client.key"
      }
    }
  }
}
Operational Tools

Write tools (marked ✏️) are not loaded while read-only mode is on, the default. Tools marked 🖥️ use admin REST endpoints that Capella does not expose: they need self-managed Couchbase Server 7.6+ and are not registered on Capella connections.

Cluster setup and health
ToolDescription
get_server_configuration_statusServer status and configuration without connecting to the cluster: read-only mode, disabled/confirmation-required tools, OAuth, logging and audit counters
test_cluster_connectionCheck the cluster credentials by connecting to the cluster
get_cluster_health_and_servicesCluster health and running services, optionally filtered via service_types
get_client_connectivity_reportThe SDK's cached connection diagnostics, without active network probing
get_cluster_metrics 🖥️Cluster statistics over a historic time window (stats-range endpoint)
get_cluster_tasks 🖥️Tasks running right now — rebalance, compaction, XDCR, index build. Needs ro_admin
get_cluster_health_snapshot 🖥️Per-node health: service topology, membership, orchestrator and a health rollup. Needs ro_admin
get_bucket_config 🖥️A bucket's (or every bucket's) configuration and live state — quotas, eviction, replicas, durability, storage, compaction. Needs ro_admin
get_cluster_system_events 🖥️The system event log (config changes, failovers, rebalances, restarts), windowed with since_time. Needs Full Admin or Cluster Admin
discover_tool_input_valuesLook up exact input values other tools need (e.g. every metric name for get_cluster_metrics). Works offline
Data model and schema discovery
ToolDescription
get_buckets_in_clusterList all buckets in the cluster
get_scopes_in_bucketList all scopes in a bucket
get_collections_in_scopeList all collections in a scope (requires the Query service)
get_scopes_and_collections_in_bucketList all scopes and collections in a bucket
get_schema_for_collectionInfer the structure of a collection
create_scope ✏️Create a scope in a bucket (Server 7.6+ and Capella)
create_collection ✏️Create a collection in an existing scope (Server 7.6+ and Capella)
delete_scope ✏️Delete a scope and all its collections — permanent
delete_collection ✏️Delete a collection and all its documents — permanent
Document (KV) operations
ToolDescription
get_document_by_idGet a document by ID
lookup_subdocumentRead specific paths, existence checks or counts without fetching the whole document
upsert_document_by_id ✏️Upsert a document by ID
insert_document_by_id ✏️Insert a new document (fails if it exists)
replace_document_by_id ✏️Replace an existing document (fails if it doesn't exist)
delete_document_by_id ✏️Delete a document by ID
mutate_subdocument ✏️Modify paths in an existing document (upsert, insert, replace, remove, array ops, counters)
Query and indexing
ToolDescription
run_sql_plus_plus_queryRun a SQL++ query scoped to a bucket and scope — use collection names directly (SELECT * FROM users). Data-modifying statements are blocked in read-only mode
explain_sql_plus_plus_queryGenerate and evaluate an EXPLAIN plan: metadata, extracted plan and findings
get_index_advisor_recommendationsIndex Advisor recommendations for a SQL++ query
list_indexesList indexes with definitions, filterable by bucket/scope/collection/name; flags vector indexes (is_vector, vector_type)
get_index_stats 🖥️Per-index size, fragmentation, scan traffic and lag, per node — finds pressure and unused indexes
create_query_index ✏️Create a scalar, Hyperscale vector or Composite vector GSI index (index_type). Deferred by default — follow with build_index
create_index ✏️Deprecated — use create_query_index. Removed in 2.0
build_index ✏️Build all deferred indexes on a collection
drop_index ✏️Drop a GSI index (scalar or vector)
Full-text search (FTS)

Requires Couchbase Server 7.6+ and the Search service. Scope-level and cluster-level (legacy) indexes are both supported: pass bucket_name and scope_name together for scope-level, or omit both.

ToolDescription
list_search_indexesList Search indexes — cluster-level, per bucket, or per scope
get_search_index_definitionFull definition of one Search index (mappings, analyzers, plan params)
run_searchRun any non-vector FTS query from its raw JSON body; explain=true returns the execution plan
upsert_search_index ✏️Create or update a Search index, including vector field mappings. Updates trigger a full rebuild — pass the current uuid to avoid clobbering concurrent changes
drop_search_index ✏️Drop a Search index — permanent
Vector search

Both tools embed plain query text with the model configured under Embedding Providers. Available on self-managed Couchbase Server and Capella.

ToolDescription
run_vector_querySimilarity search against a GSI vector index (Server 8.0+) via APPROX_VECTOR_DISTANCE(). The index is chosen automatically; supports a SQL++ where prefilter and Hyperscale tuning (num_probes, rerank, top_n_scan). Returns full documents
run_vector_searchSearch-service vector search (Server 7.6+) against a named index. scalar_query makes it hybrid; prefilter narrows candidates first. Returns index-stored fields per hit
Query performance analysis
ToolDescription
get_longest_running_queriesLongest-running queries by average service time
get_most_frequent_queriesMost frequently executed queries
get_queries_with_largest_response_sizesQueries with the largest response sizes
get_queries_with_large_result_countQueries with the largest result counts
get_queries_using_primary_indexQueries using a primary index
get_queries_not_using_covering_indexQueries not using a covering index
get_queries_not_selectiveQueries whose scans — secondary index, primary index or sequential — return far more documents than the final result
Query service health 🖥️

These call the Query service's own admin REST API on every query node.

ToolDescription
get_cluster_query_vitalsQuery-engine health: request rate, active/queued requests, memory, GC, uptime. Needs ro_admin
get_active_queriesQueries executing right now across all query nodes. Needs ro_admin
delete_active_query ✏️Cancel an in-flight query by request ID. Needs Full Admin or Cluster Admin
Tools disabled automatically on Capella

The 🖥️ tools reach Couchbase through admin REST endpoints that Capella does not expose. When every host in CB_CONNECTION_STRING ends in .cloud.couchbase.com, the server does not register them and reports them alongside your own disabled tools in get_server_configuration_status and the startup log. SDK-based tools such as get_cluster_health_and_services and get_client_connectivity_report stay available.

ToolEndpoint it needs
get_cluster_metricsManagement REST (/pools/default/stats/range)
get_cluster_tasksManagement REST (/pools/default/tasks)
get_bucket_configManagement REST (/pools/default/buckets[/<name>])
get_cluster_health_snapshotManagement REST, plus per-node endpoints
get_cluster_system_eventsManagement REST (/events)
get_index_statsIndex Service REST (each indexer's /api/v1/stats)
get_cluster_query_vitalsQuery service REST (/admin/vitals)
get_active_queriesQuery service REST (/admin/active_requests)
delete_active_queryQuery service REST (DELETE /admin/active_requests/{id})
Embedding Providers

run_vector_query and run_vector_search embed query text with the provider set in CB_MCP_EMBEDDING_MODEL_PROVIDER. This is optional: without it the server starts normally and both tools stay registered, but calling them returns an error explaining what to set.

CB_MCP_EMBEDDING_MODEL_PROVIDERRequiredOptionalNotes
capellaCB_MCP_EMBEDDING_MODEL_API_KEY, CB_MCP_EMBEDDING_MODEL, CB_MCP_EMBEDDING_MODEL_ENDPOINT—Capella Model Service. CB_MCP_EMBEDDING_MODEL_ENDPOINT is your deployment's own URL (e.g. https://<id>.ai.couchbase.com) from Capella's AI Data Plane > Models
openaiCB_MCP_EMBEDDING_MODEL_API_KEY, CB_MCP_EMBEDDING_MODELCB_MCP_EMBEDDING_MODEL_ENDPOINTSet the endpoint to use an OpenAI-compatible local server (Ollama, vLLM, LM Studio)
cohereCB_MCP_EMBEDDING_MODEL_API_KEY, CB_MCP_EMBEDDING_MODELCB_MCP_EMBEDDING_MODEL_ENDPOINT
voyageCB_MCP_EMBEDDING_MODEL_API_KEY, CB_MCP_EMBEDDING_MODELCB_MCP_EMBEDDING_MODEL_ENDPOINT
bedrockCB_MCP_EMBEDDING_MODELCB_MCP_EMBEDDING_MODEL_AWS_ACCESS_KEY_ID, CB_MCP_EMBEDDING_MODEL_AWS_SECRET_ACCESS_KEY, CB_MCP_EMBEDDING_MODEL_AWS_REGIONAmazon Titan embedding models (e.g. amazon.titan-embed-text-v2:0) — the provider sends Titan's inputText request shape, so other Bedrock embedding models such as Cohere Embed are not supported yet. Omit credentials to use the default AWS chain. Needs the extra: pip install couchbase-mcp-server[bedrock-embeddings]
"env": {
  "CB_CONNECTION_STRING": "couchbases://connection-string",
  "CB_USERNAME": "username",
  "CB_PASSWORD": "password",
  "CB_MCP_EMBEDDING_MODEL_PROVIDER": "openai",
  "CB_MCP_EMBEDDING_MODEL": "text-embedding-3-small",
  "CB_MCP_EMBEDDING_MODEL_API_KEY": "sk-..."
}
All Options
Every environment variable and CLI flag for the operational server

The Operational Insights server accepts the same options, except that it has its own connection settings and no CB_MCP_EMBEDDING_MODEL_* options.

Environment VariableCLI ArgumentDescriptionDefault
CB_CONNECTION_STRING--connection-stringConnection string to the Couchbase clusterRequired
CB_USERNAME--usernameUsername with access to required buckets for basic authenticationRequired (or Client Certificate and Key needed for mTLS)
CB_PASSWORD--passwordPassword for basic authenticationRequired (or Client Certificate and Key needed for mTLS)
CB_CLIENT_CERT_PATH--client-cert-pathPath to the client certificate file for mTLS authenticationRequired if using mTLS (or Username and Password required)
CB_CLIENT_KEY_PATH--client-key-pathPath to the client key file for mTLS authenticationRequired if using mTLS (or Username and Password required)
CB_CA_CERT_PATH--ca-cert-pathPath to server root certificate for TLS if server is configured with a self-signed/untrusted certificate. This will not be required if you are connecting to Capella
CB_MCP_READ_ONLY_MODE--read-only-modePrevent all data modifications (KV, Query, scope/collection management, index management, and FTS index management). When enabled, write tools are not loaded.true
CB_MCP_TRANSPORT--transportTransport mode: stdio, http, ssestdio
CB_MCP_HOST--hostHost for HTTP/SSE transport modes127.0.0.1
CB_MCP_PORT--portPort for HTTP/SSE transport modes8000
CB_MCP_WORKERS--workersNumber of server worker processes for the http transport. Values above 1 run in stateless HTTP mode (see Multiple Workers)1
CB_MCP_STATELESS_HTTP--stateless-httpHandle each HTTP request without per-session state. Only honored with http; cannot be combined with confirmation-required tools (see Multiple Workers)true when workers > 1, otherwise false
CB_MCP_DISABLED_TOOLS--disabled-toolsTools to disable (see Disabling Tools)None
CB_MCP_CONFIRMATION_REQUIRED_TOOLS--confirmation-required-toolsTools that require explicit user confirmation before execution via MCP elicitation (see Requiring confirmation)None
CB_MCP_LOG_LEVEL--log-levelLogging level for the MCP server: off, debug, info, warning, error (see Logging)info
CB_MCP_LOG_SINKS--log-sinksComma-separated log destinations: stderr, file, or both (see Logging)stderr
CB_MCP_LOG_FILE--log-fileBase path for per-level log files (only used when the file sink is enabled)mcp_server.log
CB_MCP_LOG_ROTATION_MAX_SIZE_MB--log-rotation-max-size-mbGlobal maximum size in MB per log file before it rotates, inherited by every level unless overridden. 0 — or a value that cannot be used, such as a negative, nan or inf — is invalid and falls back to the default with a startup warning1 (1 MB)
CB_MCP_LOG_MAX_BYTES--log-max-bytesDeprecated — use CB_MCP_LOG_ROTATION_MAX_SIZE_MB (MB). Global rotation size in bytes, still honored for backward compatibility; ignored when CB_MCP_LOG_ROTATION_MAX_SIZE_MB is also setUnset
CB_MCP_LOG_ERROR_ROTATION_MAX_SIZE_MB--log-error-rotation-max-size-mbRotation size in MB for the ERROR log file; overrides CB_MCP_LOG_ROTATION_MAX_SIZE_MB for ERRORInherits CB_MCP_LOG_ROTATION_MAX_SIZE_MB
CB_MCP_LOG_WARNING_ROTATION_MAX_SIZE_MB--log-warning-rotation-max-size-mbRotation size in MB for the WARNING log file; overrides CB_MCP_LOG_ROTATION_MAX_SIZE_MB for WARNINGInherits CB_MCP_LOG_ROTATION_MAX_SIZE_MB
CB_MCP_LOG_INFO_ROTATION_MAX_SIZE_MB--log-info-rotation-max-size-mbRotation size in MB for the INFO log file; overrides CB_MCP_LOG_ROTATION_MAX_SIZE_MB for INFOInherits CB_MCP_LOG_ROTATION_MAX_SIZE_MB
CB_MCP_LOG_DEBUG_ROTATION_MAX_SIZE_MB--log-debug-rotation-max-size-mbRotation size in MB for the DEBUG log file; overrides CB_MCP_LOG_ROTATION_MAX_SIZE_MB for DEBUGInherits CB_MCP_LOG_ROTATION_MAX_SIZE_MB
CB_MCP_LOG_RETENTION_BACKUP_COUNT--log-retention-backup-countRotated backup files kept per-level log file (excluding the live file), applied to every level unless overridden. 0 keeps only the live file (see Logging)1
CB_MCP_LOG_ERROR_RETENTION_BACKUP_COUNT--log-error-retention-backup-countRotated backups kept for the ERROR log file; overrides the global count for ERRORInherits CB_MCP_LOG_RETENTION_BACKUP_COUNT
CB_MCP_LOG_WARNING_RETENTION_BACKUP_COUNT--log-warning-retention-backup-countRotated backups kept for the WARNING log file; overrides the global count for WARNINGInherits CB_MCP_LOG_RETENTION_BACKUP_COUNT
CB_MCP_LOG_INFO_RETENTION_BACKUP_COUNT--log-info-retention-backup-countRotated backups kept for the INFO log file; overrides the global count for INFOInherits CB_MCP_LOG_RETENTION_BACKUP_COUNT
CB_MCP_LOG_DEBUG_RETENTION_BACKUP_COUNT--log-debug-retention-backup-countRotated backups kept for the DEBUG log file; overrides the global count for DEBUGInherits CB_MCP_LOG_RETENTION_BACKUP_COUNT
CB_MCP_OAUTH_JWT_JWKS_URI--oauth-jwks-uriJWKS endpoint of the identity provider used to verify bearer JWTs. Enables OAuth when set with the issuer and audience (see OAuth 2.1 Authorization)None
CB_MCP_OAUTH_JWT_ISSUER--oauth-issuerExpected JWT iss claim. Required to enable OAuthNone
CB_MCP_OAUTH_JWT_AUDIENCE--oauth-audienceExpected JWT aud claim. Required to enable OAuthNone
CB_MCP_OAUTH_JWT_ALGORITHM--oauth-algorithmJWT signing algorithm: one of RS256/384/512, ES256/384/512, PS256/384/512RS256
CB_MCP_OAUTH_MCP_BASE_URL--oauth-mcp-base-urlPublic base URL of this server. When set, publishes RFC 9728 Protected Resource Metadata so PRM-aware clients can discover the IdPNone
CB_MCP_OAUTH_SCOPE_READ_LABEL--oauth-scope-read-labelOverride the OAuth scope label treated as 'read' access (advertised in PRM and matched against the token's scope/scp claim). Use when your IdP can't emit the canonical formcouchbase-mcp:read
CB_MCP_OAUTH_SCOPE_WRITE_LABEL--oauth-scope-write-labelOverride the OAuth scope label treated as 'write' access; same semantics as the read labelcouchbase-mcp:write
CB_MCP_AUDIT_LOG_ENABLED--audit-log-enabledEnable audit logging — a separate sink from the CB_MCP_LOG_* operational logs, with a stable schema and its own retention (see Auditing)false
CB_MCP_AUDIT_LOG_SINKS--audit-log-sinksComma-separated audit destinations: console, file, or both. console writes to stderr — never stdout, which carries the JSON-RPC protocol on stdioconsole
CB_MCP_AUDIT_LOG_FILE_PATH--audit-log-file-pathPath to the audit log file. Required when file is in the sinks; the hostname and process id are inserted before the extension (audit.log → audit.<host>.<pid>.log)None
CB_MCP_AUDIT_LOG_ROTATION_MAX_SIZE_MB--audit-log-rotation-max-size-mbMaximum size in MB the live audit file may reach before it rotates. 0 turns size-based rotation off10 (10 MB)
CB_MCP_AUDIT_LOG_ROTATION_INTERVAL--audit-log-rotation-intervalAge the live audit file may reach before it rotates, as <value><unit> where the unit is d (24 hours) or w (7 days) — e.g. 1d, 30d, 8w. 0 turns interval-based rotation off1d
CB_MCP_AUDIT_LOG_RETENTION_MAX_BACKUPS--audit-log-retention-max-backupsRotated backups retained per audit file, excluding the live file. Backups are gzipped. 0 keeps none. This bounds one file, not the directory — see Auditing10
CB_MCP_AUDIT_LOG_TOOL_ARGS--audit-log-tool-argsRecord tool argument values in the audit log. Off by default — there is no redaction in this release, so enabling it writes arguments verbatim, including full document bodiesfalse
CB_MCP_AUDIT_LOG_DISABLED_EVENTS--audit-log-disabled-eventsAudit events to suppress: comma-separated numeric event ids (e.g. 61490,61491), or a file with one id per line. Only filterable events can be suppressedNone
CB_MCP_EMBEDDING_MODEL_PROVIDER--embedding-model-providerEmbedding provider for run_vector_query / run_vector_search: one of capella, openai, cohere, voyage, bedrock. Unset disables both tools' embedding step until configured — see Embedding Provider ConfigurationNone
CB_MCP_EMBEDDING_MODEL--embedding-modelModel name/ID for the configured embedding providerNone
CB_MCP_EMBEDDING_MODEL_API_KEY--embedding-model-api-keyAPI key for the configured provider. Not used by bedrock (uses the AWS credential chain / CB_MCP_EMBEDDING_MODEL_AWS_* instead)None
CB_MCP_EMBEDDING_MODEL_ENDPOINT--embedding-model-endpointBase URL override (an OpenAI-compatible local server, or a Capella Model Service deployment's own URL — required when CB_MCP_EMBEDDING_MODEL_PROVIDER=capella)None
CB_MCP_EMBEDDING_MODEL_AWS_ACCESS_KEY_ID--embedding-model-aws-access-key-idAWS access key ID, bedrock provider only. Omit to use the default AWS credential chainNone
CB_MCP_EMBEDDING_MODEL_AWS_SECRET_ACCESS_KEY--embedding-model-aws-secret-access-keyAWS secret access key, bedrock provider onlyNone
CB_MCP_EMBEDDING_MODEL_AWS_REGION--embedding-model-aws-regionAWS region, bedrock provider only. Falls back to the AWS SDK's own region resolution if unsetNone

Operational Insights Server

The operational-insights server connects to self-managed Operational Insights clusters. Operational Insights is a real-time analytical database (RT-OLAP) for real-time apps and operational intelligence. The server is not available for Capella. It uses the couchbase-operational-insights SDK. It runs as its own process, separate from the operational server.

Important

CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING is an HTTP(S) URL, not a couchbase:// connection string — e.g. http://localhost:8095, or https://<host>:18095 over TLS. This is the most common misconfiguration.

Operational Insights Quick Start

From PyPI with uvx:

{
  "mcpServers": {
    "couchbase-operational-insights": {
      "command": "uvx",
      "args": ["couchbase-mcp-server", "operational-insights"],
      "env": {
        "CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING": "http://localhost:8095",
        "CB_OPERATIONAL_INSIGHTS_USERNAME": "Administrator",
        "CB_OPERATIONAL_INSIGHTS_PASSWORD": "password"
      }
    }
  }
}

With Docker:

{
  "mcpServers": {
    "couchbase-operational-insights": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING=http://host.docker.internal:8095",
        "-e", "CB_OPERATIONAL_INSIGHTS_USERNAME=Administrator",
        "-e", "CB_OPERATIONAL_INSIGHTS_PASSWORD=password",
        "couchbase/mcp-server:latest", "operational-insights"
      ]
    }
  }
}

From source, use the operational source configuration with operational-insights as the last argument and the variables above.

Operational Insights Connection and Authentication
Environment VariableCLI ArgumentDescription
CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING--connection-stringEndpoint URL (HTTP/HTTPS). Required
CB_OPERATIONAL_INSIGHTS_USERNAME--usernameUsername
CB_OPERATIONAL_INSIGHTS_PASSWORD--passwordPassword
CB_OPERATIONAL_INSIGHTS_CA_CERT_PATH--ca-cert-pathRoot certificate (PEM) for a self-signed/untrusted server certificate
CB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PATH--client-cert-pathClient certificate for mTLS — PEM (with a key) or a PKCS#12 bundle (.p12/.pfx, no key). Requires an https:// URL; overrides username/password
CB_OPERATIONAL_INSIGHTS_CLIENT_KEY_PATH--client-key-pathPrivate key (PEM) for the client certificate. Leave unset for PKCS#12
CB_OPERATIONAL_INSIGHTS_CLIENT_CERT_PASSWORD--client-cert-passwordPassword for an encrypted key or PKCS#12 bundle
CB_MCP_OPERATIONAL_INSIGHTS_QUERY_RESULT_MAX_SIZE--operational-insights-query-result-max-sizeMaximum query result size in bytes. Unset means no limit. When set, reading stops at the budget and the response reports truncated: true; a row that would overrun it is not returned. Values above 4 MB are clamped

All common configuration applies, with these differences from the operational server:

  • The default port is 8001 and the default log file is mcp_server_operational_insights.log, so both servers can run side by side.
  • Only one worker is supported (CB_MCP_WORKERS=1), because async query handles live in process memory.
  • It has no CB_MCP_EMBEDDING_MODEL_* options.
Operational Insights Tools

All names except get_server_configuration_status are prefixed operational_insights_, so both servers can be registered in one client without collisions. The write tool (marked ✏️) is not loaded while read-only mode is on, the default.

ToolDescription
get_server_configuration_statusSame tool as on the operational server
operational_insights_get_databases_in_clusterList databases
operational_insights_get_scopes_in_databaseList scopes in a database
operational_insights_get_collections_in_scopeList collections (datasets) in a scope
operational_insights_get_schema_for_collectionInfer a collection's JSON schema by sampling
operational_insights_list_indexesList secondary indexes from System.Metadata.Index
operational_insights_explain_queryEXPLAIN a SQL++ statement without running it
operational_insights_run_query_syncRun SQL++ and return rows, up to the result size limit; can export instead. Read-only mode is enforced server-side
operational_insights_run_query_asyncStart a query and return a query_handle; preferred for large exports
operational_insights_get_async_query_resultsPoll an async query; returns rows (or the export destination) when ready
operational_insights_discard_async_query_resultsFree a finished async query's results
operational_insights_cancel_async_queryStop a still-running async query (allowed in read-only mode)
operational_insights_create_index ✏️Create a secondary index via CREATE INDEX

Async queries follow a start → poll → discard-or-cancel flow: operational_insights_run_query_async returns a query_handle, operational_insights_get_async_query_results is polled until ready, then operational_insights_discard_async_query_results frees the results, or operational_insights_cancel_async_query stops a query still running.

Exporting large results

Instead of returning rows, operational_insights_run_query_sync and operational_insights_run_query_async can wrap the statement in COPY ... TO and write the rows to external object storage. Pass all three of copy_to_link (an existing link created with CREATE LINK ... TYPE S3), copy_to_bucket and copy_to_path, plus optionally copy_to_format (json, the default, or parquet). The tool then returns a confirmation with no rows:

{
  "success": true,
  "exported": true,
  "destination": {"link": "s3Link", "bucket": "my-exports", "path": "exports/run1", "format": "json"},
  "message": "Results were written to my-exports/exports/run1 as json. ..."
}
  • A partial destination is rejected rather than silently returning rows.
  • The sync tool waits for the whole upload; prefer the async tool for large exports.
  • Exports are blocked in read-only mode (they write to external storage), so they need CB_MCP_READ_ONLY_MODE=false or a token with couchbase-mcp:write.
  • csv is not offered, because it needs an explicit output schema that can't be inferred from an arbitrary SELECT.

Common Configuration

These settings work the same way for both servers. Every option can be set as an environment variable or as a CLI flag after the subcommand.

Safety Controls

Three layers, from broadest to narrowest. Use them together — but remember that none of them replaces RBAC.

Important

The database user's RBAC permissions are the authoritative security control. For example, disabling upsert_document_by_id and delete_document_by_id does not stop run_sql_plus_plus_query from running INSERT/UPDATE/DELETE/MERGE — only read-only mode or missing RBAC permissions do. Give the server's database user only the permissions it needs.

Read-only mode

CB_MCP_READ_ONLY_MODE (default true) is the single switch for writes:

  • true — the write tools marked ✏️ in each server's tool list are not loaded, and queries that modify data or structure are blocked.
  • false — write tools are loaded and modifying queries are allowed.
Disabling tools

CB_MCP_DISABLED_TOOLS removes tools from discovery entirely. It accepts a comma-separated list or a path to a file with one tool name per line (# starts a comment):

CB_MCP_DISABLED_TOOLS="upsert_document_by_id,delete_document_by_id"
# or
CB_MCP_DISABLED_TOOLS=/path/to/disabled_tools.txt
# disabled_tools.txt
# Write operations
upsert_document_by_id
delete_document_by_id

# Index advisor
get_index_advisor_recommendations

On Capella, the operational server also disables some admin tools automatically.

Requiring confirmation (elicitation)

CB_MCP_CONFIRMATION_REQUIRED_TOOLS asks the user to confirm before a listed tool runs, using MCP elicitation. It takes the same comma-separated or file formats as disabled tools:

CB_MCP_CONFIRMATION_REQUIRED_TOOLS="delete_document_by_id,replace_document_by_id"
  • If the client supports elicitation, the user is prompted before the tool runs.
  • If it doesn't, the tool runs without confirmation, for backward compatibility.
  • Confirmation needs an MCP session, so it cannot be combined with stateless HTTP (CB_MCP_STATELESS_HTTP=true or CB_MCP_WORKERS above 1). The server refuses to start with that combination.
Transports
TransportUse forEndpoint
stdio (default)One local client that launches the server as a subprocess—
httpSeveral clients sharing one server; supports OAuth and health checks, and workers on the operational serverhttp://<host>:<port>/mcp
sseDeprecated by the MCP spec — use httphttp://<host>:<port>/sse

Set the transport with CB_MCP_TRANSPORT, the bind address with CB_MCP_HOST (default 127.0.0.1) and the port with CB_MCP_PORT (each server's default port when unset). Without OAuth, the HTTP endpoint is unauthenticated.

uvx couchbase-mcp-server operational \
  --connection-string='<couchbase_connection_string>' \
  --username='<database_username>' \
  --password='<database_password>' \
  --transport=http

Then point your client at the URL:

{
  "mcpServers": {
    "couchbase-http": {
      "url": "http://localhost:8000/mcp"
    }
  }
}
Multiple workers

One process uses at most about one CPU core. --workers N (CB_MCP_WORKERS) runs N processes behind the same host and port; the number of available cores is a good starting point. Workers are supported by the operational server only. With more than one worker:

  • The http transport is required, and the server runs in stateless HTTP mode, because a client's requests can reach different workers. You can also set --stateless-http=true on a single worker, for example behind a load balancer without sticky sessions.
  • Confirmation-required tools cannot be used.
  • Each process writes its own log files, named with host and process id (mcp_server.<host>.<pid>.info.log) — one set for the supervisor and one per worker.
Health check

In HTTP mode, GET /health returns {"status": "ok", "server": "<server>"} on the MCP port. It is a liveness check: it does not connect to the cluster (so a cluster outage doesn't restart healthy containers), needs no authentication even with OAuth enabled, and is served by every worker. See Docker for probe examples.

OAuth 2.1 Authorization

With --transport=http, either server can act as an OAuth 2.1 resource server, validating bearer JWTs against your identity provider's JWKS. It works with any OAuth 2.1/OIDC provider that publishes a JWKS, and does not issue tokens or manage users. OAuth settings are ignored on stdio.

  • OAuth turns on only when all three of CB_MCP_OAUTH_JWT_JWKS_URI, CB_MCP_OAUTH_JWT_ISSUER and CB_MCP_OAUTH_JWT_AUDIENCE are set; setting only some fails at startup.
  • CB_MCP_OAUTH_MCP_BASE_URL additionally publishes RFC 9728 Protected Resource Metadata so clients can discover the authorization server.
  • Access is gated by two scopes in the token's scope/scp claim: couchbase-mcp:read (read tools) and couchbase-mcp:write (write tools). Full access needs both. Rename them with CB_MCP_OAUTH_SCOPE_READ_LABEL / CB_MCP_OAUTH_SCOPE_WRITE_LABEL if your IdP can't emit these labels. Both servers use the same labels, so one IdP configuration covers both.
uvx couchbase-mcp-server operational \
  --connection-string='<couchbase_connection_string>' \
  --username='<database_username>' \
  --password='<database_password>' \
  --transport=http \
  --oauth-jwks-uri='https://auth.example.com/.well-known/jwks.json' \
  --oauth-issuer='https://auth.example.com/' \
  --oauth-audience='couchbase-mcp-server' \
  --oauth-mcp-base-url='<public_base_url_of_this_server>'

See the OAuth documentation for IdP setup.

Logging

Each server logs to stderr at info level by default.

  • CB_MCP_LOG_LEVEL — off, error, warning, info (lifecycle events and tool calls) or debug.
  • CB_MCP_LOG_SINKS — stderr, file, or both. With file, one rotating file per level is written next to CB_MCP_LOG_FILE (mcp_server.info.log, mcp_server.error.log, …).
  • Rotation and retention — CB_MCP_LOG_ROTATION_MAX_SIZE_MB (default 1 MB) and CB_MCP_LOG_RETENTION_BACKUP_COUNT (default 1) apply to every level; override per level with CB_MCP_LOG_<LEVEL>_ROTATION_MAX_SIZE_MB / CB_MCP_LOG_<LEVEL>_RETENTION_BACKUP_COUNT. Invalid sizes fall back to the default with a startup warning. CB_MCP_LOG_MAX_BYTES is deprecated.
  • Config snapshot — with the file sink, a JSON record of the environment and redacted server config is written to mcp_server_config.log.json on every start, for support.
# Debug logging to stderr and rotating per-level files
uvx couchbase-mcp-server operational --log-level=debug --log-sinks=stderr,file

Your MCP client usually also captures the server's stderr — see Client Setup for where. Details: logging documentation.

Auditing

Audit logging records who did what, and whether it was allowed — separate from the operational logs, which record what went wrong. The MCP server is the only layer that can answer this for an agent: every request reaches the cluster as a single database user, and decisions such as a scope denial, a read-only block or a declined confirmation never reach the cluster at all.

Auditing is off by default. Turn it on with CB_MCP_AUDIT_LOG_ENABLED=true; it writes to stderr unless you set CB_MCP_AUDIT_LOG_SINKS=file and CB_MCP_AUDIT_LOG_FILE_PATH.

# 90 days of daily, gzipped audit files
uvx couchbase-mcp-server operational --audit-log-enabled=true \
  --audit-log-sinks=file --audit-log-file-path=/var/log/cb-mcp/audit.log \
  --audit-log-rotation-interval=1d --audit-log-rotation-max-size-mb=0 \
  --audit-log-retention-max-backups=90

Records are JSON Lines using the same field vocabulary as Couchbase Server and Sync Gateway:

{"id":61522,"name":"document write","description":"A document write operation was requested through a tool","timestamp":"2026-09-29T09:14:22.418Z","real_userid":{"domain":"oauth","user":"agent-svc-7"},"server":{"version":"1.0.2","host":"mcp-01"},"cid":"9f2c...","outcome":"success","tool_name":"upsert_document_by_id","required_scope":"write","ks":"travel-sample.inventory.airline","cb_userid":"mcp_service"}
How auditing behaves
  • Identity — real_userid is the caller: oauth (the token subject), local (the OS user, on stdio) or anonymous (HTTP without OAuth, which warns at startup).
  • Correlation — cid groups every record from one request, and is sent as the SQL++ client_context_id, so it joins exactly with Couchbase Server's clientContextId. There is deliberately no session identifier.
  • Events — a fixed, numbered catalogue (lifecycle, initialize, token rejected, scope denied, read-only block, confirmation declined/skipped, and a read/write pair per tool category). The full catalogue ships as descriptor.json in the package. The operational server uses block 0xF000 (61440), Operational Insights 0x10000 (65536), and both share 0xE000 (57344) for core events.
  • Filtering — CB_MCP_AUDIT_LOG_DISABLED_EVENTS suppresses read events by numeric id (e.g. 61490,61491). Write and security events cannot be disabled.
  • Rotation — by size (CB_MCP_AUDIT_LOG_ROTATION_MAX_SIZE_MB, default 10) and age (CB_MCP_AUDIT_LOG_ROTATION_INTERVAL, default 1d), whichever comes first; 0 switches either off. Rotated files are timestamped and gzipped; the live file stays plain text for tail -f.
  • Per-process files — host and pid are inserted into the name (audit.log → audit.<host>.<pid>.log), so concurrent processes never share a file.
  • Retention is per file — CB_MCP_AUDIT_LOG_RETENTION_MAX_BACKUPS (default 10) bounds one file's backups. Each new process writes a new file and nothing prunes old ones, so size the volume or sweep old audit.*.log* files.
  • Fail-open — if the file can't be written, the server keeps serving and counts dropped records; get_server_configuration_status reports written / dropped / write_errors.
  • Tool arguments — recorded only with CB_MCP_AUDIT_LOG_TOOL_ARGS=true, which warns at startup. There is no redaction in this release, so arguments, including full document bodies, are written verbatim.

Client Setup

Each client needs a server configuration from the operational or Operational Insights quick start in its own configuration location. The examples below use the operational server.

Claude Desktop
  1. Open the configuration file (see the MCP quickstart guide):
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the server under mcpServers and restart Claude Desktop.

Logs: macOS ~/Library/Logs/Claude, Windows %APPDATA%\Claude\Logs. See the MCP troubleshooting guide.

Cursor
  1. Go to Cursor Settings > Tools & Integrations > MCP Tools (see Cursor's MCP docs), or use the one-click Install in Cursor link — then replace the placeholder connection string and credentials.
  2. Add the configuration under mcpServers and save.
  3. Refresh the MCP servers list to check that couchbase is enabled.

Logs: in the bottom panel, open Output and select Cursor MCP.

Windsurf Editor
  1. Open Command Palette > Windsurf MCP Configuration Panel, or Windsurf Settings > Advanced > Cascade > Model Context Protocol (MCP) Servers (see Windsurf's MCP docs).
  2. Click Add Server > Add custom server, paste the configuration and save.
  3. Refresh the server list to check that couchbase is enabled.
VS Code

VS Code uses servers as the top-level key instead of mcpServers. Put the configuration in .vscode/mcp.json for a workspace, or run MCP: Open User Configuration for all workspaces (see VS Code's MCP docs):

{
  "servers": {
    "couchbase": {
      "command": "uvx",
      "args": ["couchbase-mcp-server", "operational"],
      "env": {
        "CB_CONNECTION_STRING": "couchbases://connection-string",
        "CB_USERNAME": "username",
        "CB_PASSWORD": "password"
      }
    }
  }
}

Saving the file starts the server; use the Running | Stop | n Tools actions above it to manage it.

Logs: run MCP: List Servers, pick couchbase, then Show Output.

JetBrains IDEs
  1. Install the AI Assistant or Junie plugin.
  2. Go to Settings > Tools > AI Assistant (or Junie) > MCP Server, click +, add the configuration and click Apply.
  3. Hover over the server's status to see its tools.

Logs: Help > Show Log in Finder (Explorer) > mcp > couchbase.

Docker

Prebuilt images are published to Docker Hub as couchbase/mcp-server, and the server is listed in the Docker MCP Catalog. Configure the container with the same environment variables as above. See the Docker Hub page (DOCKER.md) for tags, volumes and health-check examples.

Running over HTTP — note that the server must bind to 0.0.0.0 to be reachable from outside the container:

docker run --rm \
  -e CB_CONNECTION_STRING='<couchbase_connection_string>' \
  -e CB_USERNAME='<database_user>' \
  -e CB_PASSWORD='<database_password>' \
  -e CB_MCP_TRANSPORT=http \
  -e CB_MCP_HOST=0.0.0.0 \
  -p 8000:8000 \
  couchbase/mcp-server:latest operational
  • If Couchbase runs on your host machine, use couchbase://host.docker.internal as the connection string (see Docker networking). Use --network=<your_network> to join another container's network.
  • Append operational-insights instead of operational to run the Operational Insights server (port 8001).
Building the image from source
docker build -t mcp/couchbase-src .

./build.sh [image-name] builds with the same arguments as CI — it sets the GIT_COMMIT_HASH and BUILD_DATE build args and tags the image latest and <short-commit> (default name mcp/couchbase-src). To build with the labels by hand:

docker build --build-arg GIT_COMMIT_HASH=$(git rev-parse HEAD) \
  --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
  -t mcp/couchbase-src .

# Check the labels
docker inspect --format='{{json .Config.Labels}}' mcp/couchbase-src:latest

Troubleshooting

  • Check the connection string, username/password or certificate paths.
  • For Capella, make sure the cluster allows connections from the machine running the server.
  • Make sure the database user can access at least one bucket.
  • If the client can't find uv/uvx, put the absolute path in command.
  • When running from source, check the repository path in the configuration, and run uv sync after pulling updates.
  • Call get_server_configuration_status to see the configuration the server actually resolved, and check your client's logs (see Client Setup).

FAQ

How do I connect Claude Desktop to Couchbase? Add the quick start configuration to claude_desktop_config.json and restart Claude Desktop — see Client Setup.

Can I use this with Couchbase Capella? Yes, with the operational server: the same configuration works for Capella and self-managed clusters, though a few admin tools are only available on self-managed clusters (see Tools). The Operational Insights server is for self-managed Operational Insights clusters only.

Is it safe to let an AI agent write to my database? By default, no write tools are loaded and modifying SQL++ is blocked. If you enable writes, you can still disable individual tools or require confirmation — but your Couchbase user's RBAC permissions remain the real security boundary. See Safety Controls.

Do I need to know SQL++? No. Ask in plain English and the assistant writes the SQL++ for run_sql_plus_plus_query. It can also explain a query plan or ask the Index Advisor for recommendations.

STDIO, Streamable HTTP or SSE? STDIO for a single local client. Streamable HTTP to share one server between clients, with OAuth. SSE is deprecated. See Transports.

Is this officially supported by Couchbase? Yes, with a Couchbase AI Data Plane license. Without one, Couchbase engineers help on a best-effort basis through GitHub issues. See Support Policy.

Contributing

Contributions are welcome — bug fixes, features and documentation. To report a bug or ask for help, open a GitHub issue.

See CONTRIBUTING.md for development setup, linting, testing, project structure and workflow. To get started:

git clone https://github.com/couchbase/mcp-server-couchbase.git
cd mcp-server-couchbase
uv sync --extra dev
uv run pre-commit install
./scripts/lint.sh

Integration tests run against a live cluster. Export CB_CONNECTION_STRING, CB_USERNAME, CB_PASSWORD and optionally CB_MCP_TEST_BUCKET; the Operational Insights tests also use CB_OPERATIONAL_INSIGHTS_CONNECTION_STRING / _USERNAME / _PASSWORD and are skipped when those are unset. Then run:

uv run --extra dev pytest tests/integration -v

Usage Data, LLM Risks and Support Policy

Usage Data Collection

This product automatically collects usage and performance data (such as product name and version) and browser information (such as IP address) (collectively, "Usage Data"). Couchbase uses Usage Data, along with other data you may provide to Couchbase (such as your user name or email address), to develop and improve our products as well as inform our sales and marketing programs. We do not access or collect any data you store in Couchbase products. We use Usage Data to understand aggregate usage patterns and make our products more useful to you. For more information on how Couchbase collects, protects, and processes information, please refer to the Couchbase Privacy Policy viewable at https://www.couchbase.com/privacy-policy.

Risks Associated with LLMs
  • The use of large language models and similar technology involves risks, including the potential for inaccurate or harmful outputs.
  • Couchbase does not review or evaluate the quality or accuracy of such outputs, and such outputs may not reflect Couchbase's views.
  • You are solely responsible for determining whether to use large language models and related technology, and for complying with any license terms, terms of use, and your organization's policies governing your use of the same.
Support Policy

Couchbase MCP Server is open source and maintained by Couchbase engineers. How you get help depends on how you use it:

  • Community use — report bugs, ask questions and request features by opening a GitHub issue. Couchbase engineers monitor the repository and respond on a best-effort basis, with no response-time commitment. The Couchbase support portal cannot help with community use.
  • Enterprise support — available by licensing Couchbase AI Data Plane, which also covers Couchbase Agent Memory and Couchbase Agent Catalog. Licensed customers get help through their usual Couchbase Support channels.

Thank you for using and contributing to the project!

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.