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.
Before getting started, ensure you have:
You can install the Couchbase MCP Server in two ways:
The quickest way to get started is using NPX:
npx -y @couchbasedatabase/couchbase-mcp
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
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
{
"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>"
}
}
}
}
{
"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.
query
: Execute N1QL querieslistBuckets
: List available bucketscreateScope
: Create a new scope in a bucketdeleteScope
: Delete an existing scopelistScopes
: List all scopes in a bucketcreateCollection
: Create a new collection in a scopedropCollection
: Delete a collection from a scopecreateDocument
: Create a new documentgetDocument
: Retrieve a document by IDupdateDocument
: Update an existing documentdeleteDocument
: Delete a document by IDbulkCreateDocuments
: Create multiple documents at oncecreateIndex
: Create a new index on specified fieldscreatePrimaryIndex
: Create a primary index on a collectionlistIndexes
: List all indexes in a bucketdropIndex
: Drop an existing indexEach tool supports optional collection
and scope
parameters for targeting specific data containers.
Here are some examples of how to interact with the database through Claude:
List all buckets:
Could you show me all available buckets in the database?
Create a scope and collection:
Create a new scope called "users" and a collection called "profiles" in it
Query documents:
Find all users who signed up in the last 30 days
Create a document:
Create a new user document with name "John Doe" and email "[email protected]"
When using the Couchbase MCP Server, keep these security practices in mind:
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.
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"
]
}
}
}
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.
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.