Skip to main content
Glama
nethanchowdary

Couchbase MCP Server

Couchbase MCP Server

Model Context Protocol (MCP) server that connects AI assistants and agents to Couchbase — locally or over SSH tunnels to remote clusters.

Features

Safety

  • Read-only mode (default): Blocks write operations during exploration

  • Write confirmation: Destructive tools require explicit approval

  • Tool disabling: Turn off specific tools via CB_DISABLED_TOOLS

Performance

  • HTTP wrapper: Management and query APIs with SDK fallback

  • Large result handling: Truncation and export for oversized documents and query results

  • WAN development profile: Tuned for tunneled / remote clusters

Tools (24)

Category

Tools

Cluster

connection test, config status, buckets, scopes, collections, health

KV

get, lookup-in, upsert, insert, replace, delete

Query

N1QL, cluster queries, schema inference, slow/frequent/large query analysis

Index

list indexes, advisor recommendations

Related MCP server: CockroachDB MCP Server

Prerequisites

  • Python 3.10+

  • Couchbase Server 7.0+ (local or remote)

  • jq for environment switching

  • SSH key for tunneled environments

  • An MCP client (e.g. Claude Code, Cursor)

Quick start

git clone https://github.com/nethanchowdary/couchbase-mcp-server.git
cd couchbase-mcp-server

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env
# Edit .env with your Couchbase connection details

Register with Claude Code

claude mcp add couchbase -s user \
  -e "COUCHBASE_SERVER_DIR=$(pwd)" \
  -- python -m couchbase_mcp_server.server

Restart the MCP server after config changes:

claude mcp restart couchbase

Register with Cursor

Add to your MCP config (Settings → MCP):

{
  "mcpServers": {
    "couchbase": {
      "command": "/path/to/couchbase-mcp-server/.venv/bin/python",
      "args": ["-m", "couchbase_mcp_server.server"],
      "env": {
        "COUCHBASE_SERVER_DIR": "/path/to/couchbase-mcp-server"
      }
    }
  }
}

Environment switching

Use ./switch.sh to move between local Couchbase, SSH-tunneled clusters, and direct remote hosts without hand-editing .env.

./switch.sh list              # Show environments from environments.json
./switch.sh local             # Local Couchbase
./switch.sh remote-tunnel     # Remote via SSH tunnel (example config)
./switch.sh status            # Current env + tunnel state

On first switch to an environment you will be prompted for:

  • Couchbase username and password (cached in ~/.couchbase-mcp/credentials.json, mode 600)

  • SSH username (tunnel environments only)

Then choose read-only mode and optional tool disables. Restart MCP after switching:

claude mcp restart couchbase

Configure environments

environments.json — committed example configs (local, remote-tunnel, remote-multinode, remote-direct). Edit hostnames and tunnel targets for your setup.

environments.local.json — optional, gitignored. Copy from environments.local.json.example for private clusters you do not want in git. Entries are merged on top of environments.json.

cp environments.local.json.example environments.local.json
# Edit with your real bastion hosts and node addresses

Credential management

./switch.sh credentials list
./switch.sh credentials clear remote-tunnel
./switch.sh credentials clear-all

Configuration reference

Variable

Required

Description

CB_CONNECTION_STRING

Yes

e.g. couchbase://localhost

CB_USERNAME

Yes

Couchbase user

CB_PASSWORD

Yes

Couchbase password

CB_READ_ONLY_MODE

No

Default true

CB_DISABLED_TOOLS

No

Comma-separated tool names

CB_TIMEOUT_SECONDS

No

Connection timeout

CB_CA_CERT_PATH

No

TLS CA cert

CB_CLIENT_CERT_PATH

No

mTLS client cert

CB_CLIENT_KEY_PATH

No

mTLS client key

LOG_LEVEL

No

Default INFO

COUCHBASE_SERVER_DIR

No

Project root for .env discovery

See .env.example for the full list.

SSH tunnels

tunnel-manager.sh handles single-node and multi-node tunnels. Multi-node setups may require localhost aliases on macOS:

sudo ifconfig lo0 alias 127.0.0.2 up

Test tunnel connectivity:

./switch.sh remote-tunnel --test
curl -u user:pass http://127.0.0.1:8091/pools/default

Development

source .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check src tests

Or use the wrapper:

./run_mcp_server.sh

Security notes for public repos

  • Never commit .env, environments.local.json, or credential files

  • Rotate any Couchbase or SSH credentials that were ever committed or shared

  • VITE_*-style exposure does not apply here (server-side env), but .env is still regenerated by switch.sh with passwords — keep it gitignored

  • Use read-only Couchbase users when exploring production-like data

Project layout

src/couchbase_mcp_server/   # MCP server and tools
lib/credentials.sh          # Credential cache helpers
switch.sh                   # Environment switcher
tunnel-manager.sh           # SSH tunnel lifecycle
environments.json           # Example environment definitions
tests/

License

MIT (add a LICENSE file if you publish publicly).

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol server that enables large language models to interact directly with Couchbase databases through natural language, supporting operations like querying buckets, performing CRUD operations, and executing N1QL queries.
    Last updated
    8
    7
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to query and interact with CockroachDB clusters through natural language, supporting schema discovery, CRUD operations, transactions, cluster monitoring, and data export with configurable safety controls.
    Last updated
    30
    Apache 2.0
  • A
    license
    -
    quality
    A
    maintenance
    Connects AI assistants to CrateDB clusters to enable natural-language Text-to-SQL, data analysis, and documentation retrieval. It allows users to manage database operations, troubleshoot cluster issues, and query information through conversational prompts.
    Last updated
    7
    Apache 2.0
  • A
    license
    -
    quality
    D
    maintenance
    Enables AI assistants to interact with and manage multiple database types (PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, Redis) through natural language, supporting query analysis, schema management, data analysis, backup/restore, and security analysis.
    Last updated
    64
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

View all MCP Connectors

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/nethanchowdary/couchbase-mcp-server'

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