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
34 changes: 34 additions & 0 deletions .ci/integration.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,34 @@ steps:
exit 0
fi

- id: "scylladb"
name: golang:1
waitFor: ["compile-test-binary", "detect-changes"]
entrypoint: /bin/bash
env:
- "GOPATH=/gopath"
- "SERVICE_ACCOUNT_EMAIL=$SERVICE_ACCOUNT_EMAIL"
secretEnv:
["CLIENT_ID", "SCYLLADB_USER", "SCYLLADB_PASS", "SCYLLADB_HOST"]
volumes:
- name: "go"
path: "/gopath"
args:
- -c
- |
PATTERN="scylladb|internal/server/|.ci/"

if grep -qE "$$PATTERN" /workspace/changed_files.txt; then
echo "Changes detected. Running ScyllaDB tests..."
.ci/test_with_coverage.sh \
"ScyllaDB" \
scylladb \
scylladb
else
echo "No relevant changes for ScyllaDB. Skipping shard."
exit 0
fi

- id: "oracle"
name: ghcr.io/oracle/oraclelinux9-instantclient:23
waitFor: ["install-dependencies", "detect-changes"]
Expand Down Expand Up @@ -1546,6 +1574,12 @@ availableSecrets:
env: MARIADB_HOST
- versionName: projects/$PROJECT_ID/secrets/mongodb_uri/versions/latest
env: MONGODB_URI
- versionName: projects/$PROJECT_ID/secrets/scylladb_user/versions/latest
env: SCYLLADB_USER
- versionName: projects/$PROJECT_ID/secrets/scylladb_pass/versions/latest
env: SCYLLADB_PASS
- versionName: projects/$PROJECT_ID/secrets/scylladb_host/versions/latest
env: SCYLLADB_HOST

