Skip to content

Menu

Couchbase MCP Server logo

Couchbase MCP Server

Published

At a glance

Category
Databases
Watch out for
Read-only mode is the default, so every write tool is missing until CB_MCP_READ_ONLY_MODE=false is set, and once it is set an agent can delete scopes, collections and indexes permanently.

The Couchbase MCP Server is published by Couchbase under the Apache 2.0 license. It is self-hosted and lets an AI agent work with data in a Couchbase cluster, either on Capella or on self-managed Couchbase Server, and it also has a separate mode for Operational Insights Enterprise. It is a Python package on PyPI (couchbase-mcp-server, version 1.1.0 at the time of writing) and a Docker image, couchbase/mcp-server.

The package ships two servers picked by subcommand. The default operational server uses the couchbase Python SDK and exposes 52 tools covering cluster health, schema discovery, key-value reads and writes, SQL++, indexes, full-text and vector search, and query performance. The operational-insights server talks to an HTTP endpoint and has 13 tools for schema, sync and async SQL++, indexes and exports.

It runs over stdio by default and can also serve Streamable HTTP (default port 8000) with OAuth support. The safety model is worth knowing up front: read-only mode is on by default, so write tools are not even loaded until you set CB_MCP_READ_ONLY_MODE=false.

How it connects

Your AI app

An assistant or agent that supports MCP

Couchbase MCP Server

Runs as

  • Python (uv / pip)
  • Docker

Gives the agent

  • Cluster health
  • Schema discovery
  • Documents
  • SQL++ and indexing
  • Search and vectors
  • Query performance

Couchbase

Signs in with

  • Username and password
Your AI app talks to Couchbase MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

Cluster health
test_cluster_connection, get_cluster_health_and_services and get_client_connectivity_report check credentials and services. On self-managed clusters, get_cluster_metrics, get_cluster_tasks and get_cluster_system_events add stats, running tasks and the event log.
Schema discovery
get_buckets_in_cluster, get_scopes_and_collections_in_bucket and get_schema_for_collection walk the bucket, scope and collection hierarchy and infer a collection's document structure.
Documents
get_document_by_id and lookup_subdocument read data. With read-only mode off, upsert_document_by_id, insert_document_by_id, replace_document_by_id, delete_document_by_id and mutate_subdocument change it.
SQL++ and indexing
run_sql_plus_plus_query runs queries scoped to a bucket and scope, explain_sql_plus_plus_query returns a plan, and get_index_advisor_recommendations suggests indexes. list_indexes and create_query_index manage GSI indexes.
Search and vectors
run_search runs full-text queries from a raw JSON body, while run_vector_query (Server 8.0+) and run_vector_search (Server 7.6+) do similarity search, with optional prefilters.
Query performance
get_longest_running_queries, get_most_frequent_queries, get_queries_not_using_covering_index and get_active_queries surface slow or wasteful queries for tuning.

Setting it up

You need a running Couchbase cluster (the README points to the Capella free tier) plus uv and Python 3.11+, or just Docker. Add a server entry to your client's mcpServers config with "command": "uvx" and "args": ["couchbase-mcp-server", "operational"], and set CB_CONNECTION_STRING (for example couchbases://connection-string), CB_USERNAME and CB_PASSWORD in env. The Docker variant runs docker run --rm -i with the same three variables passed as -e flags and the image couchbase/mcp-server:latest operational. For mTLS, swap the username and password for CB_CLIENT_CERT_PATH and CB_CLIENT_KEY_PATH, and add CB_CA_CERT_PATH for a self-signed server certificate. In Claude Desktop the entry goes in claude_desktop_config.json followed by a restart; in Cursor it goes under Cursor Settings > Tools & Integrations > MCP Tools. To serve over HTTP instead, run couchbase-mcp-server operational --transport=http.

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Map an unfamiliar bucket's scopes and collections and infer document shapes before writing application queries.
  • Write a SQL++ query, check its EXPLAIN plan and ask the Index Advisor which index would cover it.
  • Find the longest-running and non-selective queries on a cluster during a performance review.
  • Run a vector similarity search with a SQL++ prefilter to test a retrieval setup.
  • Create a scope, collection and deferred index in a dev cluster once read-only mode has been turned off.

Limitations and things to watch

  • Read-only mode is the default, so every write tool is missing until CB_MCP_READ_ONLY_MODE=false is set, and once it is set an agent can delete scopes, collections and indexes permanently.
  • Tools marked self-managed only, such as get_cluster_metrics, get_index_stats and get_cluster_tasks, need Couchbase Server 7.6+ and are not registered on Capella connections.
  • Several admin tools need extra roles, for example ro_admin for get_active_queries, and Full Admin or Cluster Admin for get_cluster_system_events and delete_active_query.
  • create_index is deprecated in favour of create_query_index and is due to be removed in 2.0.
  • Stateless HTTP mode, used when running more than one worker, cannot be combined with confirmation-required tools.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…