Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ wheels/
*.egg-info

# Virtual environments
.venv
.venv*
# Environment variables
.env
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ An [MCP](https://modelcontextprotocol.io/) server implementation of Couchbase th

- Get a list of all the scopes and collections in the specified bucket
- Get the structure for a collection
- Get a document by ID from a specified scope and collection
- Upsert a document by ID to a specified scope and collection
- Delete a document by ID from a specified scope and collection
- Run a [SQL++ query](https://www.couchbase.com/sqlplusplus/) on a specified scope
- Get a document by ID from a specified bucket, scope and collection
- Upsert a document by ID to a specified bucket, scope and collection
- Delete a document by ID from a specified bucket, scope and collection
- Run a [SQL++ query](https://www.couchbase.com/sqlplusplus/) on a specified bucket and scope
- There is an option in the MCP server, `READ_ONLY_QUERY_MODE` that is set to true by default to disable running SQL++ queries that change the data or the underlying collection structure. Note that the documents can still be updated by ID.
- Retrieve Index Advisor advice for a query on a specified bucket and scope.
- Retrieve cluster node services and health status.
- Retrieve /metrics endpoint data by hostname.

## Prerequisites

Expand Down Expand Up @@ -46,7 +49,6 @@ This is the common configuration for the MCP clients such as Claude Desktop, Cur
"CB_CONNECTION_STRING": "couchbases://connection-string",
"CB_USERNAME": "username",
"CB_PASSWORD": "password",
"CB_BUCKET_NAME": "bucket_name"
}
}
}
Expand All @@ -56,9 +58,9 @@ This is the common configuration for the MCP clients such as Claude Desktop, Cur
The server can be configured using environment variables. The following variables are supported:

- `CB_CONNECTION_STRING`: The connection string to the Couchbase cluster
- `CA_CERT_PATH`: The path to the Server CA certificate, required for server API calls in tls mode
- `CB_USERNAME`: The username with access to the bucket to use to connect
- `CB_PASSWORD`: The password for the username to connect
- `CB_BUCKET_NAME`: The name of the bucket that the server will access
- `READ_ONLY_QUERY_MODE`: Setting to configure whether SQL++ queries that allow data to be modified are allowed. It is set to True by default.
- `path/to/cloned/repo/mcp-server-couchbase/` should be the path to the cloned repository on your local machine. Don't forget the trailing slash at the end!

Expand Down Expand Up @@ -138,7 +140,7 @@ There is an option to run the MCP server in [Server-Sent Events (SSE)](https://m

By default, the MCP server will run on port 8080 but this can be configured using the `FASTMCP_PORT` environment variable.

> uv run src/mcp_server.py --connection-string='<couchbase_connection_string>' --username='<database_username>' --password='<database_password>' --bucket-name='<couchbase_bucket_to_use>' --read-only-query-mode=true --transport=sse
> uv run src/mcp_server.py --connection-string='<couchbase_connection_string>' --username='<database_username>' --password='<database_password>' --read-only-query-mode=true --transport=sse

The server will be available on http://localhost:8080/sse. This can be used in MCP clients supporting SSE transport mode.

Expand All @@ -159,7 +161,6 @@ docker run -i \
-e CB_CONNECTION_STRING='<couchbase_connection_string>' \
-e CB_USERNAME='<database_user>' \
-e CB_PASSWORD='<database_password>' \
-e CB_BUCKET_NAME='<bucket_name>' \
-e MCP_TRANSPORT='stdio/sse' \
-e READ_ONLY_QUERY_MODE="true/false" \
mcp/couchbase
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies = [
"couchbase==4.4.0",
"lark-sqlpp==0.0.1",
"mcp[cli]==1.6.0",
"requests==2.32.4"
]

[project.urls]
Expand Down
Loading