Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CB_MCP_HOSTNoHost for HTTP/SSE transport modes127.0.0.1
CB_MCP_PORTNoPort for HTTP/SSE transport modes8000
CB_PASSWORDYesPassword for authentication
CB_USERNAMEYesUsername with bucket access
CB_BUCKET_NAMEYesName of the bucket to access
CB_MCP_TRANSPORTNoTransport mode: stdio, http, ssestdio
CB_CONNECTION_STRINGYesConnection string to the Couchbase cluster
CB_MCP_READ_ONLY_QUERY_MODENoPrevent data modification queriestrue

Tools

Functions exposed to the LLM to take actions

NameDescription
get_buckets_in_cluster

Get the names of all the accessible buckets in the cluster.

get_server_configuration_status

Get the server status and configuration without establishing connection. This tool can be used to verify if the server is running and check the configuration.

test_cluster_connection

Test the connection to Couchbase cluster and optionally to a bucket. This tool verifies the connection to the Couchbase cluster and bucket by establishing the connection if it is not already established. If bucket name is not provided, it will not try to connect to the bucket specified in the MCP server settings. Returns connection status and basic cluster information.

get_scopes_and_collections_in_bucket

Get the names of all scopes and collections in the bucket. Returns a dictionary with scope names as keys and lists of collection names as values.

get_collections_in_scope

Get the names of all collections in the given scope and bucket.

get_scopes_in_bucket

Get the names of all scopes in the given bucket.

get_document_by_id

Get a document by its ID from the specified scope and collection. If the document is not found, it will raise an exception.

upsert_document_by_id

Insert or update a document by its ID. Returns True on success, False on failure.

delete_document_by_id

Delete a document by its ID. Returns True on success, False on failure.

get_schema_for_collection

Get the schema for a collection in the specified scope. Returns a dictionary with the collection name and the schema returned by running INFER query on the Couchbase collection.

run_sql_plus_plus_query

Run a SQL++ query on a scope and return the results as a list of JSON objects.

The query will be run on the specified scope in the specified bucket. The query should use collection names directly without bucket/scope prefixes, as the scope context is automatically set. Example: query = "SELECT * FROM users WHERE age > 18" # Incorrect: "SELECT * FROM bucket.scope.users WHERE age > 18"
get_index_advisor_recommendations

Get index recommendations from Couchbase Index Advisor for a given SQL++ query.

The Index Advisor analyzes the query and provides recommendations for optimal indexes. This tool works with SELECT, UPDATE, DELETE, or MERGE queries. The queries will be run on the specified scope in the specified bucket. Returns a dictionary with: - current_used_indexes: Array of currently used indexes (if any) - recommended_indexes: Array of recommended secondary indexes (if any) - recommended_covering_indexes: Array of recommended covering indexes (if any) Each index object contains: - index: The CREATE INDEX SQL++ command - statements: Array of statement objects with the query and run count
list_indexes

List all indexes in the cluster with optional filtering by bucket, scope, collection, and index name. Returns a list of indexes with their names and CREATE INDEX definitions. Uses the Index Service REST API (/getIndexStatus) to retrieve index information directly.

Args: ctx: MCP context for cluster connection bucket_name: Optional bucket name to filter indexes scope_name: Optional scope name to filter indexes (requires bucket_name) collection_name: Optional collection name to filter indexes (requires bucket_name and scope_name) index_name: Optional index name to filter indexes (requires bucket_name, scope_name, and collection_name) include_raw_index_stats: If True, include raw index stats (as-is from API) in addition to cleaned-up version. Default is False. Returns: List of dictionaries with keys: - name (str): Index name - definition (str): Cleaned-up CREATE INDEX statement - status (str): Current status of the index (e.g., "Ready", "Building", "Deferred") - isPrimary (bool): Whether this is a primary index - bucket (str): Bucket name where the index exists - scope (str): Scope name where the index exists - collection (str): Collection name where the index exists - raw_index_stats (dict, optional): Complete raw index status object from API including metadata, state, keyspace info, etc. (only if include_raw_index_stats=True)
get_cluster_health_and_services

Get cluster health status and list of all running services.

This tool provides health monitoring by: - Getting health status of all running services with latency information (via ping) - Listing all services running on the cluster with their endpoints - Showing connection status and node information for each service If bucket_name is provided, it actively pings services from the perspective of the bucket. Otherwise, it uses cluster-level ping to get the health status of the cluster. Returns: - Cluster health status with service-level connection details and latency measurements
get_queries_not_selective

Get queries that are not very selective from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries where index scans return significantly more documents than the final result
get_queries_not_using_covering_index

Get queries that don't use a covering index from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries that perform index scans but also require fetches (not covering)
get_queries_using_primary_index

Get queries that use a primary index from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries that use primary indexes, ordered by result count
get_queries_with_large_result_count

Get queries with the largest result counts from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries with their average result count
get_queries_with_largest_response_sizes

Get queries with the largest response sizes from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries with their average result size in bytes, KB, and MB
get_longest_running_queries

Get the N longest running queries from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries with their average service time and count
get_most_frequent_queries

Get the N most frequent queries from the system:completed_requests catalog.

Args: limit: Number of queries to return (default: 10) Returns: List of queries with their frequency count

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Couchbase-Ecosystem/mcp-server-couchbase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server