Skip to main content
Glama
postgres-mcp-server

postgres-mcp-server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGSSLNoSSL configuration mode (alias for PGSSLMODE)
PGHOSTNoDatabase host namelocalhost
PGPORTNoDatabase port number5432
PGUSERNoDatabase user namepostgres
POOL_MAXNoMaximum active database connections in pool (alias for MAX_CONNECTIONS)10
PGSSLMODENoSSL configuration mode (require, verify-full, etc.)
ROW_LIMITNoMaximum rows returned per query (alias for MAX_ROW_LIMIT)1000
PGDATABASENoDatabase namepostgres
PGPASSWORDNoDatabase password
ALLOW_WRITENoEnables write queries (1, true, yes)false
POSTGRES_DBNoDatabase name (alias for PGDATABASE)postgres
DATABASE_URLNoFull PostgreSQL connection URI (postgres://user:pass@host:port/db)
MAX_ROW_LIMITNoMaximum rows returned per query1000
POSTGRES_HOSTNoDatabase host name (alias for PGHOST)localhost
POSTGRES_USERNoDatabase user name (alias for PGUSER)postgres
MAX_CONNECTIONSNoMaximum active database connections in pool10
QUERY_TIMEOUT_MSNoPer-query timeout in milliseconds30000
POSTGRES_PASSWORDNoDatabase password (alias for PGPASSWORD)

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
list_tablesA

Discover schemas and their tables/columns without writing a query (FR-002)

describe_tableA

Detail the columns, types, and primary keys of a specific table (FR-002)

list_databasesA

Discover databases visible/connectable to the connected user (FR-002a)

list_rolesB

Discover roles/users and their attributes and memberships (FR-002b)

list_permissionsB

Discover privileges granted to roles on schemas, tables, and columns (FR-002c)

run_queryB

Execute a read-only SELECT query and return structured rows (FR-003)

run_write_queryB

Execute INSERT/UPDATE/DELETE/DDL statements when write mode is enabled (FR-006)

set_roleA

Set active PostgreSQL role/user for the session (SET ROLE) or reset to default (RESET ROLE)

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have clearly distinct resource+action targets, especially read vs. write query execution and role setting. The only mild overlap is between list_tables (which includes column info) and describe_table (which details columns/keys), but descriptions clarify the distinction.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_databases, list_tables, describe_table, list_roles, list_permissions, run_query, run_write_query, set_role. No mixed conventions or vague standalone verbs.

Tool Count5/5

Eight tools is well-scoped for a PostgreSQL MCP server focused on discovery and query execution. Each tool earns its place without excessive granularity or missing obvious helpers.

Completeness4/5

The surface covers core database discovery, role/permission inspection, read queries, write/DDL statements, and role switching. Minor gaps exist for deeper schema introspection (indexes, views, constraints beyond primary keys) and transaction control, but agents can work around them via catalog queries.