Couchbase MCP server

Interact directly with Couchbase databases on Capella clusters. Query buckets, perform CRUD operations, execute N1QL queries, and manage data seamlessly through natural language.
Back to servers
Provider
Aniket Purkayastha
Release date
Mar 29, 2025
Language
TypeScript
Stats
7 stars

The Couchbase MCP Server enables LLMs to interact directly with Couchbase databases on Capella clusters. Through natural language, you can query buckets, perform CRUD operations, execute N1QL queries, and manage data seamlessly, bridging the gap between conversational AI and database management.

Prerequisites

Before getting started, ensure you have:

  • Node.js 16 or higher
  • A running Couchbase instance on Capella
  • Claude Desktop application

Installation

You can install the Couchbase MCP Server in two ways:

Using NPX (Recommended)

The quickest way to get started is using NPX:

npx -y @couchbasedatabase/couchbase-mcp

Manual Installation

If you prefer to install manually:

# Clone the repository
git clone https://github.com/Aniket310101/MCP-Server-Couchbase.git
cd MCP-Server-Couchbase

# Install dependencies
npm install

# Build the project
npm run build

Claude Desktop Integration

To integrate with Claude Desktop, add configuration to your Claude Desktop config file:

Windows: %APPDATA%/Claude/claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Configuration with Package Installation

{
  "mcpServers": {
    "couchbase": {
      "command": "npx",
      "args": ["-y", "@couchbasedatabase/couchbase-mcp"],
      "env": {
        "COUCHBASE_URL": "<COUCHBASE CONNECTION STRING>",
        "COUCHBASE_BUCKET": "<BUCKET NAME>",
        "COUCHBASE_USERNAME": "<COUCHBASE USERNAME>",
        "COUCHBASE_PASSWORD": "<COUCHBASE PASSWORD>"
      }
    }
  }
}

Configuration with Manual Installation

{
  "mcpServers": {
    "couchbase": {
      "command": "node",
      "args": ["path/to/MCP-Server-Couchbase/dist/index.js"],
      "env": {
        "COUCHBASE_URL": "<COUCHBASE CONNECTION STRING>",
        "COUCHBASE_BUCKET": "<BUCKET NAME>",
        "COUCHBASE_USERNAME": "<COUCHBASE USERNAME>",
        "COUCHBASE_PASSWORD": "<COUCHBASE PASSWORD>"
      }
    }
  }
}

After configuration, restart Claude Desktop. The Couchbase MCP server tools should now be available in your conversations.

Available Tools

Basic Operations

  • query: Execute N1QL queries
  • listBuckets: List available buckets

Scope Management

  • createScope: Create a new scope in a bucket
  • deleteScope: Delete an existing scope
  • listScopes: List all scopes in a bucket

Collection Management

  • createCollection: Create a new collection in a scope
  • dropCollection: Delete a collection from a scope

Document Operations

  • createDocument: Create a new document
  • getDocument: Retrieve a document by ID
  • updateDocument: Update an existing document
  • deleteDocument: Delete a document by ID
  • bulkCreateDocuments: Create multiple documents at once

Index Management

  • createIndex: Create a new index on specified fields
  • createPrimaryIndex: Create a primary index on a collection
  • listIndexes: List all indexes in a bucket
  • dropIndex: Drop an existing index

Each tool supports optional collection and scope parameters for targeting specific data containers.

Usage Examples

Here are some examples of how to interact with the database through Claude:

  1. List all buckets:

    Could you show me all available buckets in the database?
    
  2. Create a scope and collection:

    Create a new scope called "users" and a collection called "profiles" in it
    
  3. Query documents:

    Find all users who signed up in the last 30 days
    
  4. Create a document:

    Create a new user document with name "John Doe" and email "[email protected]"
    

Security Considerations

When using the Couchbase MCP Server, keep these security practices in mind:

  • Always use environment variables for sensitive credentials
  • Consider running the server behind a reverse proxy for production use
  • Implement appropriate access controls and authentication as needed

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later