PostgreSQL Performance MCP
@rameshv29
About PostgreSQL Performance MCP
PostgreSQL performance analysis and optimization MCP server
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"postgres-performance-mcp": {
"command": "python",
"args": [
"server.py",
"--host",
"0.0.0.0",
"--port",
"8000"
]
}
}
}Tools
11Analyze database schema and provide optimization recommendations
Identify slow-running queries in the database
Analyze a SQL query and provide optimization recommendations
Recommend indexes for a given SQL query
Suggest optimized rewrites for a SQL query
Generate a comprehensive health dashboard for the database
Interactive wizard to optimize a SQL query step by step
Analyze index usage patterns and identify unused or inefficient indexes
Execute a read-only SQL query and return the results
Show PostgreSQL configuration settings with optional filtering
Check if the server is running and responsive
Overview
What is PostgreSQL Performance MCP?
PostgreSQL Performance MCP is a Model Context Protocol (MCP) server for PostgreSQL database performance analysis and optimization. It uses 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 SSE transport and is designed for use with MCP-compatible clients like Amazon Q Developer CLI and Claude.
How to use PostgreSQL Performance MCP?
Install Python 3.12+, clone the repository, install dependencies, and configure database credentials (optionally via AWS Secrets Manager). Start the server with python server.py --host 0.0.0.0 --port 8000. Connect any MCP-compatible client using the server URL and SSE transport, then call the available tools (e.g., analyze_database_structure, get_slow_queries, recommend_indexes) with the required parameters.
Key features of PostgreSQL Performance MCP
- Database structure analysis with optimization recommendations
- Query performance analysis and bottleneck identification
- Index recommendations based on query patterns
- Slow query identification and analysis
- Database health dashboard with comprehensive metrics
- Read-only query execution for safe verification
Use cases of PostgreSQL Performance MCP
- Analyze database schema to improve table design and indexing
- Identify and optimize slow-running queries
- Get index recommendations for specific SQL queries
- Generate a database health dashboard for monitoring
- Safely execute read-only analytical queries against live databases
FAQ from PostgreSQL Performance MCP
Is PostgreSQL Performance MCP read-only?
Yes, by default all database connections use SET TRANSACTION READ ONLY to prevent accidental modifications. Query execution is strictly limited to SELECT, EXPLAIN, and SHOW commands.
What are the prerequisites to use PostgreSQL Performance MCP?
Python 3.12+, an Amazon Aurora or RDS PostgreSQL database, and optionally an AWS account for Secrets Manager. Recommended PostgreSQL extensions are pg_stat_statements and pg_buffercache.
How are database credentials managed?
Credentials can be stored in AWS Secrets Manager (recommended) or provided directly when calling tools. The secret must contain host, port, dbname, username, and password.
What transport does PostgreSQL Performance MCP use?
It uses Server-Sent Events (SSE) transport, allowing it to be deployed centrally as a remote MCP server accessible by any MCP-compatible client.
Is PostgreSQL Performance MCP production-ready?
No, this project is experimental and provided "as is" without warranty. All recommendations should be carefully reviewed before use in production environments.
More Databases MCP servers
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
mcp-server-duckdb
ktanaka101A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities
MCP MongoDB Server
kiliczshA Model Context Protocol Server for MongoDB
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Comments