postgres-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PGSSL | No | SSL configuration mode (alias for PGSSLMODE) | |
| PGHOST | No | Database host name | localhost |
| PGPORT | No | Database port number | 5432 |
| PGUSER | No | Database user name | postgres |
| POOL_MAX | No | Maximum active database connections in pool (alias for MAX_CONNECTIONS) | 10 |
| PGSSLMODE | No | SSL configuration mode (require, verify-full, etc.) | |
| ROW_LIMIT | No | Maximum rows returned per query (alias for MAX_ROW_LIMIT) | 1000 |
| PGDATABASE | No | Database name | postgres |
| PGPASSWORD | No | Database password | |
| ALLOW_WRITE | No | Enables write queries (1, true, yes) | false |
| POSTGRES_DB | No | Database name (alias for PGDATABASE) | postgres |
| DATABASE_URL | No | Full PostgreSQL connection URI (postgres://user:pass@host:port/db) | |
| MAX_ROW_LIMIT | No | Maximum rows returned per query | 1000 |
| POSTGRES_HOST | No | Database host name (alias for PGHOST) | localhost |
| POSTGRES_USER | No | Database user name (alias for PGUSER) | postgres |
| MAX_CONNECTIONS | No | Maximum active database connections in pool | 10 |
| QUERY_TIMEOUT_MS | No | Per-query timeout in milliseconds | 30000 |
| POSTGRES_PASSWORD | No | Database 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
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
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.
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.
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.
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.