Skip to main content
Glama
postgres-readonly-mcp

postgres-readonly-mcp

by lmartin712

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PG_DSNYeslibpq connection string or URL.
MCP_AUDIT_LOGNoJSONL audit file. Use an absolute path under Claude Desktop.~/.postgres-readonly-mcp/audit.jsonl
MCP_ROW_LIMITNoMaximum rows returned per query.200
MCP_ALLOWED_TABLESYesComma-separated. `customers` means `public.customers`; use `sales.invoices` for other schemas. The server refuses to start if empty.
MCP_STATEMENT_TIMEOUT_MSNoPer-statement timeout.5000

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": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_tablesA

List the tables this server is allowed to query (schema-qualified).

describe_tableA

Describe the columns of an allow-listed table. Accepts 'table' or 'schema.table'.

queryA

Run one read-only SELECT (WITH ... SELECT is fine) against allow-listed tables.

Results are capped at the configured row limit; the response says if it was cut off.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 3 tools

Disambiguation5/5

The three tools map cleanly to distinct stages of read-only exploration: discovering tables, inspecting a table's columns, and executing a query. There is no realistic way to confuse list_tables with describe_table or query, since each targets a different granularity of the schema.

Naming Consistency4/5

list_tables and describe_table follow a clear verb_noun pattern, and query is the natural short form for the execution primitive. The single bare verb is a minor deviation but still readable and idiomatic for this domain.

Tool Count4/5

Three tools is the minimum viable surface for a read-only Postgres server, and each one earns its place with no redundancy. It is slightly thin—nothing covers schema-level or index-level introspection—but the scope is deliberately narrow.

Completeness4/5

Discovery (list_tables), structure inspection (describe_table), and data retrieval (query) cover the core read-only workflow end to end, including handling of row caps. Minor gaps exist around listing schemas or enumerating columns across tables, but agents can work around these with query against catalog views.