Skip to main content
Glama
PG Sheets MCP
by hamza533

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAX_ROWSNoPer-query row cap.500
READ_ONLYNoSet to 'false' to register the two Sheets write tools.true
TRANSPORTNoSet to 'http' for remote mode, which requires OAUTH_ISSUER and OAUTH_AUDIENCE.stdio
REDACT_ARGSNoWhether audit log arguments are redacted.true
DATABASE_URLYesConnection string for the read-only database role.
OAUTH_ISSUERNoOAuth issuer used for remote HTTP mode.
ALLOWED_TABLESNoTables the AI may query.all
AUDIT_LOG_PATHNoAudit log destination.stderr
OAUTH_AUDIENCENoOAuth audience used for remote HTTP mode.
SHEETS_BACKENDNoSet to 'memory' for a demo spreadsheet backend.
ALLOWED_SCHEMASNoSchemas the AI may query.public
DB_POOL_MAX_SIZENoMaximum database connection pool size, used for replica and connection-limit scaling.
QUERY_TIMEOUT_MSNoPer-query timeout in milliseconds.5000
ALLOWED_SHEET_IDSNoAllowed Google Sheet IDs.
GOOGLE_SERVICE_ACCOUNT_JSONNoGoogle service account JSON for Sheets access. Share each sheet with the service account.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Answers questions from a PostgreSQL database and Google Sheets, safely. For database questions: postgres_list_tables → postgres_describe_table → postgres_query (one SELECT; aggregate in SQL). For spreadsheets: sheets_list_tabs → sheets_read_range or sheets_find_rows. READ-ONLY mode: Google Sheets write tools are disabled. Every call is audited.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
postgres_list_tablesA

List the tables and views the AI may query in the allowed schemas (public), with approximate row counts and table comments. Call this first to discover what data exists, then postgres_describe_table for column details.

postgres_describe_tableA

Describe one table or view: columns with types, nullability, defaults and comments, the primary key, foreign keys to other tables, and foreign keys from other tables (use these to write correct JOINs). Call before writing a query against a table you haven't seen.

postgres_queryA

Run ONE read-only PostgreSQL SELECT and return the rows as JSON objects. Only tables in the allowed schemas (public) can be read. Rejected: anything that is not a single SELECT (INSERT/UPDATE/DELETE/DDL, multiple statements, SELECT INTO, FOR UPDATE), system catalogs (pg_*), and unsafe functions (pg_sleep, pg_read_file, dblink, set_config…). Results are capped at 500 rows (truncated=true means more rows exist) and the query is cancelled after 5000 ms, so aggregate in SQL (GROUP BY, ORDER BY … LIMIT) rather than fetching raw rows. Use postgres_describe_table first to get exact column names.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

The three tools form a clean discovery→inspection→execution pipeline with no overlap: one lists tables, one describes a single table's schema, and one runs queries. Descriptions explicitly state the ordering and dependencies, so an agent cannot reasonably confuse them.

Naming Consistency4/5

All names are snake_case with a consistent postgres_ prefix, and list/describe follow a verb_noun pattern. postgres_query deviates slightly by using a bare noun rather than an explicit verb like postgres_run_query, but the family is clearly recognizable.

Tool Count4/5

Three tools is lean but each is essential to the read-only workflow, so nothing feels padded. A slightly richer surface (e.g. listing schemas or explaining a query plan) could exist, but the minimal set matches the narrow purpose.

Completeness4/5

For a read-only Postgres bridge the loop is closed: discover tables, inspect columns/keys, then query with corrective hints on ordering and aggregation. No write operations exist, but that is a deliberate scope choice; only minor conveniences like schema enumeration or query-plan inspection are absent.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues