Skip to content

๐Ÿงช Tutorial: MIMIC + Jupyter Pipeline

๐Ÿงช Tutorial: MIMIC + Jupyter Pipeline

This tutorial shows how to stack two MCPs:

  • MIMIC (conversational AI on the MIMIC-IV clinical database)
  • Jupyter (reproducible notebook analysis)

Youโ€™ll learn how to:

  1. Build a pipeline with both tools
  2. Ask natural language questions over MIMIC-IV
  3. Export results into a Jupyter Notebook for reproducible Python analysis

๐ŸŽฅ Video Walkthrough


Prerequisites

# If you prefer other Python package managers, feel free to adapt `pip install X`.

uv init --python 3.10
uv add mcpstack
uv add mcpstack-jupyter
uv add mcpstack-mimic

# To see if the tools are all connected
uv run mcpstack list-tools

๐Ÿ”ง Step 1 โ€” Build with Pipeline W/ MIMIC Default

MIMIC Default is basically using the default MIMIC-IV demo database.

uv run mcpstack pipeline mimic --new-pipeline my_pipeline.json

๐Ÿ”ง Step 2 โ€” Create a Jupyter ToolConfig

Basically, Jupyter MCP works with some sort of connections between the LLM and the Jupyter instance. This is via a URL and a TOKEN. Hence, the need for a ToolConfig.

uv run mcpstack tools jupyter configure \
    --token YOUR_JUPYTER_TOKEN

# This create a `jupyter_config.json` file

๐Ÿ”ง Step 3 โ€” Add To The Tool To The Pipeline

uv run mcpstack pipeline jupyter --to-pipeline my_pipeline.json --tool-config jupyter_config.json

๐Ÿ”ง Step 4 โ€” Compose & Run the Pipeline On Claude Desktop

uv run mcpstack build --pipeline my_pipeline.json --config-type claude

Now you can ask the LLM to operate the MIMIC tool and export results into Jupyter.

๐Ÿ“ฃ Prompt Used During The Demo Video

Hey there! May you extract 50 patients from MIMIC-IV and do a quick reproducible analysis of the data with pandas
for me please?

If you need to add packages, `!uv add <package_name>`.

Tip

Try chaining additional tools (e.g., scikit-longitudinal) to build research-ready clinical workflows.