Skip to content

Commit 2a4523f

Browse files
authored
feat: adopt Agent Plugin spec and generate harness manifests (#105)
1 parent 05b0618 commit 2a4523f

9 files changed

Lines changed: 253 additions & 30 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "postgres",
3+
"owner": {
4+
"name": "Google LLC",
5+
"email": "data-cloud-ai-integrations@google.com"
6+
},
7+
"metadata": {
8+
"description": "Connect and interact with a PostgreSQL database and data."
9+
},
10+
"plugins": [
11+
{
12+
"name": "postgres",
13+
"source": "./"
14+
}
15+
]
16+
}

.claude-plugin/plugin.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "postgres",
3+
"version": "0.2.2",
4+
"description": "Connect and interact with a PostgreSQL database and data",
5+
"author": {
6+
"name": "Google LLC",
7+
"email": "data-cloud-ai-integrations@google.com"
8+
},
9+
"repository": "https://github.com/gemini-cli-extensions/postgres",
10+
"license": "Apache-2.0",
11+
"userConfig": {
12+
"postgres_database": {
13+
"title": "Database",
14+
"description": "Name of the database",
15+
"type": "string",
16+
"sensitive": false
17+
},
18+
"postgres_user": {
19+
"title": "User",
20+
"description": "Username of the database user",
21+
"type": "string",
22+
"sensitive": false
23+
},
24+
"postgres_password": {
25+
"title": "Password",
26+
"description": "Password of the database user",
27+
"type": "string",
28+
"sensitive": true
29+
},
30+
"postgres_host": {
31+
"title": "Host",
32+
"description": "Host or IP address of the PostgreSQL server",
33+
"type": "string",
34+
"sensitive": false
35+
},
36+
"postgres_port": {
37+
"title": "Port",
38+
"description": "Port number of the PostgreSQL server",
39+
"type": "string",
40+
"sensitive": false
41+
},
42+
"postgres_query_params": {
43+
"title": "Query Params",
44+
"description": "(Optional) Connection String Parameters",
45+
"type": "string",
46+
"sensitive": false
47+
}
48+
},
49+
"mcpServers": {
50+
"postgresql": {
51+
"command": "npx",
52+
"args": [
53+
"-y",
54+
"@toolbox-sdk/server@1.8.0",
55+
"--prebuilt",
56+
"postgres",
57+
"--stdio"
58+
],
59+
"env": {
60+
"POSTGRES_DATABASE": "${user_config.postgres_database}",
61+
"POSTGRES_USER": "${user_config.postgres_user}",
62+
"POSTGRES_PASSWORD": "${user_config.postgres_password}",
63+
"POSTGRES_HOST": "${user_config.postgres_host}",
64+
"POSTGRES_PORT": "${user_config.postgres_port}",
65+
"POSTGRES_QUERY_PARAMS": "${user_config.postgres_query_params}"
66+
}
67+
}
68+
}
69+
}

.codex-plugin/.mcp.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"mcpServers": {
3+
"postgresql": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"@toolbox-sdk/server@1.8.0",
8+
"--prebuilt",
9+
"postgres",
10+
"--stdio"
11+
],
12+
"env_vars": [
13+
"POSTGRES_DATABASE",
14+
"POSTGRES_USER",
15+
"POSTGRES_PASSWORD",
16+
"POSTGRES_HOST",
17+
"POSTGRES_PORT",
18+
"POSTGRES_QUERY_PARAMS"
19+
]
20+
}
21+
}
22+
}

.codex-plugin/plugin.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "postgres",
3+
"version": "0.2.2",
4+
"description": "Connect and interact with a PostgreSQL database and data",
5+
"author": {
6+
"name": "Google LLC",
7+
"email": "data-cloud-ai-integrations@google.com"
8+
},
9+
"repository": "https://github.com/gemini-cli-extensions/postgres",
10+
"license": "Apache-2.0",
11+
"mcpServers": "./.codex-plugin/.mcp.json"
12+
}

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,51 +24,73 @@ Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini
2424

2525
Before you begin, ensure you have the following:
2626

27-
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed with version **+v0.6.0**.
28-
* Setup Gemini CLI [Authentication](https://github.com/google-gemini/gemini-cli/tree/main?tab=readme-ov-file#-authentication-options).
27+
* One of the supported agent harnesses, installed and authenticated:
28+
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) (v0.6.0+)
29+
* [Claude Code](https://code.claude.com)
30+
* [Codex](https://developers.openai.com/codex)
31+
* [Antigravity CLI](https://antigravity.google)
32+
* [Node.js](https://nodejs.org/) (the MCP server runs via `npx`).
2933
* A running PostgreSQL instance.
3034
* Users are granted database-level permissions to execute queries.
3135

3236
## Getting Started
3337

3438
### Installation
3539

36-
To install the extension, use the command:
40+
All harnesses use the same plugin; the MCP server runs via `npx` (no binary to download). Install with your harness of choice:
41+
42+
**Gemini CLI**
3743

3844
```bash
3945
gemini extensions install https://github.com/gemini-cli-extensions/postgres
4046
```
4147

48+
**Claude Code**
49+
50+
```bash
51+
claude plugin marketplace add gemini-cli-extensions/postgres
52+
claude plugin install postgres@postgres
53+
```
54+
55+
**Codex**
56+
57+
```bash
58+
codex plugin marketplace add gemini-cli-extensions/postgres
59+
codex plugin add postgres@postgres
60+
```
61+
62+
**Antigravity**
63+
64+
```bash
65+
agy plugin install https://github.com/gemini-cli-extensions/postgres
66+
```
67+
68+
See [Configuration](#configuration) for how each harness supplies the connection settings.
69+
4270
### Configuration
4371

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

46-
* `POSTGRES_HOST`: (Optional) The Postgres host. Defaults to `localhost`.
47-
* `POSTGRES_PORT`: (Optional) The Postgres port. Defaults to `5432`.
4874
* `POSTGRES_DATABASE`: The name of the database to connect to.
4975
* `POSTGRES_USER`: The database username.
5076
* `POSTGRES_PASSWORD`: The password for the database user.
77+
* `POSTGRES_HOST`: (Optional) The Postgres host. Defaults to `localhost`.
78+
* `POSTGRES_PORT`: (Optional) The Postgres port. Defaults to `5432`.
79+
* `POSTGRES_QUERY_PARAMS`: (Optional) Connection string parameters.
5180

52-
To view or update your configuration:
53-
54-
**List Settings:**
55-
* Terminal: `gemini extensions list`
56-
* Gemini CLI: `/extensions list`
57-
58-
**Update Settings:**
59-
* Terminal: `gemini extensions config postgres [setting name] [--scope <scope>]`
60-
* `setting name`: (Optional) The single setting to configure.
61-
* `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.
62-
* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.
81+
How you supply them depends on the harness:
6382

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

6687
```bash
67-
export POSTGRES_HOST="<your-postgres-host>" # Optional: defaults to localhost
68-
export POSTGRES_PORT="<your-postgres-port>" # Optional: defaults to 5432
6988
export POSTGRES_DATABASE="<your-database-name>"
7089
export POSTGRES_USER="<your-database-user>"
7190
export POSTGRES_PASSWORD="<your-database-password>"
91+
export POSTGRES_HOST="<your-postgres-host>" # Optional, defaults to localhost
92+
export POSTGRES_PORT="<your-postgres-port>" # Optional, defaults to 5432
93+
export POSTGRES_QUERY_PARAMS="<your-connection-string-params>" # Optional
7294
```
7395

7496
> [!NOTE]

gemini-extension.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
},
1717
"contextFileName": "POSTGRESQL.md",
1818
"settings": [
19-
{
20-
"name": "Host",
21-
"description": "Host or IP address of the PostgreSQL server",
22-
"envVar": "POSTGRES_HOST"
23-
},
24-
{
25-
"name": "Port",
26-
"description": "Port number of the PostgreSQL server",
27-
"envVar": "POSTGRES_PORT"
28-
},
2919
{
3020
"name": "Database",
3121
"description": "Name of the database",
@@ -41,6 +31,16 @@
4131
"description": "Password of the database user",
4232
"envVar": "POSTGRES_PASSWORD"
4333
},
34+
{
35+
"name": "Host",
36+
"description": "Host or IP address of the PostgreSQL server",
37+
"envVar": "POSTGRES_HOST"
38+
},
39+
{
40+
"name": "Port",
41+
"description": "Port number of the PostgreSQL server",
42+
"envVar": "POSTGRES_PORT"
43+
},
4444
{
4545
"name": "Query Params",
4646
"description": "(Optional) Connection String Parameters",

mcp.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3+
"mcpServers": {
4+
"postgresql": {
5+
"type": "stdio",
6+
"command": "npx",
7+
"args": [
8+
"-y",
9+
"@toolbox-sdk/server@1.8.0",
10+
"--prebuilt",
11+
"postgres",
12+
"--stdio"
13+
]
14+
}
15+
}
16+
}

mcp_config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"mcpServers": {
3+
"postgresql": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"@toolbox-sdk/server@1.8.0",
8+
"--prebuilt",
9+
"postgres",
10+
"--stdio"
11+
]
12+
}
13+
}
14+
}

plugin.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "postgres",
3+
"version": "0.2.2",
4+
"description": "Connect and interact with a PostgreSQL database and data",
5+
"author": {
6+
"name": "Google LLC",
7+
"email": "data-cloud-ai-integrations@google.com"
8+
},
9+
"repository": "https://github.com/gemini-cli-extensions/postgres",
10+
"license": "Apache-2.0",
11+
"extensions": {
12+
"com.google.cloud.data.agent-plugins": {
13+
"config": [
14+
{
15+
"key": "POSTGRES_DATABASE",
16+
"title": "Database",
17+
"description": "Name of the database"
18+
},
19+
{
20+
"key": "POSTGRES_USER",
21+
"title": "User",
22+
"description": "Username of the database user"
23+
},
24+
{
25+
"key": "POSTGRES_PASSWORD",
26+
"title": "Password",
27+
"description": "Password of the database user",
28+
"sensitive": true
29+
},
30+
{
31+
"key": "POSTGRES_HOST",
32+
"title": "Host",
33+
"description": "Host or IP address of the PostgreSQL server"
34+
},
35+
{
36+
"key": "POSTGRES_PORT",
37+
"title": "Port",
38+
"description": "Port number of the PostgreSQL server"
39+
},
40+
{
41+
"key": "POSTGRES_QUERY_PARAMS",
42+
"title": "Query Params",
43+
"description": "(Optional) Connection String Parameters"
44+
}
45+
],
46+
"gemini": {
47+
"contextFileName": "POSTGRESQL.md",
48+
"mcpServerName": "postgresql"
49+
}
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)