# M3: MIMIC-IV + MCP + Models ๐ฅ๐ค
> **Query MIMIC-IV medical data using natural language through MCP clients**
<a href="https://www.python.org/downloads/"><img alt="Python" src="https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white"></a>
<a href="https://modelcontextprotocol.io/"><img alt="MCP" src="https://img.shields.io/badge/MCP-Compatible-green?logo=ai&logoColor=white"></a>
<a href="https://github.com/rafiattrach/m3/actions/workflows/tests.yaml"><img alt="Tests" src="https://github.com/rafiattrach/m3/actions/workflows/tests.yaml/badge.svg"></a>
<a href="https://github.com/rafiattrach/m3/actions/workflows/pre-commit.yaml"><img alt="Code Quality" src="https://github.com/rafiattrach/m3/actions/workflows/pre-commit.yaml/badge.svg"></a>
<a href="https://github.com/rafiattrach/m3/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
Transform medical data analysis with AI! Ask questions about MIMIC-IV data in plain English and get instant insights. Choose between local demo data (free) or full cloud dataset (BigQuery).
## โจ Features
- ๐ **Natural Language Queries**: Ask questions about MIMIC-IV data in plain English
- ๐ **Local SQLite**: Fast queries on demo database (free, no setup)
- โ๏ธ **BigQuery Support**: Access full MIMIC-IV dataset on Google Cloud
- ๐ **Enterprise Security**: OAuth2 authentication with JWT tokens and rate limiting
- ๐ก๏ธ **SQL Injection Protection**: Read-only queries with comprehensive validation
## ๐ Quick Start
> ๐ก **Need more options?** Run `m3 --help` to see all available commands and options.
### ๐ฆ Installation
Choose your preferred installation method:
#### Option A: Install from PyPI (Recommended)
**Step 1: Create Virtual Environment**
```bash
# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
```
**Step 2: Install M3**
```bash
# Install M3
pip install m3-mcp
```
#### Option B: Install from Source
#### Using standard `pip`
**Step 1: Clone and Navigate**
```bash
# Clone the repository
git clone https://github.com/rafiattrach/m3.git
cd m3
```
**Step 2: Create Virtual Environment**
```bash
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
```
**Step 3: Install M3**
```bash
# Install M3
pip install .
```
#### Using `UV` (Recommended)
Assuming you have [UV](https://docs.astral.sh/uv/getting-started/installation/) installed.
**Step 1: Clone and Navigate**
```bash
# Clone the repository
git clone https://github.com/rafiattrach/m3.git
cd m3
```
**Step 2: Create `UV` Virtual Environment**
```bash
# Create virtual environment
uv venv
```
**Step 3: Install M3**
```bash
uv sync
# Do not forget to use `uv run` to any subsequent commands to ensure you're using the `uv` virtual environment
```
### ๐๏ธ Database Configuration
After installation, choose your data source:
#### Option A: Local Demo Database (Recommended for Beginners)
**Perfect for learning and development - completely free!**
1. **Download demo database**:
```bash
m3 init mimic-iv-demo
```
2. **Setup MCP Client**:
```bash
m3 config
```
*Alternative: For Claude Desktop specifically:*
```bash
m3 config claude
```
3. **Restart your MCP client** and ask:
- "What tools do you have for MIMIC-IV data?"
- "Show me patient demographics from the ICU"
#### Option B: BigQuery (Full Dataset)
**For researchers needing complete MIMIC-IV data**
##### Prerequisites
- Google Cloud account and project with billing enabled
- Access to MIMIC-IV on BigQuery (requires PhysioNet credentialing)
##### Setup Steps
1. **Install Google Cloud CLI**:
**macOS (with Homebrew):**
```bash
brew install google-cloud-sdk
```
**Windows:** Download from https://cloud.google.com/sdk/docs/install
**Linux:**
```bash
curl https://sdk.cloud.google.com | bash
```
2. **Authenticate**:
```bash
gcloud auth application-default login
```
*This will open your browser - choose the Google account that has access to your BigQuery project with MIMIC-IV data.*
3. **Setup MCP Client for BigQuery**:
```bash
m3 config
```
*Alternative: For Claude Desktop specifically:*
```bash
m3 config claude --backend bigquery --project-id YOUR_PROJECT_ID
```
4. **Test BigQuery Access** - Restart your MCP client and ask:
```
Use the get_race_distribution function to show me the top 5 races in MIMIC-IV admissions.
```
## ๐ง Advanced Configuration
Need to configure other MCP clients or customize settings? Use these commands:
### Interactive Configuration (Universal)
```bash
m3 config
```
Generates configuration for any MCP client with step-by-step guidance.
### Quick Configuration Examples
```bash
# Quick universal config with defaults
m3 config --quick
# Universal config with custom database
m3 config --quick --backend sqlite --db-path /path/to/database.db
# Save config to file for other MCP clients
m3 config --output my_config.json
```
### ๐ OAuth2 Authentication (Optional)
For production deployments requiring secure access to medical data:
```bash
# Enable OAuth2 with Claude Desktop
m3 config claude --enable-oauth2 \
--oauth2-issuer https://your-auth-provider.com \
--oauth2-audience m3-api \
--oauth2-scopes "read:mimic-data"
# Or configure interactively
m3 config # Choose OAuth2 option during setup
```
**Supported OAuth2 Providers:**
- Auth0, Google Identity Platform, Microsoft Azure AD, Keycloak
- Any OAuth2/OpenID Connect compliant provider
**Key Benefits:**
- ๐ **JWT Token Validation**: Industry-standard security
- ๐ฏ **Scope-based Access**: Fine-grained permissions
- ๐ก๏ธ **Rate Limiting**: Abuse protection
- ๐ **Audit Logging**: Security monitoring
> ๐ **Complete OAuth2 Setup Guide**: See [`docs/OAUTH2_AUTHENTICATION.md`](docs/OAUTH2_AUTHENTICATION.md) for detailed configuration, troubleshooting, and production deployment guidelines.
### Backend Comparison
**SQLite Backend (Default)**
- โ
**Free**: No cloud costs
- โ
**Fast**: Local queries
- โ
**Easy**: No authentication needed
- โ **Limited**: Demo dataset only (~1k records)
**BigQuery Backend**
- โ
**Complete**: Full MIMIC-IV dataset (~500k admissions)
- โ
**Scalable**: Google Cloud infrastructure
- โ
**Current**: Latest MIMIC-IV version (3.1)
- โ **Costs**: BigQuery usage fees apply
## ๐ ๏ธ Available MCP Tools
When your MCP client processes questions, it uses these tools automatically:
- **get_database_schema**: List all available tables
- **get_table_info**: Get column info and sample data for a table
- **execute_mimic_query**: Execute SQL SELECT queries
- **get_icu_stays**: ICU stay information and length of stay data
- **get_lab_results**: Laboratory test results
- **get_race_distribution**: Patient race distribution
## ๐งช Example Prompts
Try asking your MCP client these questions:
**Demographics & Statistics:**
- `Prompt:` *What is the race distribution in MIMIC-IV admissions?*
- `Prompt:` *Show me patient demographics for ICU stays*
- `Prompt:` *How many total admissions are in the database?*
**Clinical Data:**
- `Prompt:` *Find lab results for patient X*
- `Prompt:` *What lab tests are most commonly ordered?*
- `Prompt:` *Show me recent ICU admissions*
**Data Exploration:**
- `Prompt:` *What tables are available in the database?*
- `Prompt:` *What tools do you have for MIMIC-IV data?*
## ๐ฉ Pro Tips
- Do you want to pre-approve the usage of all tools in Claude Desktop? Use the prompt below and then select **Always Allow**
- `Prompt:` *Can you please call all your tools in a logical sequence?*
## ๐ Troubleshooting
### Common Issues
**SQLite "Database not found" errors:**
```bash
# Re-download demo database
m3 init mimic-iv-demo
```
**MCP client server not starting:**
1. Check your MCP client logs (for Claude Desktop: Help โ View Logs)
2. Verify configuration file location and format
3. Restart your MCP client completely
### OAuth2 Authentication Issues
**"Missing OAuth2 access token" errors:**
```bash
# Set your access token
export M3_OAUTH2_TOKEN="Bearer your-access-token-here"
```
**"OAuth2 authentication failed" errors:**
- Verify your token hasn't expired
- Check that required scopes are included in your token
- Ensure your OAuth2 provider configuration is correct
**Rate limit exceeded:**
- Wait for the rate limit window to reset
- Contact your administrator to adjust limits if needed
> ๐ง **OAuth2 Troubleshooting**: See [`OAUTH2_AUTHENTICATION.md`](docs/OAUTH2_AUTHENTICATION.md) for detailed OAuth2 troubleshooting and configuration guides.
### BigQuery Issues
**"Access Denied" errors:**
- Ensure you have MIMIC-IV access on PhysioNet
- Verify your Google Cloud project has BigQuery API enabled
- Check that you're authenticated: `gcloud auth list`
**"Dataset not found" errors:**
- Confirm your project ID is correct
- Ensure you have access to `physionet-data` project
**Authentication issues:**
```bash
# Re-authenticate
gcloud auth application-default login
# Check current authentication
gcloud auth list
```
## ๐ฉโ๐ป For Developers
### Development Setup
#### Option A: Standard `pip` Development Setup
**Step 1: Clone and Navigate**
```bash
# Clone the repository
git clone https://github.com/rafiattrach/m3.git
cd m3
```
**Step 2: Create and Activate Virtual Environment**
```bash
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
```
**Step 3: Install Development Dependencies**
```bash
# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
```
#### Option B: Development Setup with `UV` (Recommended)
**Step 1: Clone and Navigate**
```bash
# Clone the repository
git clone https://github.com/rafiattrach/m3.git
cd m3
```
**Step 2: Create and Activate `UV` Virtual Environment**
```bash
# Create virtual environment
uv venv
```
**Step 3: Install Development Dependencies**
```bash
# Install in development mode with dev dependencies (by default, UV runs in editable mode)
uv sync
# Install pre-commit hooks
uv run pre-commit install
# Do not forget to use `uv run` to any subsequent commands to ensure you're using the `uv` virtual environment
```
### Testing
```bash
pytest # All tests (includes OAuth2 and BigQuery mocks)
pytest tests/test_mcp_server.py -v # MCP server tests
pytest tests/test_oauth2_auth.py -v # OAuth2 authentication tests
```
### Test BigQuery Locally
```bash
# Set environment variables
export M3_BACKEND=bigquery
export M3_PROJECT_ID=your-project-id
export GOOGLE_CLOUD_PROJECT=your-project-id
# Optional: Test with OAuth2 authentication
export M3_OAUTH2_ENABLED=true
export M3_OAUTH2_ISSUER_URL=https://your-provider.com
export M3_OAUTH2_AUDIENCE=m3-api
export M3_OAUTH2_TOKEN="Bearer your-test-token"
# Test MCP server
m3-mcp-server
```
## ๐ฎ Roadmap
- ๐ **Local Full Dataset**: Complete MIMIC-IV locally (no cloud costs)
- ๐ง **Advanced Tools**: More specialized medical data functions
- ๐ **Visualization**: Built-in plotting and charting tools
- ๐ **Enhanced Security**: Role-based access control, audit logging
- ๐ **Multi-tenant Support**: Organization-level data isolation
## ๐ค Contributing
We welcome contributions! Please:
1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Submit a pull request
*Built with โค๏ธ for the medical AI community*
**Need help?** Open an issue on GitHub or check our troubleshooting guide above.
Raw data
{
"_id": null,
"home_page": null,
"name": "m3-mcp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Rafi Al Attrach <rafiaa@mit.edu>, Pedro Moreira <pedrojfm@mit.edu>, Rajna Fani <rajnaf@mit.edu>",
"keywords": "mimic-iv, clinical-data, mcp, llm, medical, healthcare, sqlite, bigquery",
"author": null,
"author_email": "Rafi Al Attrach <rafiaa@mit.edu>, Pedro Moreira <pedrojfm@mit.edu>, Rajna Fani <rajnaf@mit.edu>",
"download_url": "https://files.pythonhosted.org/packages/74/58/a6bae0f773531ea80b3f6db3d1a76a21351173d5ad00c44824419ed95786/m3_mcp-0.2.0.tar.gz",
"platform": null,
"description": "# M3: MIMIC-IV + MCP + Models \ud83c\udfe5\ud83e\udd16\n\n> **Query MIMIC-IV medical data using natural language through MCP clients**\n\n<a href=\"https://www.python.org/downloads/\"><img alt=\"Python\" src=\"https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white\"></a>\n<a href=\"https://modelcontextprotocol.io/\"><img alt=\"MCP\" src=\"https://img.shields.io/badge/MCP-Compatible-green?logo=ai&logoColor=white\"></a>\n<a href=\"https://github.com/rafiattrach/m3/actions/workflows/tests.yaml\"><img alt=\"Tests\" src=\"https://github.com/rafiattrach/m3/actions/workflows/tests.yaml/badge.svg\"></a>\n<a href=\"https://github.com/rafiattrach/m3/actions/workflows/pre-commit.yaml\"><img alt=\"Code Quality\" src=\"https://github.com/rafiattrach/m3/actions/workflows/pre-commit.yaml/badge.svg\"></a>\n<a href=\"https://github.com/rafiattrach/m3/pulls\"><img alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"></a>\n\nTransform medical data analysis with AI! Ask questions about MIMIC-IV data in plain English and get instant insights. Choose between local demo data (free) or full cloud dataset (BigQuery).\n\n## \u2728 Features\n\n- \ud83d\udd0d **Natural Language Queries**: Ask questions about MIMIC-IV data in plain English\n- \ud83c\udfe0 **Local SQLite**: Fast queries on demo database (free, no setup)\n- \u2601\ufe0f **BigQuery Support**: Access full MIMIC-IV dataset on Google Cloud\n- \ud83d\udd12 **Enterprise Security**: OAuth2 authentication with JWT tokens and rate limiting\n- \ud83d\udee1\ufe0f **SQL Injection Protection**: Read-only queries with comprehensive validation\n\n## \ud83d\ude80 Quick Start\n\n> \ud83d\udca1 **Need more options?** Run `m3 --help` to see all available commands and options.\n\n### \ud83d\udce6 Installation\n\nChoose your preferred installation method:\n\n#### Option A: Install from PyPI (Recommended)\n\n**Step 1: Create Virtual Environment**\n```bash\n# Create virtual environment (recommended)\npython -m venv .venv\nsource .venv/bin/activate # Windows: .venv\\Scripts\\activate\n```\n\n**Step 2: Install M3**\n```bash\n# Install M3\npip install m3-mcp\n```\n\n#### Option B: Install from Source\n\n#### Using standard `pip`\n**Step 1: Clone and Navigate**\n```bash\n# Clone the repository\ngit clone https://github.com/rafiattrach/m3.git\ncd m3\n```\n\n**Step 2: Create Virtual Environment**\n```bash\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate # Windows: .venv\\Scripts\\activate\n```\n\n**Step 3: Install M3**\n```bash\n# Install M3\npip install .\n```\n\n#### Using `UV` (Recommended)\nAssuming you have [UV](https://docs.astral.sh/uv/getting-started/installation/) installed.\n\n**Step 1: Clone and Navigate**\n```bash\n# Clone the repository\ngit clone https://github.com/rafiattrach/m3.git\ncd m3\n```\n\n**Step 2: Create `UV` Virtual Environment**\n```bash\n# Create virtual environment\nuv venv\n```\n\n**Step 3: Install M3**\n```bash\nuv sync\n# Do not forget to use `uv run` to any subsequent commands to ensure you're using the `uv` virtual environment\n```\n\n### \ud83d\uddc4\ufe0f Database Configuration\n\nAfter installation, choose your data source:\n\n#### Option A: Local Demo Database (Recommended for Beginners)\n\n**Perfect for learning and development - completely free!**\n\n1. **Download demo database**:\n ```bash\n m3 init mimic-iv-demo\n ```\n\n2. **Setup MCP Client**:\n ```bash\n m3 config\n ```\n\n *Alternative: For Claude Desktop specifically:*\n ```bash\n m3 config claude\n ```\n\n3. **Restart your MCP client** and ask:\n\n - \"What tools do you have for MIMIC-IV data?\"\n - \"Show me patient demographics from the ICU\"\n\n#### Option B: BigQuery (Full Dataset)\n\n**For researchers needing complete MIMIC-IV data**\n\n##### Prerequisites\n- Google Cloud account and project with billing enabled\n- Access to MIMIC-IV on BigQuery (requires PhysioNet credentialing)\n\n##### Setup Steps\n\n1. **Install Google Cloud CLI**:\n\n **macOS (with Homebrew):**\n ```bash\n brew install google-cloud-sdk\n ```\n\n **Windows:** Download from https://cloud.google.com/sdk/docs/install\n\n **Linux:**\n ```bash\n curl https://sdk.cloud.google.com | bash\n ```\n\n2. **Authenticate**:\n ```bash\n gcloud auth application-default login\n ```\n *This will open your browser - choose the Google account that has access to your BigQuery project with MIMIC-IV data.*\n\n3. **Setup MCP Client for BigQuery**:\n ```bash\n m3 config\n ```\n\n *Alternative: For Claude Desktop specifically:*\n ```bash\n m3 config claude --backend bigquery --project-id YOUR_PROJECT_ID\n ```\n\n4. **Test BigQuery Access** - Restart your MCP client and ask:\n ```\n Use the get_race_distribution function to show me the top 5 races in MIMIC-IV admissions.\n ```\n\n## \ud83d\udd27 Advanced Configuration\n\nNeed to configure other MCP clients or customize settings? Use these commands:\n\n### Interactive Configuration (Universal)\n```bash\nm3 config\n```\nGenerates configuration for any MCP client with step-by-step guidance.\n\n### Quick Configuration Examples\n```bash\n# Quick universal config with defaults\nm3 config --quick\n\n# Universal config with custom database\nm3 config --quick --backend sqlite --db-path /path/to/database.db\n\n# Save config to file for other MCP clients\nm3 config --output my_config.json\n```\n\n### \ud83d\udd10 OAuth2 Authentication (Optional)\n\nFor production deployments requiring secure access to medical data:\n\n```bash\n# Enable OAuth2 with Claude Desktop\nm3 config claude --enable-oauth2 \\\n --oauth2-issuer https://your-auth-provider.com \\\n --oauth2-audience m3-api \\\n --oauth2-scopes \"read:mimic-data\"\n\n# Or configure interactively\nm3 config # Choose OAuth2 option during setup\n```\n\n**Supported OAuth2 Providers:**\n- Auth0, Google Identity Platform, Microsoft Azure AD, Keycloak\n- Any OAuth2/OpenID Connect compliant provider\n\n**Key Benefits:**\n- \ud83d\udd12 **JWT Token Validation**: Industry-standard security\n- \ud83c\udfaf **Scope-based Access**: Fine-grained permissions\n- \ud83d\udee1\ufe0f **Rate Limiting**: Abuse protection\n- \ud83d\udcca **Audit Logging**: Security monitoring\n\n> \ud83d\udcd6 **Complete OAuth2 Setup Guide**: See [`docs/OAUTH2_AUTHENTICATION.md`](docs/OAUTH2_AUTHENTICATION.md) for detailed configuration, troubleshooting, and production deployment guidelines.\n\n### Backend Comparison\n\n**SQLite Backend (Default)**\n- \u2705 **Free**: No cloud costs\n- \u2705 **Fast**: Local queries\n- \u2705 **Easy**: No authentication needed\n- \u274c **Limited**: Demo dataset only (~1k records)\n\n**BigQuery Backend**\n- \u2705 **Complete**: Full MIMIC-IV dataset (~500k admissions)\n- \u2705 **Scalable**: Google Cloud infrastructure\n- \u2705 **Current**: Latest MIMIC-IV version (3.1)\n- \u274c **Costs**: BigQuery usage fees apply\n\n## \ud83d\udee0\ufe0f Available MCP Tools\n\nWhen your MCP client processes questions, it uses these tools automatically:\n\n- **get_database_schema**: List all available tables\n- **get_table_info**: Get column info and sample data for a table\n- **execute_mimic_query**: Execute SQL SELECT queries\n- **get_icu_stays**: ICU stay information and length of stay data\n- **get_lab_results**: Laboratory test results\n- **get_race_distribution**: Patient race distribution\n\n## \ud83e\uddea Example Prompts\n\nTry asking your MCP client these questions:\n\n**Demographics & Statistics:**\n\n- `Prompt:` *What is the race distribution in MIMIC-IV admissions?*\n- `Prompt:` *Show me patient demographics for ICU stays*\n- `Prompt:` *How many total admissions are in the database?*\n\n**Clinical Data:**\n\n- `Prompt:` *Find lab results for patient X*\n- `Prompt:` *What lab tests are most commonly ordered?*\n- `Prompt:` *Show me recent ICU admissions*\n\n**Data Exploration:**\n\n- `Prompt:` *What tables are available in the database?*\n- `Prompt:` *What tools do you have for MIMIC-IV data?*\n\n## \ud83c\udfa9 Pro Tips\n\n- Do you want to pre-approve the usage of all tools in Claude Desktop? Use the prompt below and then select **Always Allow**\n - `Prompt:` *Can you please call all your tools in a logical sequence?*\n\n## \ud83d\udd0d Troubleshooting\n\n### Common Issues\n\n**SQLite \"Database not found\" errors:**\n```bash\n# Re-download demo database\nm3 init mimic-iv-demo\n```\n\n**MCP client server not starting:**\n1. Check your MCP client logs (for Claude Desktop: Help \u2192 View Logs)\n2. Verify configuration file location and format\n3. Restart your MCP client completely\n\n### OAuth2 Authentication Issues\n\n**\"Missing OAuth2 access token\" errors:**\n```bash\n# Set your access token\nexport M3_OAUTH2_TOKEN=\"Bearer your-access-token-here\"\n```\n\n**\"OAuth2 authentication failed\" errors:**\n- Verify your token hasn't expired\n- Check that required scopes are included in your token\n- Ensure your OAuth2 provider configuration is correct\n\n**Rate limit exceeded:**\n- Wait for the rate limit window to reset\n- Contact your administrator to adjust limits if needed\n\n> \ud83d\udd27 **OAuth2 Troubleshooting**: See [`OAUTH2_AUTHENTICATION.md`](docs/OAUTH2_AUTHENTICATION.md) for detailed OAuth2 troubleshooting and configuration guides.\n\n### BigQuery Issues\n\n**\"Access Denied\" errors:**\n- Ensure you have MIMIC-IV access on PhysioNet\n- Verify your Google Cloud project has BigQuery API enabled\n- Check that you're authenticated: `gcloud auth list`\n\n**\"Dataset not found\" errors:**\n- Confirm your project ID is correct\n- Ensure you have access to `physionet-data` project\n\n**Authentication issues:**\n```bash\n# Re-authenticate\ngcloud auth application-default login\n\n# Check current authentication\ngcloud auth list\n```\n\n## \ud83d\udc69\u200d\ud83d\udcbb For Developers\n\n### Development Setup\n\n#### Option A: Standard `pip` Development Setup\n**Step 1: Clone and Navigate**\n```bash\n# Clone the repository\ngit clone https://github.com/rafiattrach/m3.git\ncd m3\n```\n\n**Step 2: Create and Activate Virtual Environment**\n```bash\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate # Windows: .venv\\Scripts\\activate\n```\n\n**Step 3: Install Development Dependencies**\n```bash\n# Install in development mode with dev dependencies\npip install -e \".[dev]\"\n# Install pre-commit hooks\npre-commit install\n```\n\n#### Option B: Development Setup with `UV` (Recommended)\n**Step 1: Clone and Navigate**\n```bash\n# Clone the repository\ngit clone https://github.com/rafiattrach/m3.git\ncd m3\n```\n\n**Step 2: Create and Activate `UV` Virtual Environment**\n```bash\n# Create virtual environment\nuv venv\n```\n\n**Step 3: Install Development Dependencies**\n```bash\n# Install in development mode with dev dependencies (by default, UV runs in editable mode)\nuv sync\n\n# Install pre-commit hooks\nuv run pre-commit install\n\n# Do not forget to use `uv run` to any subsequent commands to ensure you're using the `uv` virtual environment\n```\n\n### Testing\n\n```bash\npytest # All tests (includes OAuth2 and BigQuery mocks)\npytest tests/test_mcp_server.py -v # MCP server tests\npytest tests/test_oauth2_auth.py -v # OAuth2 authentication tests\n```\n\n### Test BigQuery Locally\n\n```bash\n# Set environment variables\nexport M3_BACKEND=bigquery\nexport M3_PROJECT_ID=your-project-id\nexport GOOGLE_CLOUD_PROJECT=your-project-id\n\n# Optional: Test with OAuth2 authentication\nexport M3_OAUTH2_ENABLED=true\nexport M3_OAUTH2_ISSUER_URL=https://your-provider.com\nexport M3_OAUTH2_AUDIENCE=m3-api\nexport M3_OAUTH2_TOKEN=\"Bearer your-test-token\"\n\n# Test MCP server\nm3-mcp-server\n```\n\n## \ud83d\udd2e Roadmap\n\n- \ud83c\udfe0 **Local Full Dataset**: Complete MIMIC-IV locally (no cloud costs)\n- \ud83d\udd27 **Advanced Tools**: More specialized medical data functions\n- \ud83d\udcca **Visualization**: Built-in plotting and charting tools\n- \ud83d\udd10 **Enhanced Security**: Role-based access control, audit logging\n- \ud83c\udf10 **Multi-tenant Support**: Organization-level data isolation\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new functionality\n4. Submit a pull request\n\n*Built with \u2764\ufe0f for the medical AI community*\n\n**Need help?** Open an issue on GitHub or check our troubleshooting guide above.\n",
"bugtrack_url": null,
"license": null,
"summary": "MIMIC-IV + MCP + Models: Local MIMIC-IV querying with LLMs via Model Context Protocol",
"version": "0.2.0",
"project_urls": {
"Changelog": "https://github.com/rafiattrach/m3/releases",
"Documentation": "https://github.com/rafiattrach/m3#readme",
"Homepage": "https://github.com/rafiattrach/m3",
"Issues": "https://github.com/rafiattrach/m3/issues",
"Repository": "https://github.com/rafiattrach/m3"
},
"split_keywords": [
"mimic-iv",
" clinical-data",
" mcp",
" llm",
" medical",
" healthcare",
" sqlite",
" bigquery"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ae96267982804e238f4b5667be545ece17d4e224139fcfe5f228ac3c2469084d",
"md5": "42059dadaf5601d9e041784302a66a0d",
"sha256": "5e2b6f7214c2db9689a2f131fc23092e37df54360c5596c1c8adb5385b1a4c94"
},
"downloads": -1,
"filename": "m3_mcp-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "42059dadaf5601d9e041784302a66a0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 34655,
"upload_time": "2025-07-11T21:53:26",
"upload_time_iso_8601": "2025-07-11T21:53:26.762316Z",
"url": "https://files.pythonhosted.org/packages/ae/96/267982804e238f4b5667be545ece17d4e224139fcfe5f228ac3c2469084d/m3_mcp-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7458a6bae0f773531ea80b3f6db3d1a76a21351173d5ad00c44824419ed95786",
"md5": "4fa6952c6c2f36284a384b6275b6d46d",
"sha256": "0b43f9bf577419dfb963633cbaf77fe250d97d84293219e67a4e5c8ddb5637bf"
},
"downloads": -1,
"filename": "m3_mcp-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "4fa6952c6c2f36284a384b6275b6d46d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 40909,
"upload_time": "2025-07-11T21:53:28",
"upload_time_iso_8601": "2025-07-11T21:53:28.142356Z",
"url": "https://files.pythonhosted.org/packages/74/58/a6bae0f773531ea80b3f6db3d1a76a21351173d5ad00c44824419ed95786/m3_mcp-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-11 21:53:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rafiattrach",
"github_project": "m3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "m3-mcp"
}