Skip to main content
Glama
mahin1995

postgres-mcp-readonly

by mahin1995

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAX_ROWSNoDefault maximum rows returned500
AUDIT_LOGNoSet to true to write JSON audit events to stderrfalse
DATABASE_URLNoSingle PostgreSQL connection string (backward compatible). Example: postgres://user:pass@localhost:5432/dbname
DATABASE_URLSNoMultiple PostgreSQL URLs as alias=url pairs or JSON. Example: default=postgres://user:pass@localhost:5432/app,analytics=postgres://user:pass@localhost:5432/analytics
MAX_STATEMENTSNoMaximum semicolon-separated statements per multi-statement tool call10
DEFAULT_DATABASENoDefault alias used when tool input omits databasedefault
STATEMENT_TIMEOUT_MSNoQuery timeout in milliseconds5000

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
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
db.databasesA

List configured database aliases and the currently selected default alias.

db.schemaB

Inspect database schema. Use mode='summary' for table list or mode='full' for columns and keys.

db.queryA

Run one or more read-only SELECT queries with optional row limits. Multi-statement calls are allowed for non-parameterized SELECT/WITH statements; parameterized queries must be single-statement.

db.validate_insertA

Validate one or more INSERT statements without executing them. Uses EXPLAIN without ANALYZE, so rows are never inserted. Parameterized validation must be single-statement.

db.validate_sqlB

Validate SELECT, INSERT, UPDATE, or DELETE statements without executing them by using EXPLAIN without ANALYZE.

db.explainA

Return PostgreSQL EXPLAIN plans for one or more SELECT/WITH statements without executing them.

db.table_infoA

Inspect one table's columns, indexes, constraints, foreign-key relationships, and triggers.

db.indexesA

List PostgreSQL indexes for all user tables or one table using table or schema.table name.

db.constraintsA

List constraints for all user tables or one table, including primary keys, foreign keys, unique constraints, and checks.

db.relationshipsA

List foreign-key relationships for all user tables or one table.

db.sample_valuesB

Return small distinct non-null sample values for selected columns in a table.

db.previewC

Preview rows from a table using table or schema.table name.

db.watchA

Fetch one incremental batch where cursorColumn > lastCursor. Repeat client-side for polling.

db.countA

Get exact row count for a table. Use table or schema.table name.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
schema-summarySummary of tables and approximate row counts.
schema-fullFull schema including columns, primary keys, and foreign keys.

TDQS

A3.6/5.0

Scored across 14 tools

Disambiguation4/5

Most tools have clearly distinct purposes (querying, counting, previewing, explaining, validating). However, validate_insert is a subset of validate_sql, and table_info can duplicate indexes/constraints/relationships for a single table, creating minor confusion.

Naming Consistency4/5

All tools use the same 'db.' prefix and snake_case, which is consistent. However, the second part mixes nouns (databases, schema, query) and verbs (validate_insert, explain, watch), so the pattern is not strictly verb_noun but still predictable.

Tool Count5/5

14 tools is well within the ideal range for a dedicated read-only database server. Each tool addresses a distinct need without excessive redundancy, and the count feels appropriate for the scope.

Completeness5/5

The server covers all typical read-only operations: listing databases, inspecting schema, querying, counting, previewing, sampling, explaining, and validating writes without executing. It also includes incremental polling, making it a comprehensive surface for a read-only Postgres MCP server.

Maintenance

ActivityInactive
ResponsivenessNo issues