MCP server · Analytics
Postgres MCP server
by crystaldba
Lets your AI check your Postgres database health, find slow queries, and suggest indexes to speed things up.

This is a helper that connects your AI assistant to a PostgreSQL database, the kind of database many apps use to store their data. Once it is set up, you can ask your AI plain questions about your database and it will look things up for you. It is handy for developers and anyone who looks after an app's database and wants to make it faster.
What is an MCP server? The 30-second version
On its own, your AI can only chat. An MCP server is a small helper program that gives your AI a new skill or a connection to an app or service. This one connects your AI to your PostgreSQL database, so the AI can look at your tables, check how healthy the database is, and run queries for you when you ask. You do not need to know how it works inside; you just ask in normal words.
What this MCP server does
You ask your AI something about your database, like which queries are slow. The AI sends that request to this helper program. The helper then talks to your PostgreSQL database, looking at things like query statistics, table structure, and index health. It sends the findings back to your AI, which explains them to you in the chat. If you allow it, it can also run SQL for you, which is the language used to talk to databases.
Click to zoomWhat you can do with it
- Check the overall health of your database and spot problems
- Find your slowest queries and get ideas to speed them up
- Get suggestions for new indexes that could make things faster
- Look at how Postgres plans to run a query
- List your tables, views, and other database objects
- Run SQL statements yourself, if you turn on the right mode
Try asking your AI
- “Check the health of my database and identify any issues.”
- “What are the slowest queries in my database and how can I speed them up?”
- “Analyze my database workload and suggest indexes to improve performance.”
- “Help me optimize this query: SELECT * FROM orders JOIN customers ON orders.customer_id = customers.id WHERE orders.created_at > '2023-01-01';”
What it gives back to you
You get answers in the chat, in plain language. That can be a list of slow queries, a health report with warnings, or index suggestions with reasons. If you ask it to run SQL, it tells you what it did and shows the results.
Before you start
What you need
- Login details for your PostgreSQL database (the connection address, username, and password)
- Docker or Python 3.12 or higher installed on your computer
- For the best results, two optional add-ons on your database called pg_stat_statements and hypopg
Good to know
In unrestricted mode it can change or delete data in your database, so use restricted mode on any database you care about.
Install it with your AI
Add Postgres MCP server to your AI, no technical skills needed
You don't install anything by hand. You copy one prompt, paste it into an AI that can work on your computer, and it checks, installs and connects the server for you, asking you when it needs something.
Sign in to get the install prompt
Members get a ready-made prompt that lets the Claude desktop app check Postgres MCP server, install it and connect it for them, step by step. You don't need any technical skills: you copy, paste and answer a few questions. Your connected AI can also find and install any of the 4,066 MCP servers here for you.
Who it's for
Developers, database administrators, and anyone who maintains an app's PostgreSQL database and wants help making it faster and healthier.





