Couchbase MCP Server Cluster Data Access
Access and manage Couchbase cluster data with the MCP server to query, retrieve, and update documents securely and efficiently.
npx -y @Couchbase-Ecosystem/mcp-server-couchbaseOverview
The Couchbase MCP Server provides a lightweight HTTP interface for accessing and managing Couchbase cluster data using the Model Context Protocol (MCP). It acts as a bridge between Couchbase clusters and external tooling or AI systems that need structured, secure access to cluster information and documents without embedding Couchbase SDKs directly in every client.
For developers, the MCP server simplifies common tasks — discovering clusters, listing buckets/scopes/collections, performing KV operations, and running N1QL queries — through a consistent JSON/HTTP API. This is useful for integration, automation, and building services that must query or update Couchbase data while centralizing authentication, observability, and policy enforcement.
Features
- Exposes Couchbase cluster metadata (clusters, buckets, scopes, collections) via HTTP
- KV operations: fetch, upsert, remove documents by ID
- N1QL query endpoint for ad-hoc and parameterized queries
- Authentication and secure connections to Couchbase clusters (configurable)
- Centralized access point for integrating Couchbase with automation tools, AI systems, or microservices
- Simple JSON/HTTP API that fits into existing web-based workflows and scripts
Installation / Configuration
The MCP server can be run from source or as a container. Below are example configuration options and common run commands.
Environment variables (typical):
| Variable | Description |
|---|---|
| COUCHBASE_CONNSTRING | Couchbase cluster connection string (e.g., couchbase://127.0.0.1) |
| COUCHBASE_USERNAME | Username for Couchbase cluster |
| COUCHBASE_PASSWORD | Password for Couchbase cluster |
| MCP_BIND_ADDR | Address and port to bind the MCP HTTP API (e.g., 0.0.0.0:8080) |
| MCP_LOG_LEVEL | Log verbosity (e.g., info, debug) |
| TLS_CERT / TLS_KEY | Optional TLS certificate and key for secure MCP API |
Example: run with Docker (replace placeholders):
Run from source (Go environment assumed):
COUCHBASE_CONNSTRING="couchbase://127.0.0.1" \
COUCHBASE_USERNAME="Administrator" \
COUCHBASE_PASSWORD="password" \
Configuration file (JSON example):
Available Resources
The MCP server typically exposes RESTful endpoints for cluster exploration and data operations. Common endpoints you can expect:
- GET /clusters — list configured/connected clusters
- GET /clusters/{cluster}/buckets — list buckets
- GET /clusters/{cluster}/buckets/{bucket}/scopes — list scopes & collections
- GET /clusters/{cluster}/buckets/{bucket}/docs/{id} — fetch document by ID
- PUT /clusters/{cluster}/buckets/{bucket}/docs/{id} — upsert document
- DELETE /clusters/{cluster}/buckets/{bucket}/docs/{id} — remove document
- POST /clusters/{cluster}/query — execute a N1QL query; JSON body with
statementand optionalparams
The repository contains API examples and may include an OpenAPI/Swagger spec in the docs folder; check the GitHub project for the exact path and additional tooling.
GitHub: https://github.com/Couchbase-Ecosystem/mcp-server-couchbase
Use Cases
Integration with AI/assistant tooling
- Feed documents or query results to ML models without exposing Couchbase credentials to the model runtime.
- Example: a system fetches user activity docs via MCP and passes them to a vectorization pipeline.
Admin automation and scripting
- Automate bucket and collection inspections, perform bulk updates, or run scheduled maintenance queries.
- Example: a script polls GET /clusters/{cluster}/buckets to verify bucket health and then runs targeted N1QL for remediation.
Microservice abstraction
- Microservices call the MCP API to read/write documents, removing direct Couchbase SDK dependencies and centralizing access control.
- Example: an edge service performs a PUT to /buckets/users/docs/{id} to update a profile without carrying SDK logic.
Debugging and observability
- Quickly inspect documents or run ad-hoc queries when diagnosing production issues, with centralized logging and auditing.
- Example: use curl to fetch a document and record the request in centralized logs for incident analysis.
Example curl usage:
# Run a N1QL query
# Get a document
Notes and Next Steps
- Consult the repository for the exact API schema, authentication modes, and deployment examples.
- Secure production deployments with TLS, network controls, and proper Couchbase RBAC accounts.
- Extend or integrate the server into your tooling to centralize Couchbase access and simplify client-side code.