MCP Server × PostgreSQL on MIMIC‑IV
@ambakick
About MCP Server × PostgreSQL on MIMIC‑IV
No overview available yet
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mimic-mcp-server": {
"command": "python",
"args": [
"02_bulk_copy.py",
"--csv-root",
"/path/to/mimic-iv"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP Server × PostgreSQL on MIMIC‑IV?
This project evaluates whether a Model Context Protocol (MCP) server layered on Azure Database for PostgreSQL can match or outperform direct SQL while reducing developer effort for large‑scale clinical analytics on the MIMIC‑IV dataset.
How to use MCP Server × PostgreSQL on MIMIC‑IV?
Install Python 3.10+ and required libraries (psycopg, mcp[cli], azure‑identity, etc.). Load MIMIC‑IV data into an Azure Database for PostgreSQL Flexible Server using the provided SQL scripts and bulk copy script. Start the MCP server by running python azure_postgresql_mcp.py with environment variables PGHOST, PGUSER, PGPASSWORD, PGDATABASE set (or use Microsoft Entra authentication by setting AZURE_USE_AAD=True). Benchmarks can be run with python benchmarks/run_sql.py --query <name> for direct SQL or python benchmarks/run_mcp.py --query <name> for the MCP server.
Key features of MCP Server × PostgreSQL on MIMIC‑IV
- MCP‑based abstraction over Azure Database for PostgreSQL.
- Designed for clinical dataset MIMIC‑IV (millions of rows, hundreds of attributes).
- Supports both password and Microsoft Entra authentication.
- Includes benchmark scripts to compare performance with direct SQL.
- Example benchmarks show up to 33% faster query execution for COUNT(*) on EMAR data.
- Reduces lines of code (LOC) by 66% compared to raw SQL for a sample workload.
Use cases of MCP Server × PostgreSQL on MIMIC‑IV
- Perform large‑scale clinical analytics on MIMIC‑IV without writing raw SQL.
- Compare developer productivity and runtime performance between MCP‑mediated and direct SQL workflows.
- Evaluate MCP server suitability for other PostgreSQL‑backed healthcare or research databases.
FAQ from MCP Server × PostgreSQL on MIMIC‑IV
What is the goal of this project?
To evaluate whether an MCP server on Azure PostgreSQL can improve developer productivity and maintain or enhance runtime efficiency compared to direct SQL for clinical analytics on MIMIC‑IV.
What are the prerequisites for running the server?
Python 3.10+, Node 18+ (optional), an Azure Database for PostgreSQL – Flexible Server (Standard_D4s v5 or larger), MIMIC‑IV credentials and data download permission, and the Python packages listed in the README.
How do I start the MCP server?
Set the required environment variables (PGHOST, PGUSER, PGPASSWORD, PGDATABASE) or configure Entra ID authentication, then run python azure_postgresql_mcp.py from the mcp-server directory.
What are the key performance results?
For a COUNT(*) on emar_detail (≈87 million rows), the MCP server averaged 67,560 ms vs. direct SQL’s 101,550 ms, a 33% improvement. The MCP implementation required 23 lines of code vs. 68 for direct SQL.
Where can I find the data loading scripts?
Data loading scripts are in the mimic-postgres/ directory, including SQL schema files and a bulk copy script (02_bulk_copy.py). Estimated ingest time on Standard_D4s is ~45 minutes for 72 GB of data.
More Databases MCP servers

Redis
modelcontextprotocolModel Context Protocol Servers
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.

PostgreSQL
modelcontextprotocolModel Context Protocol Servers
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
MotherDuck's DuckDB MCP Server
motherduckdbLocal MCP server for DuckDB and MotherDuck
Comments