postgres-mcp-js
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ACCESS_MODE | No | Access mode: restricted (read-only, 30s timeout) or unrestricted (full read/write). Default: restricted | restricted |
| DB_PRIMARY_URL | Yes | PostgreSQL connection URL for the primary database (required). Example: postgresql://user:password@localhost:5432/mydb | |
| DB_REPLICA_URL | No | PostgreSQL connection URL for a secondary database (optional) | |
| DB_PRIMARY_NAME | No | Alias for the primary database (default: primary) | primary |
| DB_REPLICA_NAME | No | Alias for the replica database (default: replica) | replica |
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 aliases. Use the returned names in the "database" parameter of other tools. |
| list_schemasA | List all schemas in the database. |
| list_objectsB | List tables, views, sequences, or extensions in a schema. |
| get_object_detailsC | Get columns, constraints, and indexes for a table or view. |
| execute_sqlA | Execute a read-only SQL query (SELECT, EXPLAIN, SHOW, WITH). Write operations are blocked. Max execution time: 30 seconds. |
| explain_queryA | Get the query execution plan. Supports hypothetical index simulation (requires hypopg extension). |
| get_top_queriesB | Report the slowest or most resource-intensive queries using pg_stat_statements. |
| analyze_db_healthB | Run comprehensive database health checks across multiple dimensions. |
| analyze_workload_indexesB | Analyze query workload from pg_stat_statements and recommend missing indexes. |
| analyze_query_indexesA | Analyze specific SQL queries and identify missing indexes. Maximum 10 queries. |
| detect_index_missesB | Detect tables likely suffering from missing indexes: seq-scan dominance, FK columns without indexes, under-indexed hot tables. |
| analyze_locksB | Detect lock contention: blocking chains, long-running queries, idle-in-transaction sessions. |
| analyze_table_bloatB | Detect table and index bloat from dead tuples. Returns vacuum recommendations. |
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 13 tools
Most tools have clear and distinct purposes, though the index analysis tools (analyze_query_indexes, analyze_workload_indexes, detect_index_misses) overlap somewhat in focus, potentially causing some confusion for an agent.
All tools use a consistent underscore-separated verb_noun pattern (e.g., analyze_locks, list_databases), making the tool set predictable and easy to navigate.
With 13 tools, the set is well-scoped for a database analysis server, covering essential operations without being overwhelming or insufficient.
The tool set comprehensively covers read-only database analysis: health, locks, bloat, indexes, query explanation, and object listing. There are no obvious gaps for its stated purpose.