options:
logging: CLOUD_LOGGING_ONLY
Expand Down
2 changes: 2 additions & 0 deletions cmd/internal/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ import (
_ "github.com/googleapis/mcp-toolbox/internal/tools/postgres/postgresreplicationstats"
_ "github.com/googleapis/mcp-toolbox/internal/tools/postgres/postgressql"
_ "github.com/googleapis/mcp-toolbox/internal/tools/redis"
_ "github.com/googleapis/mcp-toolbox/internal/tools/scylladb/scyllacql"
_ "github.com/googleapis/mcp-toolbox/internal/tools/serverlessspark/serverlesssparkcancelbatch"
_ "github.com/googleapis/mcp-toolbox/internal/tools/serverlessspark/serverlesssparkcreatepysparkbatch"
_ "github.com/googleapis/mcp-toolbox/internal/tools/serverlessspark/serverlesssparkcreatesparkbatch"
Expand Down Expand Up @@ -283,6 +284,7 @@ import (
_ "github.com/googleapis/mcp-toolbox/internal/sources/oracle"
_ "github.com/googleapis/mcp-toolbox/internal/sources/postgres"
_ "github.com/googleapis/mcp-toolbox/internal/sources/redis"
_ "github.com/googleapis/mcp-toolbox/internal/sources/scylladb"
_ "github.com/googleapis/mcp-toolbox/internal/sources/serverlessspark"
_ "github.com/googleapis/mcp-toolbox/internal/sources/singlestore"
_ "github.com/googleapis/mcp-toolbox/internal/sources/snowflake"
Expand Down
4 changes: 4 additions & 0 deletions docs/en/integrations/scylladb/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "ScyllaDB"
weight: 1
---
84 changes: 84 additions & 0 deletions docs/en/integrations/scylladb/source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "ScyllaDB Source"
type: docs
linkTitle: "Source"
weight: 1
description: >
ScyllaDB is a high-performance NoSQL database compatible with Apache Cassandra CQL, offering lower latency and higher throughput through its shard-per-core architecture.
no_list: true
---

## About

[ScyllaDB][scylladb-docs] is a high-performance NoSQL database that is
compatible with Apache Cassandra's CQL protocol. It is designed to provide
predictable performance at scale, optimize cloud infrastructure,
rapidly scale clusters with global replication and high availability,

ScyllaDB supports both self-hosted deployments and [ScyllaDB Cloud][scylladb-cloud],
a fully-managed DBaaS available on AWS and GCP.

[scylladb-docs]: https://docs.scylladb.com/
[scylladb-cloud]: https://cloud.scylladb.com/

## Available Tools

{{< list-tools >}}

## Example

### Self-hosted ScyllaDB

```yaml
kind: source
name: my-scylladb-source
type: scylladb
hosts:
- 127.0.0.1
keyspace: my_keyspace
protoVersion: 4
username: ${USER_NAME}
password: ${PASSWORD}
```

### ScyllaDB Cloud

When connecting to ScyllaDB Cloud, set `localDC` to the datacenter name shown
on the **Connect** tab of your cluster in the [ScyllaDB Cloud Console][scylladb-cloud].
This enables DC-aware token-aware load balancing, which is required for
ScyllaDB Cloud connections.

```yaml
kind: source
name: my-scylladb-cloud-source
type: scylladb
hosts:
- node-0.your-cluster.us-east-1.cloud.scylladb.com
- node-1.your-cluster.us-east-1.cloud.scylladb.com
- node-2.your-cluster.us-east-1.cloud.scylladb.com
keyspace: my_keyspace
username: ${USER_NAME}
password: ${PASSWORD}
localDC: AWS_US_EAST_1
```

{{< notice tip >}}
Use environment variable replacement with the format ${ENV_NAME}
instead of hardcoding your secrets into the configuration file.
{{< /notice >}}

## Reference

| **field** | **type** | **required** | **description** |
|------------------------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| type | string | true | Must be "scylladb". |
| hosts | string[] | true | List of contact point addresses (e.g., ["192.168.1.1:9042", "192.168.1.2:9042"]). The default port is 9042 if not specified. |
| keyspace | string | false | Name of the ScyllaDB keyspace to connect to (e.g., "my_keyspace"). |
| protoVersion | integer | false | CQL native protocol version (e.g., 4). |
| username | string | false | Name of the ScyllaDB user to connect as (e.g., "scylla"). |
| password | string | false | Password of the ScyllaDB user. |
| localDC | string | false | Datacenter name for DC-aware load balancing (e.g., "AWS_US_EAST_1"). Required for ScyllaDB Cloud connections. |
Comment thread
zseta marked this conversation as resolved.
| caPath | string | false | Path to a CA certificate file. Use when connecting to a self-hosted ScyllaDB cluster with a private/custom CA. Not needed for ScyllaDB Cloud. |
| certPath | string | false | Path to the client certificate file for mutual TLS (mTLS). Required only when the server demands client certificate authentication. |
| keyPath | string | false | Path to the client private key file for mutual TLS (mTLS). Required together with `certPath`. |
| enableHostVerification | bool | false | Whether to verify the server's hostname against its TLS certificate. Defaults to `false`. |
4 changes: 4 additions & 0 deletions docs/en/integrations/scylladb/tools/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Tools"
weight: 2
---
95 changes: 95 additions & 0 deletions docs/en/integrations/scylladb/tools/scylladb-cql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: "scylladb-cql"
type: docs
weight: 1
description: >
A "scylladb-cql" tool executes a pre-defined CQL statement against a ScyllaDB
cluster.
---

## About

A `scylladb-cql` tool executes a pre-defined CQL statement against a ScyllaDB
cluster.

The specified CQL statement is executed as a prepared
statement, and expects parameters in the CQL query to be in
the form of placeholders `?`.

## Compatible Sources
Comment thread
zseta marked this conversation as resolved.

{{< compatible-sources >}}

## Example

> **Note:** This tool uses parameterized queries to prevent CQL injections.
> Query parameters can be used as substitutes for arbitrary expressions.
> Parameters cannot be used as substitutes for keyspaces, table names, column
> names, or other parts of the query.

```yaml
kind: tool
name: search_users_by_email
type: scylladb-cql
source: my-scylladb-cluster
statement: |
SELECT user_id, email, first_name, last_name, created_at
FROM users
WHERE email = ?
description: |
Use this tool to retrieve specific user information by their email address.
Takes an email address and returns user details including user ID, email,
first name, last name, and account creation timestamp.
Do NOT use this tool with a user ID or other identifiers.
Example:
{{
"email": "user@example.com",
}}
parameters:
- name: email
type: string
description: User's email address
```

### Example with Template Parameters

> **Note:** This tool allows direct modifications to the CQL statement,
> including keyspaces, table names, and column names. **This makes it more
> vulnerable to CQL injections**. Using basic parameters only (see above) is
> recommended for performance and safety reasons. For more details, please check
> [templateParameters](../../../documentation/configuration/tools/_index.md#template-parameters).

```yaml
kind: tool
name: list_keyspace_table
type: scylladb-cql
source: my-scylladb-cluster
statement: |
SELECT * FROM {{.keyspace}}.{{.tableName}};
description: |
Use this tool to list all information from a specific table in a keyspace.
Example:
{{
"keyspace": "my_keyspace",
"tableName": "users",
}}
templateParameters:
- name: keyspace
type: string
description: Keyspace containing the table
- name: tableName
type: string
description: Table to select from
```

## Reference

| **field** | **type** | **required** | **description** |
|--------------------|:---------------------------------------------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------|
| type | string | true | Must be "scylladb-cql". |
| source | string | true | Name of the source the CQL should execute on. |
| description | string | true | Description of the tool that is passed to the LLM. |
| statement | string | true | CQL statement to execute. |
| authRequired | []string | false | List of authentication requirements for the source. |
| parameters | [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) | false | List of [parameters](../../../documentation/configuration/tools/_index.md#specifying-parameters) that will be inserted into the CQL statement. |
| templateParameters | [templateParameters](../../../documentation/configuration/tools/_index.md#template-parameters) | false | List of [templateParameters](../../../documentation/configuration/tools/_index.md#template-parameters) that will be inserted into the CQL statement before executing prepared statement. |
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ require (
github.com/go-playground/validator/v10 v10.30.2
github.com/go-sql-driver/mysql v1.9.3
github.com/goccy/go-yaml v1.19.2
github.com/gocql/gocql v1.17.3
github.com/godror/godror v0.50.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -78,6 +79,8 @@ require (
modernc.org/sqlite v1.48.2
)

replace github.com/gocql/gocql => github.com/scylladb/gocql v1.17.3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just do import github.com/scylladb/gocql within the packages instead? That way, we won't have to use the replace directive incase it causes a problem to other sources in the future.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuan325 Unfortunately replace is the only way now. In the next major version of the scylla driver it will be fixed. Is this a blocker?


require (
github.com/ClickHouse/ch-go v0.71.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
Expand Down Expand Up @@ -236,6 +239,7 @@ require (
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
github.com/stretchr/testify v1.11.1 // indirect
github.com/testcontainers/testcontainers-go/modules/scylladb v0.42.0 // indirect
github.com/tidwall/gjson v1.17.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scylladb/gocql v1.17.3 h1:dmtjGn9asID97piyuz85PEVHEIHm9H9GyMti1+RMObo=
github.com/scylladb/gocql v1.17.3/go.mod h1:kadKEoGTS/dMUXscNhxR8ORMyx1grygMCNppaacjkh8=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/shirou/gopsutil/v4 v4.26.3 h1:2ESdQt90yU3oXF/CdOlRCJxrP+Am1aBYubTMTfxJ1qc=
Expand Down Expand Up @@ -576,6 +578,8 @@ github.com/testcontainers/testcontainers-go/modules/cockroachdb v0.42.0 h1:TVYrn
github.com/testcontainers/testcontainers-go/modules/cockroachdb v0.42.0/go.mod h1:ZpdnHWcqGnDVm0KM7ugUG0wpYH6Cus07Gncy8qtxzhE=
github.com/testcontainers/testcontainers-go/modules/couchbase v0.42.0 h1:95yS9biTzI8O1KWgLvNQ6dB7WgvZUn14HTKup/5/2Vw=
github.com/testcontainers/testcontainers-go/modules/couchbase v0.42.0/go.mod h1:lAyyMk/tyM6AIKrFQs3lR36/BIf4i0Dr8pqv29G7H9M=
github.com/testcontainers/testcontainers-go/modules/scylladb v0.42.0 h1:LnzRgvhCUYKZJBvQez76+iECSEGCRUeR5eqYzffj+vs=
github.com/testcontainers/testcontainers-go/modules/scylladb v0.42.0/go.mod h1:c0AnMT/U4Ud5ibC5uwufDo4zqAzmj9WfKJxWwBRtVVY=
github.com/thlib/go-timezone-local v0.0.7 h1:fX8zd3aJydqLlTs/TrROrIIdztzsdFV23OzOQx31jII=
github.com/thlib/go-timezone-local v0.0.7/go.mod h1:/Tnicc6m/lsJE0irFMA0LfIwTBo4QP7A8IfyIv4zZKI=
github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U=
Expand Down Expand Up @@ -676,6 +680,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down Expand Up @@ -901,3 +907,5 @@ pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
Loading