pg-readonly-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PGMCP_USER | No | Who is asking, written to every audit line | unknown |
| DATABASE_URL | Yes | Connection string for the read-only role (e.g. postgresql://claude_reader:change-me@db.internal:5432/shop) | |
| PGMCP_MAX_ROWS | No | Row cap per query | 500 |
| PGMCP_AUDIT_LOG | No | Path of the JSON-lines audit log where every call, including rejected ones, is appended | audit.jsonl |
| PGMCP_MASK_COLUMNS | No | Comma-separated column names to mask (e.g. iban,email,phone). Columns listed come back as **** plus the last four characters. | |
| PGMCP_STATEMENT_TIMEOUT_MS | No | Postgres statement_timeout per query | 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
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_tablesA | Tables and views this connection can read, as schema.name. |
| describe_tableB | Columns of one table or view (schema.name). Masked columns are flagged. |
| queryA | Run one read-only SQL statement (SELECT / WITH / TABLE / VALUES / EXPLAIN). |
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
Each tool has a distinct role: catalog listing (list_tables), schema introspection (describe_table), and statement execution (query). The only overlap is that query could technically be used to list tables, but the descriptions steer an agent cleanly toward the dedicated tools.
list_tables and describe_table follow a consistent verb_noun snake_case pattern, and query is a single clear verb in the same style. Minor deviation only in that query lacks a noun target, but it reads naturally alongside the others.
Three tools is a tight, well-scoped surface for a read-only database accessor: discover tables, inspect columns, run SELECTs. Nothing extraneous and nothing obviously missing at this scope.
The discover-inspect-query lifecycle fully covers read-only database work, including EXPLAIN via query. Minor gaps exist around schema/database-level listing and connection metadata, but agents can work around these easily.