Skip to main content
Glama
README.md
# πŸ‡°πŸ‡· KFDA MCP Server

MCP (Model Context Protocol) server for Korean Ministry of Food and Drug Safety (μ‹μ•½μ²˜) public OpenAPI.

LLM agents (Claude, ChatGPT, etc.) can autonomously query Korean drug master, DUR (Drug Utilization Review) safety rules, and health supplement databases through the standard MCP protocol.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21063208.svg)](https://doi.org/10.5281/zenodo.21063208)
[![MCP](https://img.shields.io/badge/MCP-Anthropic-8b5cf6?style=for-the-badge)](https://modelcontextprotocol.io)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org)
[![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)
[![Healthcare](https://img.shields.io/badge/Domain-Healthcare%20AI-ec4899?style=for-the-badge)](https://www.mfds.go.kr)

---

## 🎯 Why this exists

The Korean healthcare AI ecosystem lacks an open MCP server for MFDS (μ‹μ•½μ²˜) public APIs. Global MCP servers like BioMCP focus on US data (FDA, PubMed). For Korean healthcare AI applications β€” pharmacy systems, telemedicine, drug interaction checkers β€” direct access to KFDA/MFDS APIs is essential but each team has to write their own wrapper.

This project provides a standard MCP server so any LLM agent can query Korean drug safety data without bespoke integration code.

---

## ✨ Features

| Tool | Description | KFDA OpenAPI |
|---|---|---|
| `search_drug` | μ˜μ•½ν’ˆ λ§ˆμŠ€ν„° 검색 (μ œν’ˆλͺ…Β·μ„±λΆ„Β·μ œμ‘°μ‚¬Β·ATC μ½”λ“œ) | μ˜μ•½ν’ˆ μ œν’ˆ ν—ˆκ°€μ •λ³΄ |
| `check_dur_interaction` | 두 μ•½λ¬Όμ˜ λ³‘μš©κΈˆκΈ°Β·μ—°λ ΉκΈˆκΈ°Β·μž„λΆ€κΈˆκΈ° 확인 | μ˜μ•½ν’ˆ μ•ˆμ „μ‚¬μš©μ„œλΉ„μŠ€ (DUR) |
| `search_supplement` | 건강기λŠ₯μ‹ν’ˆ μΈν—ˆκ°€ 정보 검색 | μ‹ν’ˆμ•ˆμ „λ‚˜λΌ 건기식 OpenAPI |
| `get_drug_easy_info` | eμ•½μ€μš” (ν™˜μžμš© μ‰¬μš΄ μ•½λ¬Ό 정보) 쑰회 | eμ•½μ€μš” |
| `lookup_atc_code` | ATC μ½”λ“œ β†’ μ•½λ¬Όκ΅° λΆ„λ₯˜ 정보 | λ‚΄μž₯ λ§€ν•‘ |

---

## πŸš€ Quick Start

### 1. Install

```bash
pip install kfda-mcp
# or from source
git clone https://github.com/pianovirus/kfda-mcp
cd kfda-mcp
pip install -e .
```

### 2. Get your MFDS API key

Apply for a free API key at [data.go.kr](https://www.data.go.kr) (곡곡데이터포털) β€” select μ‹μ•½μ²˜ OpenAPI services.

### 3. Configure

Create `.env`:

```
MFDS_API_KEY=your_api_key_here
```

### 4. Run as MCP server

```bash
kfda-mcp
```

### 5. Connect from Claude Desktop

Add to `~/.config/claude/claude_desktop_config.json` (or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json
{
  "mcpServers": {
    "kfda": {
      "command": "kfda-mcp",
      "env": {
        "MFDS_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

Restart Claude Desktop. Now Claude can call Korean drug safety tools autonomously.

---

## πŸ’‘ Example Usage

Ask Claude (or any MCP-compatible LLM):

> "ν™˜μžκ°€ μ™€νŒŒλ¦°μ„ 볡용 쀑인데 자λͺ½ μΆ”μΆœ μ˜μ–‘μ œλ₯Ό 같이 먹어도 λ˜λŠ”μ§€ ν™•μΈν•΄μ€˜"

Claude will autonomously:
1. Call `search_drug("μ™€νŒŒλ¦°")` β†’ get warfarin info + ATC code
2. Call `check_dur_interaction("warfarin", "grapefruit_extract")` β†’ DUR check
3. Synthesize a safety recommendation grounded in MFDS data

---

## πŸ— Architecture

```
LLM Agent (Claude / GPT / etc.)
    β”‚
    β”‚ MCP Protocol (stdio / SSE)
    β”‚
    β–Ό
KFDA MCP Server (this project)
    β”‚
    β”‚ HTTP requests
    β”‚
    β–Ό
MFDS Public APIs
  - μ˜μ•½ν’ˆ μ œν’ˆ ν—ˆκ°€μ •λ³΄ OpenAPI
  - μ˜μ•½ν’ˆ μ•ˆμ „μ‚¬μš©μ„œλΉ„μŠ€ (DUR)
  - μ‹ν’ˆμ•ˆμ „λ‚˜λΌ 건기식 OpenAPI
  - eμ•½μ€μš”
```

---

## πŸ“‹ Tool Reference

### `search_drug(name: str, limit: int = 10)`

Search Korean drug master by product name, generic name, or manufacturer.

**Returns**: List of drugs with `product_name`, `generic_name`, `manufacturer`, `atc_code`, `kor_indication`, `dosage_form`.

### `check_dur_interaction(drug_a: str, drug_b: str)`

Check DUR safety rules between two drugs (λ³‘μš©κΈˆκΈ°Β·μ—°λ ΉκΈˆκΈ°Β·μž„λΆ€κΈˆκΈ° λ“±).

**Returns**: List of warnings with `rule_type`, `severity`, `description_kor`.

### `search_supplement(ingredient: str | None = None, product: str | None = None)`

Search μ‹μ•½μ²˜ 건강기λŠ₯μ‹ν’ˆ (functional health food) registrations.

**Returns**: List of supplements with `product_name`, `manufacturer`, `main_ingredient`, `approved_function`.

### `get_drug_easy_info(drug_name: str)`

Get patient-friendly drug information from eμ•½μ€μš” (consumer-facing drug guide).

**Returns**: `purpose`, `dosage`, `side_effects`, `warnings` in Korean.

### `lookup_atc_code(atc_code: str)`

Look up ATC (Anatomical Therapeutic Chemical) classification by code.

**Returns**: `level1` ~ `level5` Korean & English names, drug examples.

---

## πŸ›£ Roadmap

- [x] Project scaffold + MCP SDK setup
- [x] `search_drug` β€” μ˜μ•½ν’ˆ λ§ˆμŠ€ν„° βœ… live verified (νƒ€μ΄λ ˆλ†€ β†’ ATC N02BE01)
- [x] `check_dur_interaction` β€” DUR λ³‘μš©κΈˆκΈ° βœ… live verified (μ•„μŠ€ν”Όλ¦°+μ™€νŒŒλ¦° β†’ 50건)
- [x] `search_supplement` β€” 건기식 βœ… live verified (μ‹ν’ˆμ•ˆμ „λ‚˜λΌ C003, 비타민 검색 OK)
- [x] `get_drug_easy_info` β€” eμ•½μ€μš” βœ… live verified (νƒ€μ΄λ ˆλ†€ 효λŠ₯Β·μš©λ²•Β·λΆ€μž‘μš© λ°˜ν™˜)
- [ ] `lookup_atc_code` β€” ATC λ§€ν•‘ (planned)
- [ ] Local cache layer (reduce API calls) β€” planned
- [ ] Async batch query support β€” planned
- [ ] Multilingual responses (ν•œ/영) β€” planned

**ν˜„μž¬ μƒνƒœ: 4/4 핡심 tool λͺ¨λ‘ live 검증 μ™„λ£Œ, production-ready**
- [ ] Local cache layer (reduce API calls)
- [ ] Async batch query support
- [ ] Multilingual responses (ν•œ/영)

---

## 🀝 Contributing

Korean healthcare AI engineers β€” contributions welcome! Please open an issue or PR.

This project aims to be the de facto MCP server for MFDS public APIs.

---

## πŸ“œ License

MIT Β© 2026 Myunghee Kim Β· pianovirus@naver.com

---

## πŸ™ Acknowledgments

- [Anthropic MCP](https://modelcontextprotocol.io) β€” Standard protocol for LLM-tool communication
- [μ‹ν’ˆμ˜μ•½ν’ˆμ•ˆμ „μ²˜ (MFDS)](https://www.mfds.go.kr) β€” Public health data API provider
- [곡곡데이터포털](https://www.data.go.kr) β€” Korean government open data platform

---

## ν•œκ΅­μ–΄ μš”μ•½

μ‹μ•½μ²˜(MFDS)의 곡곡 OpenAPIλ₯Ό MCP ν”„λ‘œν† μ½œλ‘œ 감싼 μ„œλ²„μž…λ‹ˆλ‹€. Claude, GPT 같은 LLM μ—μ΄μ „νŠΈκ°€ ν•œκ΅­ μ˜μ•½ν’ˆ λ§ˆμŠ€ν„°Β·DUR μ•ˆμ „μ„±Β·κ±΄κ°•κΈ°λŠ₯μ‹ν’ˆ 정보λ₯Ό 자율적으둜 μ‘°νšŒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν•œκ΅­ ν—¬μŠ€ AI κ°œλ°œμžλ“€μ΄ 맀번 μ‹μ•½μ²˜ API wrapperλ₯Ό 직접 λ§Œλ“€ ν•„μš” 없이, 이 MCP μ„œλ²„ ν•˜λ‚˜λ‘œ ν‘œμ€€ν™”λœ 도ꡬ 접근을 μ œκ³΅ν•˜λŠ” 것이 λͺ©ν‘œμž…λ‹ˆλ‹€.

κΈ°μ—¬ ν™˜μ˜ν•©λ‹ˆλ‹€. 🌱

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: interaction checking, patient info retrieval, drug search, and supplement search. There is no overlap or ambiguity among them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores (e.g., check_dur_interaction, search_drug). The naming is predictable and uniform.

Tool Count5/5

With 4 tools, the server is well-scoped for a focused domain of Korean drug and supplement information. Each tool serves a distinct function without redundancy.

Completeness4/5

The server covers drug search, patient information, interaction checking, and supplement searchβ€”key functionalities. Minor gaps exist (e.g., professional-level drug details), but the core workflows are supported.

Maintenance

ActivityStale
ResponsivenessNo issues