postgres-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MAX_ROWS | No | Maximum rows returned | 1000 |
| POSTGRES_DB | Yes | Database name | postgres |
| POSTGRES_HOST | Yes | Database host | localhost |
| POSTGRES_PORT | No | Database port | 5432 |
| POSTGRES_USER | Yes | Database user | postgres |
| QUERY_TIMEOUT | No | Query timeout (seconds) | 30 |
| POSTGRES_SSLMODE | No | SSL mode | prefer |
| POSTGRES_PASSWORD | Yes | Database password | |
| ALLOW_WRITE_OPERATIONS | No | Enable write operations | 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
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| queryA | Execute a SQL query against the PostgreSQL database. |
| executeA | Execute a write SQL statement (INSERT, UPDATE, DELETE). |
| explain_queryA | Get the execution plan for a SQL query (EXPLAIN). |
| list_schemasA | List all schemas in the PostgreSQL database. |
| list_tablesA | List all tables in a specific schema. |
| describe_tableA | Describe the structure of a table including columns, types, and constraints. |
| table_statsB | Get statistics for a table (row count, size, bloat). |
| list_indexesB | List all indexes for a table. |
| list_constraintsA | List all constraints for a table (PK, FK, UNIQUE, CHECK). |
| list_viewsB | List all views in a schema. |
| describe_viewA | Get the definition and columns of a view. |
| list_functionsB | List all functions and procedures in a schema. |
| get_database_infoB | Get database and connection information. |
| search_columnsB | Search for columns by name across all tables. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| explore_database | Explore the database structure and understand the schema. Returns: Prompt for exploring the database |
| query_builder | Help build SQL queries for a specific table. Args: table_name: Table to query Returns: Prompt for building queries |
| performance_analysis | Analyze table performance and suggest optimizations. Args: table_name: Table to analyze Returns: Prompt for performance analysis |
| data_dictionary | Generate a data dictionary for a schema. Args: schema: Schema to document Returns: Prompt for generating data dictionary |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_schemas | List all schemas in the database. Returns a summary of schemas for browsing. |
| resource_database | Get database information. |
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose with no ambiguity. For example, describe_table focuses on table structure, while table_stats provides statistical metrics, and list_constraints is separate from list_indexes. The descriptions clearly differentiate overlapping concepts like query (read-only) vs execute (write operations).
All tools follow a consistent verb_noun pattern with snake_case throughout. The naming convention is perfectly predictable: list_tables, describe_table, search_columns, explain_query, etc. There are no deviations in style or convention across the 14 tools.
14 tools is well-scoped for a PostgreSQL database management server. Each tool earns its place by covering distinct aspects of database interaction: schema exploration, table analysis, query execution, and metadata inspection. The count aligns perfectly with the comprehensive but focused domain coverage.
The tool surface provides complete coverage for PostgreSQL database interaction. It includes schema listing, table/view description, query execution (both read and write), performance analysis (explain_query), metadata inspection (constraints, indexes, functions), and search capabilities. No obvious gaps exist for typical database exploration and management workflows.