Skip to main content
Glama
eric-patton

postgres-schema-mcp

by eric-patton

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DATABASE_URLYesConnection string. Point it at the read-only role.
PGSM_MAX_POOLNoConnection pool size4
PGSM_MAX_ROWSNoRow cap on every result200
PGSM_HTTP_HOSTNoHost to bind for HTTP mode. Defaults to 127.0.0.1127.0.0.1
PGSM_HTTP_PORTNoPort for authenticated HTTP mode
PGSM_MAX_BYTESNoSize cap on every result, which is the one that protects the agent's context100000
PGSM_TOKENS_FILENoPath to JSON file containing tokens for HTTP mode
PGSM_REDACT_PATTERNNoRegular expression matched against column names to redact values in results. Default covers common sensitive column names.password|secret|token|ssn|credit_card|api_key|private_key
PGSM_ALLOWED_SCHEMASNoComma-separated allowlist of schemas. Everything else becomes invisible.all
PGSM_IDLE_TX_TIMEOUT_MSNoIdle-in-transaction timeout15000
PGSM_STATEMENT_TIMEOUT_MSNoPer-statement timeout10000

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_schemasA

List the schemas in the database with how many tables and views each holds. Start here when you do not know the shape of the database yet.

list_tablesA

List the tables and views in one schema, largest first, with an estimated row count and total on-disk size. Use this to find out what is expensive before you query it. Row counts are planner estimates, not exact counts.

describe_tableA

Full description of one table: every column with its type, nullability and default, plus primary keys, foreign keys, unique and check constraints, indexes and any comments. This is the core tool once you know which table you want.

find_columnsA

Search for columns by name across every schema, optionally filtered by type. Use this instead of listing tables when the database is large: searching for "customer_id" finds every table that carries it in one call.

table_relationshipsA

Follow foreign keys from one table, in both directions, up to a given depth. Outbound keys tell you what a row points at; inbound keys tell you what points at it. Use this to work out how to join instead of guessing from column names.

sample_rowsA

Return the first few rows of a table so you can see the shape of the data. Columns whose names look like secrets are masked. Results are capped by row count and by size, and the response says when it truncated.

run_selectA

Run one SELECT or WITH statement. Anything else is refused, including stacked statements, DDL, DML and SELECT INTO. The query runs in a read-only transaction with a statement timeout, results are capped and secret-looking columns masked. There is no write mode.

explain_queryA

Show the query plan for a SELECT without running it. Pass analyze: true to execute it and get measured timings instead of estimates. Use this to tune a query before running it against a large table.

export_data_dictionaryA

Write a Markdown data dictionary for one schema to a file: every table, every column with type and nullability, and every key and constraint. Once written, you can read the schema from disk with no database connection. This is the only tool here that writes anything, and it writes only to the path you give it.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 9 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: schema discovery, table listing, detailed table description, column search, relationship traversal, data preview, query execution, query planning, and documentation export. There is no practical overlap; even sample_rows and run_select differ in that one is a convenience for previewing a table and the other is for arbitrary read-only queries.

Naming Consistency4/5

Eight of nine tools follow a clear verb_noun snake_case pattern (list_schemas, describe_table, run_select, etc.), making the set predictable. The single exception is table_relationships, which uses a noun_noun form, creating a minor inconsistency without causing confusion.

Tool Count5/5

Nine tools is well-scoped for a PostgreSQL schema and querying server. Each tool fills a distinct role in the workflow from schema discovery to query tuning, and none feel redundant or bolted on.

Completeness5/5

The tool surface covers the full read-only lifecycle: schema/table discovery, column search, relationship mapping, data sampling, safe SELECT execution, query planning, and exporting a data dictionary. There are no obvious dead ends for an agent exploring or querying a database, and the explicit lack of write mode is a deliberate boundary rather than a gap.

Maintenance

ActivityMaintained
ResponsivenessNo issues