MCP server providing PostgreSQL database diagnostic and optimization tools for Rails applications
This server has 26 tools, all read-only database diagnostic utilities. Strengths: all tools have descriptions (though brief), no parameters are exposed as secrets, and the explain/analyze tools include validation logic. Major weaknesses: most tools (20 of 26) have zero input parameters but lack documented output schemas; parameter descriptions exist for the 6 tools that accept arguments, but are minimal; error handling is sparse; tool naming lacks action verbs; and no tool annotations for readOnlyHint. The server wraps the ruby-pg-extras gem, which limits design choices, but the MCP layer misses opportunities to optimize for LLM reasoning.
Database bloat analysis
Cache hit statistics
Frequently called functions
Connection states statistics
Performs a health check of the database
Duplicate indexes analysis
EXPLAIN a query. It must be an SQL string, without the EXPLAIN prefix
EXPLAIN ANALYZE a query. It must be an SQL string, without the EXPLAIN ANALYZE prefix
Index cache hit statistics
20 of 26 tools have no documented output schemas. LLMs cannot predict what fields will be returned, forcing them to guess at downstream tool parameters or extract fields blindly.
Tool names lack action verbs. 'diagnose' is acceptable, but 'bloat', 'locks', 'calls', 'outliers', 'cache_hit' read as nouns/results rather than actions. Names should start with verbs like 'analyze_', 'get_', 'show_', 'check_' to signal to LLMs what action they perform.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 46 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 40 | - | v1 |
Shows information about table indexes: name, table name, columns, index size, index scans, null frac
Index size analysis
Unused indexes analysis
Database locks information
Long running queries information
Shows missing foreign key constraints
Shows missing foreign key indexes
Outlier queries analysis
Sequential scans analysis
Table cache hit statistics
Table indexes size analysis
Shows information about a table: name, size, cache hit, estimated rows, sequential scans, indexes scans
Shows the schema of a table
Table size analysis
Total index size analysis
Total table size analysis
Vacuum statistics
No tool annotations (readOnlyHint) declared. All 26 tools are read-only operations; annotating them with readOnlyHint=true would signal to agents that these are safe, non-destructive calls that can be retried without side effects.
Minimal error handling. The explain and explain_analyze tools validate queries, but other tools provide no guidance if a table doesn't exist, a query fails, or database access is denied. Error messages should tell LLMs: 'Table not found. Call list_tables() first' rather than returning a bare exception.
explain_analyze tool conditional registration. It is gated behind ENV['PG_EXTRAS_MCP_EXPLAIN_ANALYZE_ENABLED']. Dynamic registration reduces discoverability; LLMs cannot assume the tool exists, making prompts fragile. Consider always registering it.
Parameter descriptions are generic. The table_name parameter in index_info, table_info, and table_schema is described as 'The table name to get X for'. This lacks guidance on format (quoted? unquoted?) and what happens if the table doesn't exist. Should specify: 'Unquoted table name (e.g. users, public.orders). Returns error if table does not exist.'