Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "mysql",
"owner": {
"name": "Google LLC",
"email": "data-cloud-ai-integrations@google.com"
},
"metadata": {
"description": "Connect and interact with a MySQL database and data."
},
"plugins": [
{
"name": "mysql",
"source": "./"
}
]
}
62 changes: 62 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "mysql",
"version": "0.1.5",
"description": "Connect and interact with a MySQL database and data",
"author": {
"name": "Google LLC",
"email": "data-cloud-ai-integrations@google.com"
},
"repository": "https://github.com/gemini-cli-extensions/mysql",
"license": "Apache-2.0",
"userConfig": {
"mysql_host": {
"title": "Host",
"description": "Host or IP address of the MySQL server",
"type": "string",
"sensitive": false
},
"mysql_port": {
"title": "Port",
"description": "Port number of the MySQL server",
"type": "string",
"sensitive": false
},
"mysql_database": {
"title": "Database",
"description": "Name of the database",
"type": "string",
"sensitive": false
},
"mysql_user": {
"title": "User",
"description": "Username of the database user",
"type": "string",
"sensitive": false
},
"mysql_password": {
"title": "Password",
"description": "Password of the database user",
"type": "string",
"sensitive": true
}
},
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@toolbox-sdk/server@1.8.0",
"--prebuilt",
"mysql",
"--stdio"
],
"env": {
"MYSQL_HOST": "${user_config.mysql_host}",
"MYSQL_PORT": "${user_config.mysql_port}",
"MYSQL_DATABASE": "${user_config.mysql_database}",
"MYSQL_USER": "${user_config.mysql_user}",
"MYSQL_PASSWORD": "${user_config.mysql_password}"
}
}
}
}
21 changes: 21 additions & 0 deletions .codex-plugin/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@toolbox-sdk/server@1.8.0",
"--prebuilt",
"mysql",
"--stdio"
],
"env_vars": [
"MYSQL_HOST",
"MYSQL_PORT",
"MYSQL_DATABASE",
"MYSQL_USER",
"MYSQL_PASSWORD"
]
}
}
}
12 changes: 12 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "mysql",
"version": "0.1.5",
"description": "Connect and interact with a MySQL database and data",
"author": {
"name": "Google LLC",
"email": "data-cloud-ai-integrations@google.com"
},
"repository": "https://github.com/gemini-cli-extensions/mysql",
"license": "Apache-2.0",
"mcpServers": "./.codex-plugin/.mcp.json"
}
55 changes: 37 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ This Gemini CLI extension provides a set of tools to interact with [MySQL](https

Before you begin, ensure you have the following:

* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed with version **+v0.6.0**.
* Setup Gemini CLI [Authentication](https://github.com/google-gemini/gemini-cli/tree/main?tab=readme-ov-file#-authentication-options).
* One of the supported agent harnesses, installed and authenticated:
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) (v0.6.0+)
* [Claude Code](https://code.claude.com)
* [Codex](https://developers.openai.com/codex)
* [Antigravity CLI](https://antigravity.google)
* [Node.js](https://nodejs.org/) (the MCP server runs via `npx`).
* A running MySQL instance.
* A user with database-level permissions to execute queries.
Expand All @@ -32,39 +35,55 @@ Before you begin, ensure you have the following:

### Installation

To install the extension, use the command:
All harnesses use the same plugin; the MCP server runs via `npx` (no binary to download). Install with your harness of choice:

**Gemini CLI**

```bash
gemini extensions install https://github.com/gemini-cli-extensions/mysql
```

**Claude Code**

```bash
claude plugin marketplace add gemini-cli-extensions/mysql
claude plugin install mysql@mysql
```

**Codex**

```bash
codex plugin marketplace add gemini-cli-extensions/mysql
codex plugin add mysql@mysql
```

**Antigravity**

```bash
agy plugin install https://github.com/gemini-cli-extensions/mysql
```

See [Configuration](#configuration) for how each harness supplies the connection settings.

### Configuration

You will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory.
The plugin connects to MySQL using these settings:

* `MYSQL_HOST`: (Optional) The MySQL host. Defaults to `localhost`.
* `MYSQL_PORT`: (Optional) The MySQL port. Defaults to `3306`.
* `MYSQL_DATABASE`: The name of the database to connect to.
* `MYSQL_USER`: The database username.
* `MYSQL_PASSWORD`: The password for the database user.

To view or update your configuration:

**List Settings:**
* Terminal: `gemini extensions list`
* Gemini CLI: `/extensions list`

**Update Settings:**
* Terminal: `gemini extensions config mysql [setting name] [--scope <scope>]`
* `setting name`: (Optional) The single setting to configure.
* `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.
* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.
How you supply them depends on the harness:

Alternatively, you can manually set these environment variables before starting the Gemini CLI:
* **Gemini CLI**: prompted on install and saved to the extension's `.env`. View or update later with `gemini extensions list` / `gemini extensions config mysql [setting] [--scope user|workspace]` (restart the CLI to apply).
* **Claude Code**: pass `--config KEY=VALUE` on install (repeatable), or run `/plugin` inside Claude Code.
* **Codex** and **Antigravity**: export the variables in your shell before starting:

```bash
export MYSQL_HOST="<your-mysql-host>" # Optional: defaults to localhost
export MYSQL_PORT="<your-mysql-port>" # Optional: defaults to 3306
export MYSQL_HOST="<your-mysql-host>" # Optional, defaults to localhost
export MYSQL_PORT="<your-mysql-port>" # Optional, defaults to 3306
export MYSQL_DATABASE="<your-database-name>"
export MYSQL_USER="<your-database-user>"
export MYSQL_PASSWORD="<your-database-password>"
Expand Down
16 changes: 16 additions & 0 deletions mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
"mcpServers": {
"mysql": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@toolbox-sdk/server@1.8.0",
"--prebuilt",
"mysql",
"--stdio"
]
}
}
}
14 changes: 14 additions & 0 deletions mcp_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@toolbox-sdk/server@1.8.0",
"--prebuilt",
"mysql",
"--stdio"
]
}
}
}
47 changes: 47 additions & 0 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "mysql",
"version": "0.1.5",
"description": "Connect and interact with a MySQL database and data",
"author": {
"name": "Google LLC",
"email": "data-cloud-ai-integrations@google.com"
},
"repository": "https://github.com/gemini-cli-extensions/mysql",
"license": "Apache-2.0",
"extensions": {
"com.google.cloud.data.agent-plugins": {
"config": [
{
"key": "MYSQL_HOST",
"title": "Host",
"description": "Host or IP address of the MySQL server"
},
{
"key": "MYSQL_PORT",
"title": "Port",
"description": "Port number of the MySQL server"
},
{
"key": "MYSQL_DATABASE",
"title": "Database",
"description": "Name of the database"
},
{
"key": "MYSQL_USER",
"title": "User",
"description": "Username of the database user"
},
{
"key": "MYSQL_PASSWORD",
"title": "Password",
"description": "Password of the database user",
"sensitive": true
}
],
"gemini": {
"contextFileName": "MYSQL.md",
"mcpServerName": "mysql"
}
}
}
}
Loading