M3

v1.0.0โ€ขData Science & MLโ€ขstable

๐Ÿฅ๐Ÿค– Query MIMIC-IV medical data using natural language through Model Context Protocol (MCP). Transform healthcare research with AI-powered database interactions - supports both local MIMIC-IV SQLite demo dataset and full BigQuery datasets.

m3mcpai-integration
Share:
71
Stars
0
Downloads
0
Weekly
0/5

What is M3?

M3 is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐Ÿฅ๐Ÿค– query mimic-iv medical data using natural language through model context protocol (mcp). transform healthcare research with ai-powered database interactions - supports both local mimic-iv sqlite ...

๐Ÿฅ๐Ÿค– Query MIMIC-IV medical data using natural language through Model Context Protocol (MCP). Transform healthcare research with AI-powered database interactions - supports both local MIMIC-IV SQLite demo dataset and full BigQuery datasets.

This server falls under the Data Science & ML and Databases categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • ๐Ÿฅ๐Ÿค– Query MIMIC-IV medical data using natural language throug

Use Cases

Query MIMIC-IV medical research datasets using natural language.
Analyze healthcare data through BigQuery or local SQLite.
Perform medical research queries without writing SQL.
rafiattrach

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx m3

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use M3

M3 (MIMIC-IV Medical data via MCP) is an MCP server that lets AI assistants query the MIMIC-IV clinical database โ€” a large-scale, de-identified dataset of ICU patient records from Beth Israel Deaconess Medical Center โ€” using natural language instead of raw SQL. It supports both a local DuckDB backend using the MIMIC-IV demo dataset and a full BigQuery backend for the complete dataset, exposing six focused tools: schema inspection, table info, SQL execution, ICU stay retrieval, lab result queries, and demographic breakdowns. Healthcare researchers, data scientists, and clinical informaticists can use it to explore patient populations, analyze lab trends, and run cohort queries without needing deep SQL expertise.

Prerequisites

  • Python 3.10+ and uv package manager installed
  • For local demo mode: no additional accounts required โ€” the demo dataset is downloaded automatically
  • For full MIMIC-IV: a PhysioNet credentialed account with MIMIC-IV access and a Google Cloud project with BigQuery enabled
  • m3-mcp Python package (installable via uv or pip)
  • An MCP-compatible client such as Claude Desktop
1

Initialize the project and install m3-mcp

Create a project directory, initialize a uv project, and install the m3-mcp package.

mkdir m3 && cd m3
uv init && uv add m3-mcp
2

Initialize the MIMIC-IV demo dataset

Run the init command with 'mimic-iv-demo' to download and prepare the demo SQLite database locally. For the full dataset use 'mimic-iv-full' (requires BigQuery credentials).

uv run m3 init mimic-iv-demo
3

Run the quick configuration wizard

The --quick flag sets up a default configuration for the local DuckDB backend.

uv run m3 config --quick
4

Configure Claude Desktop (local DuckDB mode)

Add the server to your claude_desktop_config.json using uvx to run m3-mcp with the DuckDB backend.

{
  "mcpServers": {
    "m3": {
      "command": "uvx",
      "args": ["m3-mcp"],
      "env": {
        "M3_BACKEND": "duckdb"
      }
    }
  }
}
5

Or configure for BigQuery (full dataset)

For the full MIMIC-IV dataset on BigQuery, set M3_BACKEND=bigquery and provide your Google Cloud project ID. Ensure Application Default Credentials are configured.

{
  "mcpServers": {
    "m3": {
      "command": "uvx",
      "args": ["m3-mcp"],
      "env": {
        "M3_BACKEND": "bigquery",
        "M3_PROJECT_ID": "your-gcp-project-id"
      }
    }
  }
}
6

Restart Claude Desktop and verify

Restart Claude Desktop. Ask Claude to list the available tables in the MIMIC-IV database to confirm the server is connected and the schema is accessible.

M3 Examples

Client configuration (Claude Desktop โ€” local DuckDB)

Minimal configuration for the local MIMIC-IV demo dataset using DuckDB. No BigQuery or cloud credentials needed.

{
  "mcpServers": {
    "m3": {
      "command": "uvx",
      "args": ["m3-mcp"],
      "env": {
        "M3_BACKEND": "duckdb"
      }
    }
  }
}

Prompts to try

Query the MIMIC-IV database with natural language โ€” Claude translates your questions into the appropriate tool calls.

- "What tables are available in the MIMIC-IV database?"
- "Show me the race distribution across all hospital admissions"
- "What is the average ICU length of stay for patients admitted with sepsis?"
- "Retrieve the most recent lab results for patient subject_id 10006"
- "How many unique patients are in the admissions table?"

Troubleshooting M3

DuckDB database file not found on startup

Run 'uv run m3 init mimic-iv-demo' from your m3 project directory before starting the server. This downloads and prepares the demo dataset. The server expects the database to exist at the path configured during init.

BigQuery connection fails with authentication error

Run 'gcloud auth application-default login' to set up Application Default Credentials for your Google Cloud account. Ensure M3_PROJECT_ID is set to a project that has BigQuery enabled and that your account has been granted access to the MIMIC-IV BigQuery dataset on PhysioNet.

execute_mimic_query returns a permission error for non-SELECT statements

The tool only allows SELECT statements for data safety. INSERT, UPDATE, DELETE, and DDL operations are blocked by design. Rephrase your request as a read-only query.

Frequently Asked Questions about M3

What is M3?

M3 is a Model Context Protocol (MCP) server that ๐Ÿฅ๐Ÿค– query mimic-iv medical data using natural language through model context protocol (mcp). transform healthcare research with ai-powered database interactions - supports both local mimic-iv sqlite demo dataset and full bigquery datasets. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install M3?

Follow the installation instructions on the M3 GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with M3?

M3 works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is M3 free to use?

Yes, M3 is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "m3": { "command": "npx", "args": ["-y", "m3"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

Ready to use M3?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides