postgres-readonly-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PG_DSN | Yes | libpq connection string or URL. | |
| MCP_AUDIT_LOG | No | JSONL audit file. Use an absolute path under Claude Desktop. | ~/.postgres-readonly-mcp/audit.jsonl |
| MCP_ROW_LIMIT | No | Maximum rows returned per query. | 200 |
| MCP_ALLOWED_TABLES | Yes | Comma-separated. `customers` means `public.customers`; use `sales.invoices` for other schemas. The server refuses to start if empty. | |
| MCP_STATEMENT_TIMEOUT_MS | No | Per-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
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 3 tools
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.
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.
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.
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.