Couchbase MCP Server is a self-hosted MCP Server that allows AI agents to connect to and interact with data in Couchbase clusters, whether hosted on Capella or self-managed. It provides tools across categories including Cluster Health, Data Schema, Key-Value, Query, and Performance — with safety controls via read-only mode and fine-grained tool disabling. It supports both STDIO and Streamable HTTP transports.
Couchbase MCP server is distributed as a Python Package Index (PyPI) package and via Docker. Enterprise support for Couchbase MCP Server is available by licensing Couchbase AI Data Plane, which also entitles use and enterprise support of Couchbase Agent Memory and Couchbase Agent Catalog.
For full documentation, visit mcp-server.couchbase.com.
| Tool Name | Description |
|---|---|
get_server_configuration_status |
Get the server status and configuration without connecting to the cluster — reports read-only mode, disabled/confirmation-required tools, OAuth settings, and the resolved logging configuration |
test_cluster_connection |
Check the cluster credentials by connecting to the cluster |
get_cluster_health_and_services |
Get cluster health status and list of all running services |
| Tool Name | Description |
|---|---|
get_buckets_in_cluster |
Get a list of all the buckets in the cluster |
get_scopes_in_bucket |
Get a list of all the scopes in the specified bucket |
get_collections_in_scope |
Get a list of all the collections in a specified scope and bucket. Note that this tool requires the cluster to have Query service. |
get_scopes_and_collections_in_bucket |
Get a list of all the scopes and collections in the specified bucket |
get_schema_for_collection |
Get the structure for a collection |
| Tool Name | Description |
|---|---|
get_document_by_id |
Get a document by ID from a specified scope and collection |
upsert_document_by_id |
Upsert a document by ID to a specified scope and collection. Disabled by default when CB_MCP_READ_ONLY_MODE=true. |
insert_document_by_id |
Insert a new document by ID (fails if document exists). Disabled by default when CB_MCP_READ_ONLY_MODE=true. |
replace_document_by_id |
Replace an existing document by ID (fails if document doesn't exist). Disabled by default when CB_MCP_READ_ONLY_MODE=true. |
delete_document_by_id |
Delete a document by ID from a specified scope and collection. Disabled by default when CB_MCP_READ_ONLY_MODE=true. |
| Tool Name | Description |
|---|---|
list_indexes |
List all indexes in the cluster with their definitions, with optional filtering by bucket, scope, collection and index name. Set return_raw_index_stats=true to return the unprocessed index information. |
get_index_advisor_recommendations |
Get index recommendations from Couchbase Index Advisor for a given SQL++ query to optimize query performance |
run_sql_plus_plus_query |
Run a SQL++ query on a specified scope. |
Queries are automatically scoped to the specified bucket and scope, so use collection names directly (e.g., SELECT * FROM users instead of SELECT * FROM bucket.scope.users).
CB_MCP_READ_ONLY_MODE is true by default, which means that all write operations (KV and Query) are disabled. When enabled, KV write tools are not loaded and SQL++ queries that modify data are blocked. |
| explain_sql_plus_plus_query | Generate and evaluate an EXPLAIN plan for a SQL++ query. Returns query metadata, extracted plan, and plan evaluation findings. |
| Tool Name | Description |
|---|---|
get_longest_running_queries |
Get longest running queries by average service time |
get_most_frequent_queries |
Get most frequently executed queries |
get_queries_with_largest_response_sizes |
Get queries with the largest response sizes |
get_queries_with_large_result_count |
Get queries with the largest result counts |
get_queries_using_primary_index |
Get queries that use a primary index (potential performance concern) |
get_queries_not_using_covering_index |
Get queries that don't use a covering index |
get_queries_not_selective |
Get queries that are not selective (index scans return many more documents than final result) |
The MCP server can be run either from the prebuilt PyPI package or the source using uv.
We publish a pre built PyPI package for the MCP server.
{
"mcpServers": {
"couchbase": {
"command": "uvx",
"args": ["couchbase-mcp-server"],
"env": {
"CB_CONNECTION_STRING": "couchbases://connection-string",
"CB_USERNAME": "username",
"CB_PASSWORD": "password"
}
}
}
}
or
{
"mcpServers": {
"couchbase": {
"command": "uvx",
"args": ["couchbase-mcp-server"],
"env": {
"CB_CONNECTION_STRING": "couchbases://connection-string",
"CB_CLIENT_CERT_PATH": "/path/to/client-certificate.pem",
"CB_CLIENT_KEY_PATH": "/path/to/client.key"
}
}
}
}
Note: If you have other MCP servers in use in the client, you can add it to the existing
mcpServersobject.
The MCP server can be run from the source using this repository.
git clone https://github.com/couchbase/mcp-server-couchbase.git
This is the common configuration for the MCP clients such as Claude Desktop, Cursor, Windsurf Editor.
{
"mcpServers": {
"couchbase": {
"command": "uv",
"args": [
"--directory",
"path/to/cloned/repo/mcp-server-couchbase/",
"run",
"src/mcp_server.py"
],
"env": {
"CB_CONNECTION_STRING": "couchbases://connection-string",
"CB_USERNAME": "username",
"CB_PASSWORD": "password"
}
}
}
}
Note:
path/to/cloned/repo/mcp-server-couchbase/should be the path to the cloned repository on your local machine. Don't forget the trailing slash at the end!Note: If you have other MCP servers in use in the client, you can add it to the existing
mcpServersobject.
The server can be configured using environment variables or command line arguments:
| Environment Variable | CLI Argument | Description | Default |
|---|---|---|---|
CB_CONNECTION_STRING |
--connection-string |
Connection string to the Couchbase cluster | Required |
CB_USERNAME |
--username |
Username with access to required buckets for basic authentication | Required (or Client Certificate and Key needed for mTLS) |
CB_PASSWORD |
--password |
Password for basic authentication | Required (or Client Certificate and Key needed for mTLS) |
CB_CLIENT_CERT_PATH |
--client-cert-path |
Path to the client certificate file for mTLS authentication | Required if using mTLS (or Username and Password required) |
CB_CLIENT_KEY_PATH |
--client-key-path |
Path to the client key file for mTLS authentication | Required if using mTLS (or Username and Password required) |
CB_CA_CERT_PATH |
--ca-cert-path |
Path 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-mode |
Prevent all data modifications (KV and Query). When enabled, KV write tools are not loaded. | true |
CB_MCP_TRANSPORT |
--transport |
Transport mode: stdio, http, sse |
stdio |
CB_MCP_HOST |
--host |
Host for HTTP/SSE transport modes | 127.0.0.1 |
CB_MCP_PORT |
--port |
Port for HTTP/SSE transport modes | 8000 |
CB_MCP_DISABLED_TOOLS |
--disabled-tools |
Tools to disable (see Disabling Tools) | None |
CB_MCP_CONFIRMATION_REQUIRED_TOOLS |
--confirmation-required-tools |
Tools that require explicit user confirmation before execution via MCP elicitation (see Elicitation/Confirmation Required Tools) | None |
CB_MCP_LOG_LEVEL |
--log-level |
Logging level for the MCP server: off, debug, info, warning, error (see Logging) |
info |
CB_MCP_LOG_SINKS |
--log-sinks |
Comma-separated log destinations: stderr, file, or both (see Logging) |
stderr |
CB_MCP_LOG_FILE |
--log-file |
Base path for per-level log files (only used when the file sink is enabled) |
mcp_server.log |
CB_MCP_LOG_MAX_BYTES |
--log-max-bytes |
Maximum size in bytes per log file before it rotates | 1048576 (1 MB) |
CB_MCP_OAUTH_JWT_JWKS_URI |
--oauth-jwks-uri |
JWKS 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-issuer |
Expected JWT iss claim. Required to enable OAuth |
None |
CB_MCP_OAUTH_JWT_AUDIENCE |
` |
$ claude mcp add mcp-server-couchbase \
-- python -m otcore.mcp_server <graph>