Couchbase MCP Server is a self-hosted Model Context Protocol (MCP) server used to connect AI agents and LLM-powered assistants (such as Claude, Cursor, Windsurf, VS Code Copilot, and other MCP clients) to data in Couchbase clusters, whether the cluster is hosted on Capella or self-managed. MCP is an open standard that allows AI assistants to call tools and query external data sources; this server implements that standard for Couchbase, enabling AI agents to inspect clusters, run SQL++ queries, read and write documents, and analyze query performance using natural language, without writing code by hand.
Main capabilities:
- Provides tools in categories such as cluster health, data schemas, key-value, queries, and performance.
- Provides security controls through read-only mode (enabled by default) and fine-grained tool disabling, allowing AI agents to explore and query data without accidentally writing.
- Supports STDIO and Streamable HTTP transports.
- Supports Capella and self-managed clusters, with the same configuration able to connect to either.
- Is RBAC-aware: tool disabling is a convenience layer for guiding LLM behavior, while the underlying Couchbase user's role-based access control remains the authoritative security boundary.
- Production-grade transports: STDIO can be used for local desktop clients, and Streamable HTTP with optional OAuth 2.1 (JWT/JWKS, provider-agnostic, supporting Auth0, Okta, Keycloak, Entra, Cognito, etc.) can be used for shared/remote deployments.
- Compatible with any client that implements the MCP specification; tested with Claude Desktop, Cursor, Windsurf, VS Code, and JetBrains AI Assistant/Junie.
Usage:
- Requires Python 3.10 or later, a running Couchbase cluster (the Capella free tier is recommended), installation of uv to run the server, and an MCP client (such as Claude Desktop).
- Can be run from a prebuilt PyPI package, or from source using uv.
- The server can be configured through environment variables or command-line arguments. CB_MCP_READ_ONLY_MODE is the single switch that controls write operations: when true (the default), all write operations (KV, query, scope/collection management, index management, FTS index management) are disabled, write tools are not loaded, and SQL++ queries that modify data or structure are blocked; when false, all write tools are loaded and SQL++ data/structure modification queries are allowed.
- Authentication requires a username and password, or a client certificate and key paths; a CA root certificate path may optionally be specified. If both a client certificate and a username/password are specified, client certificate authentication is used.
- EMBEDDING_PROVIDER selects the model backend for run_vector_query and run_vector_search to embed query text, and is entirely optional; when not configured, the server starts normally, both tools are still registered, and calling them returns an error explaining what needs to be set.
- Specific tools can be disabled so they are not loaded and are not exposed to MCP clients. A comma-separated list or a file path is supported (one tool name per line, lines starting with # are comments).
- Specific tools can be required to obtain explicit user confirmation before execution (when the MCP client supports elicitation).
- Logs are output to stderr by default, and log level, output location, rotation size, and retention count can be configured via CB_MCP_LOG_* variables.
Use cases:
- Interact with a Couchbase cluster in natural language via an AI assistant, for example querying buckets, scopes, collections, and schemas, running SQL++ queries, analyzing slow queries, checking cluster health, or inserting documents when read-only mode is off.
- Suitable for local desktop clients and shared/remote deployments.
Limitations:
- Couchbase Server 7.6+ and the Search service are required to use the full-text search tools; vector search query tools are not supported through the full-text search tools, but vector field mapping in upsert_search_index is unaffected.
- Some tools access Couchbase via REST endpoints that are not exposed through Couchbase Capella. The server detects the cluster type indicated by the connection string (if all hosts end with .cloud.couchbase.com it is Capella, otherwise it is self-managed) and does not register these tools on Capella connections.
- The query service health tool is limited to self-managed Couchbase Server 7.6+ and is unavailable on Capella.
- Disabling tools alone cannot guarantee that certain operations cannot be performed; the underlying database user's RBAC permissions are the authoritative security control.
- The confirmation feature requires an MCP session and cannot be used with stateless HTTP (--stateless-http or --workers greater than 1); the server will refuse to start with that combination.
- Enterprise support is obtained through a licensed Couchbase AI Data Plane, which also covers the use of Couchbase Agent Memory and Couchbase Agent Catalog and enterprise support.
For complete documentation, visit mcp-server.couchbase.com or docs.couchbase.com/mcp-server.