Skip to main content
Glama
README.md
# kkm-data-mcp

An MCP server for open data from the Ministry of Health Malaysia (Kementerian Kesihatan Malaysia, KKM). It lets AI assistants such as Claude answer questions like:

- "How many people donated blood in Selangor last month, and how many were first-time donors?"
- "Which government clinics are closest to Seksyen 7, Shah Alam?"
- "How have organ donation pledges in Penang changed since 2015?"
- "What was ICU utilisation at Hospital Sultanah Aminah in KKM's latest snapshot?"

It reads the CSV files KKM publishes on GitHub, so there is no API key and nothing to sign up for.

Not affiliated with or endorsed by KKM.

## Tools

| Tool | What it returns |
| --- | --- |
| `blood_donations` | Donations per day, month or year for Malaysia, a state or a blood bank hospital, by blood group, centre or mobile drive, donation type, donor group and new or returning donors. Daily data since 2006. |
| `new_blood_donors_by_age` | First-time donors by age group. |
| `organ_pledges` | Organ donation pledges per day, month or year, nationally or by state. Daily data since 2009. |
| `search_facilities` | Search about 5,160 public health facilities (hospitals, klinik kesihatan, dental clinics, health offices, labs) by name, address, postcode, state, district or category. |
| `nearest_facilities` | Facilities nearest to a latitude and longitude, with straight-line distance. |
| `get_facility` | One facility by its KKM facility code. |
| `facility_counts` | Number of facilities by category and state. |
| `bed_utilisation` | Bed, ICU and ventilator counts and utilisation by state and hospital. |
| `data_freshness` | When each dataset was last updated. |

State names are flexible: "KL", "Kuala Lumpur" and "W.P. Kuala Lumpur" all work, as do "Penang" and "Pulau Pinang". Dates can be `2025`, `2025-06` or `2025-06-15`.

## Install

You need [uv](https://docs.astral.sh/uv/getting-started/installation/).

### Claude Desktop

Add this to `claude_desktop_config.json` and restart Claude:

```json
{
  "mcpServers": {
    "kkm-data": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/azuriru3/kkm-data-mcp", "kkm-data-mcp"]
    }
  }
}
```

### Claude Code

```
claude mcp add kkm-data -- uvx --from git+https://github.com/azuriru3/kkm-data-mcp kkm-data-mcp
```

### Other MCP clients

Run `uvx --from git+https://github.com/azuriru3/kkm-data-mcp kkm-data-mcp` as a stdio server.

## Data

| Dataset | Source | Updated |
| --- | --- | --- |
| Blood donations and new donors | [MoH-Malaysia/data-darah-public](https://github.com/MoH-Malaysia/data-darah-public) | Daily, a day or two behind |
| Organ donation pledges | [MoH-Malaysia/data-organ-public](https://github.com/MoH-Malaysia/data-organ-public) | Monthly |
| Public health facilities | [MoH-Malaysia/data-resources-public](https://github.com/MoH-Malaysia/data-resources-public) | Registry as at 31 December 2025 |
| Bed, ICU and ventilator utilisation | [MoH-Malaysia/data-resources-public](https://github.com/MoH-Malaysia/data-resources-public) | Snapshot, last updated September 2024 |

Things to know:

- The facility registry covers public facilities only (KKM, plus a few under the higher education ministry and the armed forces). Private clinics and hospitals are not in it.
- Bed utilisation is an old snapshot, not live occupancy. The tool returns its date so the assistant can say so.
- Blood donation data by hospital covers the 22 hospitals that run blood banks, not every hospital.
- Data is downloaded on first use and kept in memory for 6 hours. The blood donation files are about 30 MB in total, so the first question can take a few seconds.

The same data is shown on KKM's own dashboards at [data.moh.gov.my](https://data.moh.gov.my).

## Development

```
git clone https://github.com/azuriru3/kkm-data-mcp
cd kkm-data-mcp
pip install -e . pytest
pytest            # offline tests
pytest -m live    # also downloads real data
```

## Licence

Code: [MIT](LICENSE). The data belongs to the Ministry of Health Malaysia, which publishes it openly on GitHub.