Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.git
__pycache__
*.pyc
.venv
.env
webapp/
benchmarks/
coverage.xml
.pytest_cache/
dist/
build/
*.egg-info
# Keep only the demo DB
m3_data/**
!m3_data/databases/
!m3_data/databases/mimic_iv_demo.db
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# syntax=docker/dockerfile:1

# Build stage: create wheel
FROM python:3.11-slim AS builder

WORKDIR /build
COPY pyproject.toml uv.lock README.md ./
COPY src ./src

RUN pip install --no-cache-dir build && \
python -m build --wheel

# Base runtime: install m3 and baked SQLite DB
FROM python:3.11-slim AS base

ENV PYTHONUNBUFFERED=1 \
M3_BACKEND=sqlite \
M3_DB_PATH=/root/m3_data/databases/mimic_iv_demo.db

WORKDIR /app

COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl

# Download and initialize demo DB using m3 init
RUN m3 init mimic-iv-demo

# Lite: SQLite only
FROM base AS lite
CMD ["python", "-m", "m3.mcp_server"]

# BigQuery: add GCP client
FROM base AS bigquery
RUN pip install --no-cache-dir google-cloud-bigquery
CMD ["python", "-m", "m3.mcp_server"]
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,40 @@ source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install m3-mcp
```

#### Option B: Install from Source
#### Option B: Docker

```bash
# Clone repo first
git clone https://github.com/rafiattrach/m3.git && cd m3

# SQLite (demo DB)
docker build -t m3:lite --target lite .
docker run -d --name m3-server m3:lite tail -f /dev/null

# BigQuery (full dataset - requires GCP credentials)
docker build -t m3:bigquery --target bigquery .
docker run -d --name m3-server \
-e M3_BACKEND=bigquery \
-e M3_PROJECT_ID=YOUR_PROJECT_ID \
-v $HOME/.config/gcloud:/root/.config/gcloud:ro \
m3:bigquery tail -f /dev/null
```

**MCP client config** (Claude Desktop, LM Studio, etc.):
```json
{
"mcpServers": {
"m3": {
"command": "docker",
"args": ["exec", "-i", "m3-server", "python", "-m", "m3.mcp_server"]
}
}
}
```

Stop container: `docker stop m3-server && docker rm m3-server`

#### Option C: Install from Source

#### Using standard `pip`
**Step 1: Clone and Navigate**
Expand Down