Skip to main content
Glama
pg-insight-mcp

pg-insight-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DATABASE_URLYesPostgreSQL connection string
PG_INSIGHT_MAX_ROWSNoMaximum rows returned per query200
PG_INSIGHT_ALLOWED_SCHEMASNoComma-separated schema allow-list; system schemas are never exposedall
PG_INSIGHT_STATEMENT_TIMEOUT_MSNoPer-statement 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.

Read-only access to a PostgreSQL database. Start with list_schemas and list_tables, use describe_table before writing a query, and prefer explain_query for anything that may scan a large table. Only SELECT, WITH, EXPLAIN, SHOW, VALUES and TABLE statements are accepted.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_schemasB

List user schemas with table and view counts.

list_tablesA

List tables and views in a schema with estimated row counts and sizes.

describe_tableB

Columns, constraints, indexes and incoming foreign keys of a table.

sample_rowsB

Return the first rows of a table to see what the data looks like.

run_queryA

Run a single read-only SQL statement inside a read-only transaction. Results are capped and marked as truncated when more rows exist.

explain_queryA

Show the PostgreSQL execution plan for a read-only query without running it.

Prompts

Interactive templates invoked by user choice

NameDescription
analyseGuide an analysis of a business question against the database.

Resources

Contextual data attached and managed by the client

NameDescription
schema-overviewEvery visible table with its columns, as plain text.

TDQS

A3.6/5.0

Scored across 6 tools

Disambiguation4/5

Each tool maps to a distinct exploration step (schemas, tables, table detail, plan, sample, ad-hoc query), so selection is generally obvious. Mild overlap exists: sample_rows and simple exploration could be done via run_query, but the descriptions make the intended specialization clear.

Naming Consistency5/5

All six names follow a consistent snake_case verb_noun pattern (list_schemas, list_tables, describe_table, explain_query, sample_rows, run_query). No mixed conventions or vague one-word names.

Tool Count5/5

Six tools is well-scoped for a read-only PostgreSQL inspection server, and each tool earns its place in the exploration workflow. No bloat or awkwardly thin surface.

Completeness4/5

The surface covers the core read-only workflow: enumerate schemas and tables, describe structure, inspect plans, sample data, and run arbitrary SELECTs. Minor gaps like searching for tables/columns by name or listing indexes/extensions across the database are workarounds via run_query rather than dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues