What is PostgreSQL Analyzer MCP?
PostgreSQL Analyzer MCP is a Model Context Protocol (MCP) server for PostgreSQL database performance analysis and optimization. It leverages AI to help database administrators and developers analyze database structure, query performance, index usage, and configuration, providing actionable recommendations. It runs as a remote MCP server using Streamable HTTP transport, allowing centralized deployment and access by any MCP-compatible client (e.g., Amazon Q Developer CLI, Claude).
How to use PostgreSQL Analyzer MCP?
Install locally (Python 3.12+, pip) or via Docker. Start the server with python src/main.py or by running the Docker container. Point your MCP client to http://your-server:8000/mcp using Streamable HTTP transport. Database credentials can be provided via AWS Secrets Manager (recommended) or directly when calling tools.
Key features of PostgreSQL Analyzer MCP
- Database structure analysis (tables, columns, indexes, foreign keys)
- Query performance analysis with execution plans and bottleneck identification
- Index recommendations based on query patterns
- Query optimization suggestions and rewrites
- Slow query identification and analysis
- Database health dashboard with comprehensive metrics
- Index usage analysis (unused, duplicate, bloated indexes)
- Read-only query execution (SELECT, EXPLAIN, SHOW only)
Use cases of PostgreSQL Analyzer MCP
- Analyze entire database schema and get optimization recommendations
- Identify and analyze slow-running queries for performance tuning
- Get index recommendations for a specific SQL query
- Generate a comprehensive health dashboard for a PostgreSQL database
- Execute safe read-only queries to inspect database statistics
Comments