postgres-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | HTTP port. | 8000 |
| BIND_HOST | No | HTTP bind address (not HOST). | 0.0.0.0 |
| DATABASES | No | Alternative to DATABASE_URL: either 'alias|url,alias|url' or JSON '{"alias":"url"}'. | |
| TRANSPORT | No | Transport protocol: stdio (MCP default) or HTTP. | stdio |
| DEFAULT_DB | No | Default database alias when multiple databases are configured. | |
| ACCESS_MODE | No | Access mode: unrestricted (read/write) or restricted (read-only with 30s statement timeout, no COMMIT/ROLLBACK). | unrestricted |
| DB_PROD_URL | No | Example multi-database variable. Any DB_<NAME>_URL can be used. | |
| DATABASE_URL | No | Single database connection URI. Sets alias 'default'. | |
| DB_STAGING_URL | No | Example multi-database variable. Any DB_<NAME>_URL can be used. |
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
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_databasesA | List configured database connections. Call first when unsure which db to use. |
| list_schemasA | List schemas (user schemas only by default) |
| list_objectsB | List tables, views, sequences, or extensions in a schema |
| get_object_detailsC | Columns and indexes for a table/view |
| execute_sqlC | Execute SQL (max 50 rows returned) |
| explain_queryC | EXPLAIN a SQL query, optionally with hypothetical indexes |
| get_top_queriesC | Slow or resource-heavy queries from pg_stat_statements |
| analyze_workload_indexesB | Recommend indexes based on pg_stat_statements workload |
| analyze_query_indexesB | Recommend indexes for up to 10 specific queries |
| analyze_db_healthB | Health checks: index,connection,vacuum,sequence,replication,buffer,constraint,all |
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 10 tools
Each tool targets a distinct aspect of PostgreSQL introspection and analysis: listing databases/schemas/objects, fetching details, executing/explaining SQL, and performance tuning. Even the two index analysis tools are clearly differentiated by workload vs. specific queries.
All tool names follow a consistent verb_noun pattern using lowercase with underscores (list_*, get_*, execute_sql, explain_query, analyze_*). The naming is predictable and easy to navigate.
With 10 tools, the server is well-scoped for a PostgreSQL administration and performance analysis purpose. Each tool has a clear role without redundancy or bloat.
The tool set covers the full lifecycle of database inspection and optimization: discovery (databases, schemas, objects), exploration (details, SQL execution, explain), performance analysis (top queries, index recommendations), and health checks. No obvious gaps for its stated purpose.