MIMIC-IV MCPStack tool (standalone package) with pluggable SQLite/BigQuery backends.
Project description
[!IMPORTANT] If you have not been across the MCPStack main orchestrator repository, please start there: View MCPStack
💡 About The MCPStack MIMIC Tool
MCPStack MIMIC is an MCP tool that connects the MIMIC-IV clinical database (with either SQLite or BigQuery backends)
into your MCPStack pipelines.
In layman's terms:
- MIMIC-IV is a large, de-identified database of ICU patient records, commonly used for healthcare research.
- This tool makes that dataset accessible to an LLM in a controlled way.
- It provides actions like listing available tables, showing table structure with sample data, and running queries; all exposed through MCP so your model can reason with healthcare data securely.
What is MCPStack, in layman's terms?
The Model Context Protocol (MCP) standardises how tools talk to large language models.
MCPStack is the orchestrator: it lets you stack multiple MCP tools together into a pipeline and then expose them
inside an LLM environment (like Claude Desktop).
Think of it like scikit-learn pipelines, but for LLMs:
- In scikit-learn: you chain
preprocessors,transformers,estimators. - In MCPStack: you chain MCP tools (like MIMIC, Jupyter Notebook MCP, etc).
[!IMPORTANT] This MCP has been made possible thanks to the
M3original work by @rafiattrach, @rajna-fani, @MoreiraP12 Under Dr. Leo Celi's supervision at MIT Lab for Computational Physiology. Following a first pull request of MCPStack toM3, we realised that we needed to externalise MCPStack to make it more modular and reusable across different use-cases. As such, MCPStack MIMIC is a copy of the originalM3codebase, with adjustments only based on how how MCPStack works, and how it is structured.
Installation
You can install the MIMIC tool as a standalone package. Thanks to pyproject.toml entry points, MCPStack
will auto-discover it.
PyPI Installation Via UV
uv add mcpstack_mimic
PyPI Installation Via pip
pip install mcpstack-mimic
Install pre-commit hooks (optional, for development)
uv run pre-commit install
# or pip install pre-commit
Run Unit Tests (optional, for development)
uv run pytest
🔌 Using With MCPStack
The MIMIC tool is auto-registered in MCPStack through its entry points:
[project.entry-points."mcpstack.tools"]
mimic = "mcpstack_mimic.tools.mimic.mimic:MIMIC"
That means MCPStack will “see” it without any extra configuration.
Initialise the database
For SQLite (demo dataset by default):
uv run mcpstack tools mimic init --dataset mimic-iv-demo
This downloads and prepares the dataset locally.
Configure the tool
Pick a backend (SQLite or BigQuery):
uv run mcpstack tools mimic configure --backend sqlite --db-path ./mimic.db
or
uv run mcpstack tools mimic configure --backend bigquery --project-id <YOUR_GCP_PROJECT>
This generates a mimic_config.json you can later feed into pipelines.
Check status
uv run mcpstack tools mimic status
[!NOTE] We favourite
uvfor running MCPStack commands, but you can also usemcpstackdirectly if installed globally withpip install mcpstack.
🖇️ Build A Pipeline With MIMIC
Now that the tool is installed and configured, add it to your pipeline:
Default MIMIC Pipeline (Runs with demo MIMIC dataset)
uv run mcpstack pipeline mimic --new-pipeline my_pipeline.json
Create a new pipeline and add MIMIC previously custom-configured
uv run mcpstack pipeline mimic --new-pipeline my_pipeline.json --tool-config mimic_config.json
Or append to an existing pipeline
uv run mcpstack pipeline mimic --to-pipeline existing_pipeline.json --tool-config mimic_config.json
Run it inside Claude Desktop
uv run mcpstack build --pipeline my_pipeline.json
Your LLM can now use the MIMIC tool in conversation, with secure access to the clinical dataset. Open Claude Desktop, and tada!
📖 Programmatic API
from mcpstack_mimic.tools.mimic.mimic import MIMIC
from mcpstack_mimic.tools.mimic.backend.backends.sqlite import SQLiteBackend
from mcpstack.stack import MCPStackCore
pipeline = (
MCPStackCore() #define =config if needed
.with_tool(MIMIC(
backends=[
SQLiteBackend("<path_to_your_mimic.db>") # SQLite backend with local MIMIC-IV database
])
# Here you can add as many as new `.with_tool(.)` of interest to play with.
).build(
type="fastmcp",
save_path="my_mimic_pipeline.json",
).run()
)
[!IMPORTANT] The current repository has (1) technical debts, as in it would benefit from a refactor to make it maybe less messy; for instance, organising the actions into specific files. (2) a lack of documentation, the readme could deserve more in depth exploration of all the possible configurations, explore the code if you are a developer ; it is a little codebase. Pull Requests are more than welcome to minimise the tech debts and improve the documentation.
📽️ Video Demo
🔐 License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpstack_mimic-0.0.1.tar.gz.
File metadata
- Download URL: mcpstack_mimic-0.0.1.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2839bd61a5615bf359ae0eeff5fbab8df061e6ec517520daff42e46077d86cb6
|
|
| MD5 |
28f99528f68b2ec0be65e01d7d270c84
|
|
| BLAKE2b-256 |
935c9c1c28c90f807cf3cb7543a48c165208fa1f06fb49f57cba6303fd949132
|
Provenance
The following attestation bundles were made for mcpstack_mimic-0.0.1.tar.gz:
Publisher:
publish.yaml on MCP-Pipeline/mcpstack-mimic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpstack_mimic-0.0.1.tar.gz -
Subject digest:
2839bd61a5615bf359ae0eeff5fbab8df061e6ec517520daff42e46077d86cb6 - Sigstore transparency entry: 411857755
- Sigstore integration time:
-
Permalink:
MCP-Pipeline/mcpstack-mimic@5cfb54e9d9ab3e25fd3f75d25b9781b2d8db2b7f -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/MCP-Pipeline
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@5cfb54e9d9ab3e25fd3f75d25b9781b2d8db2b7f -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcpstack_mimic-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mcpstack_mimic-0.0.1-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b08454cfc5db58c354eaaae638045d45d7bc504d53c7279ee196ce7b24a69c
|
|
| MD5 |
74fde777dffc6a27ae9ff809be8d9b65
|
|
| BLAKE2b-256 |
bb4a99abb002a01a58f6864ee682bd34f46a652480224ca6a93b6e5437be6a8a
|
Provenance
The following attestation bundles were made for mcpstack_mimic-0.0.1-py3-none-any.whl:
Publisher:
publish.yaml on MCP-Pipeline/mcpstack-mimic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpstack_mimic-0.0.1-py3-none-any.whl -
Subject digest:
e1b08454cfc5db58c354eaaae638045d45d7bc504d53c7279ee196ce7b24a69c - Sigstore transparency entry: 411857765
- Sigstore integration time:
-
Permalink:
MCP-Pipeline/mcpstack-mimic@5cfb54e9d9ab3e25fd3f75d25b9781b2d8db2b7f -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/MCP-Pipeline
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@5cfb54e9d9ab3e25fd3f75d25b9781b2d8db2b7f -
Trigger Event:
push
-
Statement type: