Skip to main content
Glama
ranson21

postgres-readonly-mcp

by ranson21

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGHOSTNoDatabase host.
PGPORTNoDatabase port (default 5432).5432
PGUSERNoDatabase user.
PGSSLMODENoTLS mode: disable | require | verify-full. Defaults to disable.disable
PGDATABASENoDatabase name.
PGPASSWORDNoDatabase password.
DATABASE_URLNoA single postgres://user:password@host:port/db connection string. Takes precedence over discrete fields.
DB_DEFAULT_ENVNoWhich environment a tool call uses when it doesn't pass env explicitly. Required if more than one environment is configured and you want an implicit default.
DB_ENVIRONMENTSNoComma-separated list of environment names for multiple databases. When set, per-environment variables DB_ENV_<NAME>_URL or DB_ENV_<NAME>_HOST/_PORT/_DATABASE/_USER/_PASSWORD/_SSLMODE must be provided for each environment.
DB_MCP_LOG_LEVELNoDiagnostic log verbosity: debug | info | warn | error (default info).info
PG_MAX_ROW_LIMITNoMaximum rows returned by run_query (default 500).500
PG_MAX_CELL_LENGTHNoLong text/jsonb cell values are truncated to this many characters (default 2000).2000
PG_DEFAULT_ROW_LIMITNoDefault rows returned by run_query (default 100).100
PG_CONNECT_TIMEOUT_MSNoClient-side connection timeout in milliseconds (default 10000).10000
PG_STATEMENT_TIMEOUT_MSNoServer-side statement timeout in milliseconds (default 15000).15000

Instructions

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

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_environmentsA

List configured database environments (name and non-secret connection info, never credentials). Use the returned names as the env argument to other tools. Read-only.

run_queryA

Run a read-only SQL query (SELECT, or WITH ... SELECT) against the database and return compact rows. Results are capped by PG_MAX_ROW_LIMIT. Any INSERT/UPDATE/DELETE/DDL/etc. is rejected before it reaches the database - this server is read-only.

list_schemasA

List schemas in the database. Excludes system schemas by default. Read-only.

list_tablesA

List tables and views in a schema (default: public). Read-only.

describe_tableA

Describe a table's columns (name, type, nullable, default, primary key) in a schema (default: public). Read-only.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing environments, running queries, listing schemas, listing tables, and describing a table. There is no overlap in their intended use, and descriptions reinforce the boundaries.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_environments, run_query, list_schemas, list_tables, describe_table. The slight variation in verbs (list, run, describe) is appropriate and predictable.

Tool Count5/5

Five tools are well-scoped for a read-only PostgreSQL server, covering environment discovery, query execution, and schema introspection without bloat or omission of core operations.

Completeness4/5

The surface covers essential read-only operations: environment listing, ad-hoc queries, schema/table listing, and column description. Minor gaps exist for more granular introspection (e.g., indexes, foreign keys, constraints), but agents can work around them with run_query.

Maintenance

ActivityMaintained
ResponsivenessNo issues