Postgres plugin

A Google plugin for Gemini CLI, Claude Code and Codex connects the agent to PostgreSQL: schemas, queries, indexes and query plans.

  • 95 ★ on the repository
  • Last commit
  • Apache-2.0
PluginOfficial

Broad access

Why this level

  • The `execute_sql` tool runs any SQL the role allows, including writes and deletes.
  • The database password sits in environment variables or plugin settings.
All reasons and checks

googlecloudplatform/postgres-plugin

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add plugins/postgres-plugin

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The `execute_sql` tool runs any SQL the role allows, including writes and deletes.
  • The database password sits in environment variables or plugin settings.

This is third-party code. Review the repository files before installing.

What it does

The plugin connects the agent to your PostgreSQL instance through an MCP server started with `npx` from the `@toolbox-sdk/server` package. The agent lists tables, schemas, views and sequences, runs SQL queries and shows a query plan through `get_query_plan`. Separate tools read server state: active queries, database stats, memory and autovacuum settings, bloated tables, invalid indexes, replication slots and roles. It suits plain-language questions such as "how many orders in 30 days" and generating data classes from a table schema. The connection comes from the `POSTGRES_DATABASE`, `POSTGRES_USER` and `POSTGRES_PASSWORD` variables.

Who it is for. Developers and PostgreSQL administrators who want to inspect a database schema and load from Gemini CLI, Claude Code or Codex.

Good fit when

  • You need to grasp an unfamiliar schema quickly: tables, columns, views.
  • A query is slow and the agent should show the plan and find a missing index.
  • Bloated tables or invalid indexes are suspected after a migration.
  • A data class in Python or another language has to be generated for a table.

Not a fit when

  • You work with Cloud SQL instances: Google has a separate extension for them.
  • The connection must change inside a session: in Gemini CLI it is fixed before launch.
  • The agent must stay read-only, yet no read-only role can be created.

Example request

Show the top 5 most ordered products over the last 30 days and the plan of that query.

Limitations

The plugin is in beta before version 1.0 and may change incompatibly. It needs Node.js for `npx`, a running PostgreSQL and a user with query rights. The `execute_sql` tool runs any SQL the role allows, so give it a read-only role. The database connection is fixed before launch and does not change within a Gemini CLI session. On first launch `npx` downloads the package, so internet is needed. The Gemini CLI manifest needs version 0.6.0 or newer, and Codex needs version 0.150.0 or higher.

How to disable. In Claude Code run `/plugin` and remove the plugin, in Gemini CLI run `gemini extensions uninstall postgres`. Remove the password from environment variables separately.

FAQ

How do I install the plugin in Claude Code?

Run `claude plugin marketplace add GoogleCloudPlatform/postgres-plugin`, then `claude plugin install postgres@postgres`. Pass the connection settings with `--config KEY=VALUE`.

Which variables does the connection need?

`POSTGRES_DATABASE`, `POSTGRES_USER` and `POSTGRES_PASSWORD` are required. `POSTGRES_HOST` (default `localhost`), `POSTGRES_PORT` (5432) and `POSTGRES_QUERY_PARAMS` are optional.

What if I get "spawn npx ENOENT"?

Install Node.js: the MCP server starts through `npx`. For "Connection closed", check the connection environment variables.

Which agents are supported?

Gemini CLI from version 0.6.0, Claude Code, Codex from 0.150.0 and Antigravity CLI. One plugin serves all four.

Can the agent change data?

The `execute_sql` tool runs any query the role allows. For schema exploration give the database user read-only rights.

Discussion

No questions or reviews yet.

Plugins

pgEdge Postgres MCP

pgEdge Postgres MCP Server

Postgres MCP in Go with read-mode queries, EXPLAIN plans, semantic search, several databases and a ready chat client and web interface

MCP serverExtended access246Repository stars

An MCP server for PostgreSQL with several databases at once, table descriptions from the catalog, PostGIS and pgvector hints and query plans

MCP serverExtended access541Repository stars
Official

An MCP server and skills from TigerData that help agents write PostgreSQL schemas and queries from current docs and practices

MCP serverExtended access1.9KRepository stars

A Google Cloud plugin catalog for databases and analytics: AlloyDB, Spanner, Bigtable, Firestore, Cloud SQL and Looker.

PluginBroad access86Repository stars

MCP server for PostgreSQL: an agent runs SQL and sees tables and schemas, with writes off until you explicitly allow them

MCP serverExtended access179Repository stars

pgcli is a terminal PostgreSQL client with SQL-aware suggestions: tables after FROM and columns after WHERE.

CLIExtended access13.4KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Postgres plugin (this card)yes95
Postgres MCP PronoAPI key3,472a third-party MCP server with index and health analysis; this is an official Google plugin for four agents
Postgres MCP (Microsoft)nokey is optional86a Microsoft server for Azure Database for PostgreSQL; the Google plugin works with plain PostgreSQL

README in short

The extension belongs to the Google Cloud family of Gemini CLI extensions. The repository holds manifests for Gemini CLI, Claude Code and Codex, and the server is attached through a single `.mcp.json` description.

README badge

Report a problem