Skip to content
Back to skills

2113 Bigquery 14816729

ASecurity

Use Google Cloud BigQuery to access full clinical datasets without downloading files locally.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentgobashsqlapibackend

Works with

  • claude desktop
  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2113-bigquery_14816729 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2113 Bigquery 14816729?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2113 Bigquery 14816729
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2113-bigquery-14816729/badge)](https://www.skillsdirectory.com/skills/tools-only-2113-bigquery-14816729)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# BigQuery Setup

Use Google Cloud BigQuery to access full clinical datasets without downloading files locally.

## Prerequisites

1. **Google Cloud account** with BigQuery access
2. **PhysioNet credentialed access** for MIMIC-IV or eICU ([apply here](https://physionet.org/)). Scroll to the bottom of the page and request access to the BigQuery dataset.
3. **gcloud CLI** installed ([installation guide](https://cloud.google.com/sdk/docs/install))

## Setup

### 1. Authenticate with Google Cloud

```bash
gcloud auth application-default login
```

This opens a browser to complete authentication.

### 2. Switch to BigQuery backend

```bash
m4 backend bigquery
```

### 3. Configure your MCP client

**Claude Desktop:**
```bash
m4 config claude --backend bigquery --project-id YOUR_PROJECT_ID
```

**Other clients:**
```bash
m4 config --backend bigquery --project-id YOUR_PROJECT_ID
```

Replace `YOUR_PROJECT_ID` with your own billing project for BigQuery usage, not the PhysioNet dataset project. The variable is mandatory to ensure billing is correctly attributed.

### 4. Set the dataset

```bash
m4 use mimic-iv    # or eicu
```

### 5. Restart your MCP client

The AI client will now query BigQuery directly.

## BigQuery Dataset IDs

M4 uses these PhysioNet BigQuery datasets:

| Dataset | BigQuery Project | Dataset IDs |
|---------|-----------------|-------------|
| mimic-iv | `physionet-data` | `mimiciv_3_1_hosp`, `mimiciv_3_1_icu` |
| mimic-iv-note | `physionet-data` | `mimiciv_note` |
| mimic-iv-ed | `physionet-data` | `mimiciv_ed` |
| eicu | `physionet-data` | `eicu_crd` |

## Derived Tables on BigQuery

BigQuery users already have access to ~63 pre-computed derived concept tables (SOFA scores, sepsis cohorts, KDIGO AKI staging, medications, etc.) via `physionet-data.mimiciv_derived`. These tables are maintained by PhysioNet and are the same concepts that local DuckDB users materialize with `m4 init-derived mimic-iv`.

You do **not** need to run `m4 init-derived` when using BigQuery -- the tables are already available. Query them directly:

```sql
SELECT * FROM mimiciv_derived.sofa LIMIT 10
```

The `mimiciv_derived` schema is accessible alongside the standard `mimiciv_hosp` and `mimiciv_icu` schemas.

## Environment Variables

You can also override the backend via environment variables (these take priority over `m4 backend`):

```bash
export M4_BACKEND=bigquery
export M4_PROJECT_ID=your-project-id
```

## Cost Considerations

BigQuery charges based on data scanned. Tips to minimize costs:

- Use `LIMIT` clauses in queries
- Query specific columns instead of `SELECT *`
- Use the `limit` parameter in `execute_query` (default: 100 rows)

## Troubleshooting

**"Access Denied" error:**
- Ensure you've completed PhysioNet credentialing for the dataset
- Verify your Google account is linked to PhysioNet
- Re-run `gcloud auth application-default login`

**"Project not found" error:**
- Check the project ID is correct
- Ensure BigQuery API is enabled in your project

**Slow queries:**
- BigQuery has network latency; consider local DuckDB for development
- Use smaller `LIMIT` values while exploring

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.