Skip to content

Resources and Prompts

Chris & Mike edited this page May 7, 2026 · 11 revisions

Resources and Prompts

postgres-mcp provides 24 MCP Resources for real-time database state and 21 AI-powered Prompts for guided workflows.


MCP Resources (24)

Resources provide instant snapshots of database state without writing queries. AI assistants read these automatically to understand your database context.

Core Resources

Resource URI Description
Schema postgres://schema Full database schema with tables, columns, indexes
Tables postgres://tables Table listing with sizes and row counts
Settings postgres://settings PostgreSQL configuration parameters
Statistics postgres://stats Database statistics with stale detection
Activity postgres://activity Current connections and active queries
Pool postgres://pool Connection pool status
Capabilities postgres://capabilities Server version, extensions, tool categories

Health & Monitoring

Resource URI Description
Health postgres://health Comprehensive database health status
Performance postgres://performance pg_stat_statements query metrics
Indexes postgres://indexes Index usage with unused detection
Replication postgres://replication Replication status and lag monitoring
Vacuum postgres://vacuum Vacuum stats and wraparound warnings
Locks postgres://locks Lock contention detection

Extension Resources

Resource URI Description
Cron postgres://cron pg_cron job status and execution history
Partman postgres://partman pg_partman partition configuration and health
Kcache postgres://kcache pg_stat_kcache CPU/I/O metrics summary
Vector postgres://vector pgvector columns, indexes, recommendations
PostGIS postgres://postgis PostGIS spatial columns and index status
Crypto postgres://crypto pgcrypto availability and security tips
Extensions postgres://extensions Extension inventory with recommendations
Insights postgres://insights AI-appended business insight memo
Audit postgres://audit Audit trail with token summary and top tools
Help postgres://help/{group} Group-specific help and workflow documentation
Docstore postgres://docstore JSONB document collection overview

MCP Prompts (21)

Prompts provide step-by-step guidance for complex database tasks. Instead of figuring out which tools to use, invoke a prompt and follow its workflow.

Query & Schema Design

Prompt Description Required Groups
pg_query_builder Construct queries with CTEs and window functions core
pg_schema_design Design schemas with constraints and indexes core
pg_quick_query Quick SQL query guidance for common operations core
pg_quick_schema Quick reference for exploring database schema core
pg_migration Generate migration scripts with rollback support core

Performance & Optimization

Prompt Description Required Groups
pg_performance_analysis Analyze queries with EXPLAIN and optimization core, performance
pg_database_health_check Comprehensive database health assessment core, performance, monitoring
pg_index_tuning Index analysis and optimization workflow core, performance

Administration

Prompt Description Required Groups
pg_backup_strategy Enterprise backup planning with RTO/RPO core, monitoring, backup
pg_safe_restore_workflow 6-step safe restore playbook with restoreAs backup
pg_tool_index Lazy hydration - compact index of all tools any

Extension Setup Guides

Prompt Description Required Groups
pg_extension_setup General extension installation guide core
pg_setup_pgvector Complete pgvector setup for semantic search core, vector
pg_setup_postgis Complete PostGIS setup for geospatial operations core, postgis
pg_setup_pgcron Complete pg_cron setup for job scheduling core
pg_setup_partman Complete pg_partman setup for partition management core, partman
pg_setup_kcache Complete pg_stat_kcache setup for OS monitoring core, kcache
pg_setup_citext Complete citext setup for case-insensitive text core, citext
pg_setup_ltree Complete ltree setup for hierarchical data core, ltree
pg_setup_pgcrypto Complete pgcrypto setup for cryptographic funcs core, pgcrypto
pg_setup_docstore Complete docstore setup for document collections core, docstore

Using Prompts

Prompts are accessed through your MCP client's prompt interface. When invoked:

  1. The prompt provides context and asks clarifying questions
  2. You answer based on your use case
  3. The prompt guides you through the workflow step-by-step
  4. Tools are called automatically as needed

Example: Database Health Check

Invoke pg_database_health_check to:

  • Analyze table bloat and vacuum status
  • Check index usage and missing indexes
  • Review connection pool health
  • Identify slow queries
  • Get actionable recommendations

Related

Clone this wiki locally