|
| 1 | +# 🧪 Tutorial: MIMIC + Jupyter Pipeline |
| 2 | +# 🧪 Tutorial: MIMIC + Jupyter Pipeline |
| 3 | + |
| 4 | +This tutorial shows how to **stack two MCPs**: |
| 5 | + |
| 6 | +- **MIMIC** (conversational AI on the MIMIC-IV clinical database) |
| 7 | +- **Jupyter** (reproducible notebook analysis) |
| 8 | + |
| 9 | +You’ll learn how to: |
| 10 | + |
| 11 | +1. Build a pipeline with both tools |
| 12 | +2. Ask natural language questions over MIMIC-IV |
| 13 | +3. Export results into a Jupyter Notebook for reproducible Python analysis |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## 🎥 Video Walkthrough |
| 18 | + |
| 19 | +<iframe width="860" height="515" src="https://www.youtube.com/embed/uTjIbN0GSHU?si=4rwoYmX32y9Cs6vs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 🔧 Step 1 — Build with Pipeline W/ MIMIC Default |
| 24 | + |
| 25 | +MIMIC Default is basically using the default MIMIC-IV demo database. |
| 26 | + |
| 27 | +```bash |
| 28 | +uv run mcpstack pipeline mimic --new-pipeline my_pipeline.json |
| 29 | +``` |
| 30 | + |
| 31 | +## 🔧 Step 2 — Create a Jupyter `ToolConfig` |
| 32 | + |
| 33 | +Basically, Jupyter MCP works with some sort of connections between the LLM and the Jupyter instance. This is via a |
| 34 | +URL and a TOKEN. Hence, the need for a `ToolConfig`. |
| 35 | + |
| 36 | +```bash |
| 37 | +uv run mcpstack tools jupyter configure \ |
| 38 | + --token YOUR_JUPYTER_TOKEN |
| 39 | + |
| 40 | +# This create a `jupyter_config.json` file |
| 41 | +``` |
| 42 | + |
| 43 | +## 🔧 Step 3 — Add To The Tool To The Pipeline |
| 44 | + |
| 45 | +```bash |
| 46 | +uv run mcpstack pipeline mimic --to-pipeline my_pipeline.json --tool-config jupyter_config.json |
| 47 | +``` |
| 48 | + |
| 49 | +## 🔧 Step 4 — Compose & Run the Pipeline On Claude Desktop |
| 50 | + |
| 51 | +```bash |
| 52 | +uv run mcpstack build --pipeline my_pipeline.json --config-type claude |
| 53 | +``` |
| 54 | + |
| 55 | +Now you can ask the LLM to operate the MIMIC tool and export results into Jupyter. |
| 56 | + |
| 57 | +## 📣 Prompt Used During The Demo Video |
| 58 | + |
| 59 | +```text |
| 60 | +Hey there! May you extract 50 patients from MIMIC-IV and do a quick reproducible analysis of the data with pandas |
| 61 | +for me please? |
| 62 | +
|
| 63 | +If you need to add packages, `!uv add <package_name>`. |
| 64 | +``` |
| 65 | + |
| 66 | +!!! tip |
| 67 | + Try chaining additional tools (e.g., scikit-longitudinal) to build research-ready clinical workflows. |
0 commit comments