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.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mahin1995/postgres-mcp-readonly'

If you have feedback or need assistance with the MCP directory API, please join our Discord server