Skip to content

Commit c96906d

Browse files
committed
chore: Add initial docs
0 parents  commit c96906d

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

CLOUD-SQL-SQLSERVER.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Cloud SQL for SQL Server Extension
2+
3+
This document provides instructions for the Gemini agent to assist users with the Cloud SQL for SQL Server extension.
4+
5+
## Cloud SQL for SQL Server MCP Server (Data Plane: Connecting and Querying)
6+
7+
This section covers connecting to a Cloud SQL for SQL Server instance.
8+
9+
1. **Verify Environment Variables**: Before attempting to connect, confirm with the user that the following environment variables are set in the extension configuration or their shell environment.
10+
11+
* `CLOUD_SQL_MSSQL_PROJECT`: The GCP project ID.
12+
* `CLOUD_SQL_MSSQL_REGION`: The region of your Cloud SQL instance.
13+
* `CLOUD_SQL_MSSQL_INSTANCE`: The ID of your Cloud SQL instance.
14+
* `CLOUD_SQL_MSSQL_DATABASE`: The name of the database to connect to.
15+
* `CLOUD_SQL_MSSQL_IP_ADDRESS`: The IP address of the Cloud SQL instance.
16+
* `CLOUD_SQL_MSSQL_USER`: The database username.
17+
* `CLOUD_SQL_MSSQL_PASSWORD`: The password for the database user.
18+
19+
2. **Handle Missing Variables**: If a command fails with an error message containing a placeholder like `${CLOUD_SQL_MSSQL_PROJECT}`, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it.
20+
21+
3. **Handle Permission Errors**: If you encounter permission errors, ensure the user has the **Cloud SQL Client** (`roles/cloudsql.client`) role and the correct database-level permissions.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Gemini CLI Extension - Cloud SQL for SQL Server
2+
3+
This Gemini CLI extension provides a set of tools to interact with [Cloud SQL for SQL Server](https://cloud.google.com/sql/docs/sqlserver) instances. It allows you to manage your databases, execute queries, and explore schemas directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts.
4+
5+
## Features
6+
7+
* **Integrated with Gemini CLI:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment, making security an accessible part of your workflow.
8+
* **Connect to Cloud SQL for SQL Server:** Securely connect to your Cloud SQL for SQL Server instances.
9+
* **Explore Database Schema:** List databases, tables, views, and schemas.
10+
* **Query your Database:** Execute SQL queries against your database.
11+
12+
## Supported Tools
13+
14+
* `list_tables`
15+
* `execute_sql`
16+
17+
## Prerequisites
18+
19+
Before you begin, ensure you have the following:
20+
21+
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed.
22+
* A Google Cloud project with the **Cloud SQL Admin API** enabled.
23+
* IAM Permissions
24+
25+
## Installation
26+
27+
To install the extension, use the `gemini extensions install` command:
28+
29+
```bash
30+
gemini extensions install github.com/gemini-cli-extensions/cloud-sql-sqlserver.git
31+
```
32+
33+
## Configuration
34+
35+
* `CLOUD_SQL_MSSQL_PROJECT`: The GCP project ID.
36+
* `CLOUD_SQL_MSSQL_REGION`: The region of your Cloud SQL instance.
37+
* `CLOUD_SQL_MSSQL_INSTANCE`: The ID of your Cloud SQL instance.
38+
* `CLOUD_SQL_MSSQL_DATABASE`: The name of the database to connect to.
39+
* `CLOUD_SQL_MSSQL_IP_ADDRESS`: The IP address of the Cloud SQL instance.
40+
* `CLOUD_SQL_MSSQL_USER`: The database username.
41+
* `CLOUD_SQL_MSSQL_PASSWORD`: The password for the database user.
42+
43+
## Usage
44+
45+
* Provision Infrastructure
46+
* Explore Schemas and Data
47+
* Generate code
48+
49+
## Security
50+
51+
This extension executes commands against your Cloud SQL for SQL Server database. Always review the generated SQL queries before execution, especially for write operations.
52+
53+
## Disclaimer
54+
55+
This is not an officially supported Google product. This extension is under active development, and breaking changes may be introduced.

gemini-extension.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Cloud SQL for SQL Server",
3+
"version": "0.1.0",
4+
"description": "Connect to Cloud SQL for SQL Server",
5+
"mcpServers": {
6+
"Cloud SQL for SQL Server": {
7+
"command": "${extensionPath}${/}toolbox",
8+
"args": [
9+
"--prebuilt",
10+
"cloud-sql-mssql",
11+
"--stdio"
12+
],
13+
"env": {
14+
"CLOUD_SQL_SQLSERVER_PROJECT": "${CLOUD_SQL_SQLSERVER_PROJECT}",
15+
"CLOUD_SQL_SQLSERVER_REGION": "${CLOUD_SQL_SQLSERVER_REGION}",
16+
"CLOUD_SQL_SQLSERVER_INSTANCE": "${CLOUD_SQL_SQLSERVER_INSTANCE}",
17+
"CLOUD_SQL_SQLSERVER_DATABASE": "${CLOUD_SQL_SQLSERVER_DATABASE}",
18+
"CLOUD_SQL_SQLSERVER_USER": "${CLOUD_SQL_SQLSERVER_USER}",
19+
"CLOUD_SQL_SQLSERVER_PASSWORD": "${CLOUD_SQL_SQLSERVER_PASSWORD}"
20+
}
21+
}
22+
},
23+
"contextFileName": "CLOUD-SQL-SQLSERVER.md"
24+
}

0 commit comments

Comments
 (0)