# aihw-mcp

> MCP server exposing Australian Institute of Health and Welfare statistics through 6 plain-English tools — long-term mortality, regional health, cancer incidence and mortality, health expenditure, youth justice detention, public hospitals.

aihw-mcp is the Australian Institute of Health and Welfare (AIHW) member of the Australian Public Data MCP portfolio. It fetches AIHW XLSX/CSV resources from data.gov.au's CKAN, resolving the freshest resource URL at fetch time (no wheel update required when AIHW adds another year of data).

6 curated datasets cover the most machine-readable AIHW publications — long-term mortality (GRIM, 1907+), regional mortality (MORT_GEOGRAPHY, SA3/SA4/PHN), cancer incidence + mortality, national health expenditure, quarterly youth justice detention, and the public hospitals register. Every response carries CC-BY 3.0 Australia attribution. SQLite cache TTLs are tuned for AIHW's annual cadence (7-day data, 1-hour catalogue).

## Documentation

- [README](https://github.com/Bigred97/aihw-mcp/blob/main/README.md): Full setup + 6-tool usage + worked examples
- [CHANGELOG](https://github.com/Bigred97/aihw-mcp/blob/main/CHANGELOG.md): Release history
- [PyPI](https://pypi.org/project/aihw-mcp/): `uvx --upgrade aihw-mcp`

## Tools

- search_datasets(query, limit=10): Fuzzy search the 6 curated AIHW datasets
- describe_dataset(dataset_id): Schema — filterable dimensions, returnable measures, period coverage, source URL
- get_data(dataset_id, filters, measures, start_period, end_period, format): Filtered query with period range; supports plain-English filter aliases and measure-key selection
- latest(dataset_id, filters, measures): Most recent observation(s) per measure
- top_n(dataset_id, measure, n=10, filters, direction="top"): Rank rows by a measure server-side, return top or bottom N — saves an LLM from sorting/slicing client-side
- list_curated(): Enumerate the 6 curated dataset IDs

## Example queries

- "How have diabetes deaths changed since 1980?"
- "What's the age-standardised mortality rate in the Sydney Inner West SA3?"
- "Show breast cancer incidence in women aged 50-54 over time"
- "How much did Australia spend on public hospitals in 2022-23?"
- "Compare youth detention in NSW vs VIC, Indigenous and Total"
- "List all Principal referral hospitals in Queensland"
- "Top 10 causes of death in 2023"

## Optional

- [Sister MCPs](https://github.com/Bigred97?tab=repositories&q=mcp): Other AU public-data MCPs (ABS, RBA, ATO, APRA, ASIC, AEMO, weather, WGEA)
- [aus-identity](https://pypi.org/project/aus-identity/): Postcode/state normalisation — `state` filter on HEALTH_EXPENDITURE / PUBLIC_HOSPITALS / YOUTH_JUSTICE_DETENTION accepts canonical codes, full names, ISO 3166-2, and postcodes
