Skip to main content
Glama
milad-codes

pg-readonly-mcp

by milad-codes

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DATABASE_URLYesPostgreSQL connection URL. Required.
PG_MCP_SCHEMASNoComma-separated schemas the assistant may read.public
PG_MCP_MAX_ROWSNoHard cap per query.200
PG_MCP_REDACT_COLUMNSNoRegular expression for masked result columns.password\|passwd\|secret\|token\|api_?key\|ssn\|iban\|credit_?card
PG_MCP_STATEMENT_TIMEOUT_MSNoPer-statement timeout in milliseconds.5000
PG_MCP_ALLOW_EXPLAIN_ANALYZENoWhether EXPLAIN ANALYZE is allowed. EXPLAIN ANALYZE executes the query.false

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_tablesA

Lists tables and views with their kind, approximate row count, total size and comment.

describe_tableB

Columns (type, nullability, default, comment), primary key, foreign keys, unique and check constraints, and indexes of one table.

run_queryA

Runs one SELECT (WITH, VALUES, UNION allowed) in a read-only transaction with a time limit and returns at most 200 rows. Writes, DDL, locking clauses, system catalogs and side-effecting functions are refused with an explanation.

explain_queryA

Shows the PostgreSQL execution plan of a SELECT with a summary (node types, sequential scans, index suggestions). analyze=true executes the query and is only available if the server enables it.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing relations, describing one relation, executing a read-only SELECT, and explaining a SELECT plan. run_query and explain_query could superficially overlap, but the descriptions make the execution-vs-plan boundary explicit.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_tables, describe_table, run_query, explain_query. The convention is predictable and readable.

Tool Count5/5

Four tools is well-scoped for a read-only PostgreSQL introspection/query server. Each tool earns its place and the surface avoids unnecessary breadth.

Completeness4/5

The core read-only workflow is covered: discover tables, inspect table structure, run ad-hoc SELECTs, and inspect query plans. Minor gaps exist around listing schemas, functions, or server-level metadata, but agents can work around these with run_query.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive