1. Conduid
  2. Data
  3. crystaldba/postgres-mcp
MCP server · Data

crystaldba/postgres-mcp

Postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.

Unclaimed MIT mcp-serverpostgres
88Strong

Scored 7 hours ago · breakdown

About crystaldba/postgres-mcp

crystaldba/postgres-mcp is an MCP server published by crystaldba in the Data category: postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents. Conduid read 9 tools from its source: analyze_db_health, analyze_query_indexes, analyze_workload_indexes, execute_sql, explain_query, get_object_details and 3 more. No package is published for it, so it installs from a source checkout.

The repository has 3.5K stars and 401 forks, is licensed MIT, and its last commit was on 30 Nov 2026. The latest release is v0.3.0 (16 May 2025): Release v0.3.0 adds windows support and index optimization by LLM. It follows v0.2.1 (17 Apr 2025), and the 4 most recent releases go back to v0.1.1 (8 Apr 2025). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include postgres.

Install

From source
git clone https://github.com/crystaldba/postgres-mcp

Tools (9)

analyze_db_healthPerforms comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index health (duplicate/unused/invalid), sequence limits, and vacuum health.
ParameterTypeDescription
health_typestringOptional. Valid values are: {', '.join(sorted([t.value for t in HealthType]))}.
analyze_query_indexesAnalyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.
ParameterTypeDescription
max_index_size_mbintegerMax index size in MB
methodstringMethod to use for analysis
queries *arrayList of Query strings to analyze
analyze_workload_indexesAnalyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.
ParameterTypeDescription
max_index_size_mbintegerMax index size in MB
methodstringMethod to use for analysis
execute_sqlExecutes SQL statements on the database, with read-only limitations when connected in restricted mode.
explain_queryGets the execution plan for a SQL query describing how PostgreSQL will process it and exposing the query planner's cost model. Can be invoked with hypothetical indexes to simulate the behavior after adding indexes.
ParameterTypeDescription
analyzebooleanWhen True, actually runs the query to show real execution statistics instead of estimates. Takes longer but provides more accurate information.
hypothetical_indexesarrayA list of hypothetical indexes to simulate. Each index must be a dictionary with these keys: - 'table': The table name to add the index to (e.g., 'users') - 'columns': List of column names to include in the index (e.g., ['email'] or ['last_name', 'first_name']) - 'using': Optional index method (default: 'btree', other options include 'hash', 'gist', etc.) Examples: [ {"table": "users", "columns": ["email"], "using": "btree"}, {"table": "orders", "columns": ["user_id", "created_at"]} ] If there is no hypothetical index, you can pass an empty list.
sql *stringSQL query to explain
get_object_detailsProvides information about a specific database object, for example, a table's columns, constraints, and indexes.
ParameterTypeDescription
object_name *stringObject name
object_typestringObject type: 'table', 'view', 'sequence', or 'extension'
schema_name *stringSchema name
get_top_queriesReports the slowest SQL queries based on total execution time using `pg_stat_statements` data.
ParameterTypeDescription
limitintegerNumber of queries to return when ranking based on mean_time or total_time
sort_bystringRanking criteria: 'total_time' for total execution time or 'mean_time' for mean execution time per call, or 'resources' for resource-intensive queries
list_objectsLists database objects (tables, views, sequences, extensions) within a specified schema.
ParameterTypeDescription
object_typestringObject type: 'table', 'view', 'sequence', or 'extension'
schema_name *stringSchema name
list_schemasLists all database schemas available in the PostgreSQL instance.

Security checks

  • ✓README presentThe repository's README runs to about 4.9K words.
  • ✓License declaredThe repository declares the MIT license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionScanned 26 source files and found no eval, dynamic Function or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.3.0PostgreSQL MCP v0.3.0 · 16 May 2025Release v0.3.0 adds windows support and index optimization by LLM
v0.2.1PostgreSQL MCP v0.2.1 · 17 Apr 2025Relase 0.2.1 adds SSE support
v0.2.0PostgreSQL MCP v0.2.0 · 16 Apr 2025Relese v0.2.0
v0.1.1PostgreSQL MCP v0.1.1 · 8 Apr 2025Release v0.1.1

README

The repository's README runs to about 4.9K words, fetched 14 days ago. The original in the repository is authoritative.

Read full README
Questions

About crystaldba/postgres-mcp

How do I install crystaldba/postgres-mcp?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is crystaldba/postgres-mcp safe to use with an AI agent?

Its trust score is 88 out of 100 (strong). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. It has no ConduID identity yet, so agent calls to it are not receipted.

Is crystaldba/postgres-mcp still maintained?

Yes — the last commit was 2 days ago. The repository has 3.5K stars and 401 forks and 95 open issues.

What tools does crystaldba/postgres-mcp provide?

Conduid read 9 tools from the source: analyze_db_health, analyze_query_indexes, analyze_workload_indexes, execute_sql, explain_query, get_object_details, get_top_queries, list_objects and 1 more. 7 of them publish their parameters, listed under Tools above.

What license is crystaldba/postgres-mcp released under?

The repository declares the MIT license. That applies to the latest release, v0.3.0, as well.