├── .github └── workflows │ ├── build.yml │ └── docker-build-dockerhub.yml ├── .gitignore ├── .python-version ├── Dockerfile ├── LICENSE ├── README.md ├── assets └── postgres-mcp-pro.png ├── devenv.lock ├── devenv.nix ├── devenv.yaml ├── docker-entrypoint.sh ├── examples └── movie-app.md ├── justfile ├── pyproject.toml ├── smithery.yaml ├── src └── postgres_mcp │ ├── __init__.py │ ├── artifacts.py │ ├── database_health │ ├── __init__.py │ ├── buffer_health_calc.py │ ├── connection_health_calc.py │ ├── constraint_health_calc.py │ ├── database_health.py │ ├── index_health_calc.py │ ├── init.sql │ ├── replication_calc.py │ ├── sequence_health_calc.py │ └── vacuum_health_calc.py │ ├── explain │ ├── README.md │ ├── __init__.py │ └── explain_plan.py │ ├── index │ ├── dta_calc.py │ ├── index_opt_base.py │ ├── llm_opt.py │ └── presentation.py │ ├── server.py │ ├── sql │ ├── __init__.py │ ├── bind_params.py │ ├── extension_utils.py │ ├── index.py │ ├── safe_sql.py │ └── sql_driver.py │ └── top_queries │ ├── __init__.py │ └── top_queries_calc.py ├── tests ├── Dockerfile.postgres-hypopg ├── README.md ├── conftest.py ├── integration │ ├── dta │ │ └── test_dta_calc_integration.py │ └── test_top_queries_integration.py ├── unit │ ├── database_health │ │ └── test_database_health_tool.py │ ├── explain │ │ ├── test_explain_plan.py │ │ ├── test_explain_plan_real_db.py │ │ ├── test_server.py │ │ └── test_server_integration.py │ ├── index │ │ └── test_dta_calc.py │ ├── sql │ │ ├── test_db_conn_pool.py │ │ ├── test_obfuscate_password.py │ │ ├── test_readonly_enforcement.py │ │ ├── test_safe_sql.py │ │ └── test_sql_driver.py │ ├── test_access_mode.py │ └── top_queries │ │ └── test_top_queries_calc.py └── utils.py └── uv.lock /.github/workflows/build.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/.github/workflows/build.yml -------------------------------------------------------------------------------- /.github/workflows/docker-build-dockerhub.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/.github/workflows/docker-build-dockerhub.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/.gitignore -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.12 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/Dockerfile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/README.md -------------------------------------------------------------------------------- /assets/postgres-mcp-pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/assets/postgres-mcp-pro.png -------------------------------------------------------------------------------- /devenv.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/devenv.lock -------------------------------------------------------------------------------- /devenv.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/devenv.nix -------------------------------------------------------------------------------- /devenv.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/devenv.yaml -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/docker-entrypoint.sh -------------------------------------------------------------------------------- /examples/movie-app.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/examples/movie-app.md -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/justfile -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/pyproject.toml -------------------------------------------------------------------------------- /smithery.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/smithery.yaml -------------------------------------------------------------------------------- /src/postgres_mcp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/__init__.py -------------------------------------------------------------------------------- /src/postgres_mcp/artifacts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/artifacts.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/__init__.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/buffer_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/buffer_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/connection_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/connection_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/constraint_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/constraint_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/database_health.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/database_health.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/index_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/index_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/init.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/init.sql -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/replication_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/replication_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/sequence_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/sequence_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/database_health/vacuum_health_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/database_health/vacuum_health_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/explain/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/explain/README.md -------------------------------------------------------------------------------- /src/postgres_mcp/explain/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/explain/__init__.py -------------------------------------------------------------------------------- /src/postgres_mcp/explain/explain_plan.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/explain/explain_plan.py -------------------------------------------------------------------------------- /src/postgres_mcp/index/dta_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/index/dta_calc.py -------------------------------------------------------------------------------- /src/postgres_mcp/index/index_opt_base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/index/index_opt_base.py -------------------------------------------------------------------------------- /src/postgres_mcp/index/llm_opt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/index/llm_opt.py -------------------------------------------------------------------------------- /src/postgres_mcp/index/presentation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/index/presentation.py -------------------------------------------------------------------------------- /src/postgres_mcp/server.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/server.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/__init__.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/bind_params.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/bind_params.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/extension_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/extension_utils.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/index.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/index.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/safe_sql.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/safe_sql.py -------------------------------------------------------------------------------- /src/postgres_mcp/sql/sql_driver.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/sql/sql_driver.py -------------------------------------------------------------------------------- /src/postgres_mcp/top_queries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/top_queries/__init__.py -------------------------------------------------------------------------------- /src/postgres_mcp/top_queries/top_queries_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/src/postgres_mcp/top_queries/top_queries_calc.py -------------------------------------------------------------------------------- /tests/Dockerfile.postgres-hypopg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/Dockerfile.postgres-hypopg -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/README.md -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/conftest.py -------------------------------------------------------------------------------- /tests/integration/dta/test_dta_calc_integration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/integration/dta/test_dta_calc_integration.py -------------------------------------------------------------------------------- /tests/integration/test_top_queries_integration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/integration/test_top_queries_integration.py -------------------------------------------------------------------------------- /tests/unit/database_health/test_database_health_tool.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/database_health/test_database_health_tool.py -------------------------------------------------------------------------------- /tests/unit/explain/test_explain_plan.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/explain/test_explain_plan.py -------------------------------------------------------------------------------- /tests/unit/explain/test_explain_plan_real_db.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/explain/test_explain_plan_real_db.py -------------------------------------------------------------------------------- /tests/unit/explain/test_server.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/explain/test_server.py -------------------------------------------------------------------------------- /tests/unit/explain/test_server_integration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/explain/test_server_integration.py -------------------------------------------------------------------------------- /tests/unit/index/test_dta_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/index/test_dta_calc.py -------------------------------------------------------------------------------- /tests/unit/sql/test_db_conn_pool.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/sql/test_db_conn_pool.py -------------------------------------------------------------------------------- /tests/unit/sql/test_obfuscate_password.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/sql/test_obfuscate_password.py -------------------------------------------------------------------------------- /tests/unit/sql/test_readonly_enforcement.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/sql/test_readonly_enforcement.py -------------------------------------------------------------------------------- /tests/unit/sql/test_safe_sql.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/sql/test_safe_sql.py -------------------------------------------------------------------------------- /tests/unit/sql/test_sql_driver.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/sql/test_sql_driver.py -------------------------------------------------------------------------------- /tests/unit/test_access_mode.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/test_access_mode.py -------------------------------------------------------------------------------- /tests/unit/top_queries/test_top_queries_calc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/unit/top_queries/test_top_queries_calc.py -------------------------------------------------------------------------------- /tests/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/tests/utils.py -------------------------------------------------------------------------------- /uv.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crystaldba/postgres-mcp/HEAD/uv.lock --------------------------------------------------------------------------------