postgres-mcp

neverinfamous/postgres-mcp

3.3

If you are the rightful owner of postgres-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Postgres MCP Pro is an open source Model Context Protocol (MCP) server designed to support AI agents throughout the development process, offering features like index tuning, explain plans, health checks, and safe SQL execution.

Tools

Functions exposed to the LLM to take actions

list_schemas

Lists all database schemas available in the PostgreSQL instance.

list_objects

Lists database objects (tables, views, sequences, extensions) within a specified schema.

get_object_details

Provides information about a specific database object, such as a table's columns, constraints, and indexes.

execute_sql

Executes SQL statements on the database, with read-only limitations when connected in restricted mode.

explain_query

Gets the execution plan for a SQL query, describing how PostgreSQL will process it and exposing the query planner's cost model.

get_top_queries

Reports the slowest SQL queries based on total execution time using pg_stat_statements data.

analyze_workload_indexes

Analyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.

analyze_query_indexes

Analyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.

analyze_db_health

Performs comprehensive health checks including buffer cache hit rates, connection health, constraint validation, index health, sequence limits, and vacuum health.

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources