opencosmetics
by AndyZhuang
README.md
# ๐งช Open Cosmetics / ๅผๆพ็พๅฆๆฐๆฎ
> **B2B ๅๅฆๅๆฐๆฎ MCP + Next.js** โ ไธญๅฝ + ๆฌง็ + ็พๅฝ + ๅๆ็็ฉ ยท 8 ็ปดๅบฆๅๆๆฐๆฎๅบ ยท 65 ้ฃ้ฉ่งๅ ยท Claude / GPT ๅฏ็ดๆฅ่ฐ็จ็ MCP server
>
> **B2B cosmetics data MCP + Next.js** โ China + EU + US + synthetic biology ยท 8-dim ingredient DB ยท 65 risk rules ยท MCP server callable from Claude / GPT
[]()
[]()
[]()
[](https://creativecommons.org/licenses/by/4.0/)
[](https://github.com/AndyZhuang/opencosmetics)
[]()
---
## ๐ Bilingual / ๅ่ฏญ
The site supports **3 display modes**, switchable from the nav bar:
- ๐ **ไธญ+EN** (default) โ both languages
- ๐จ๐ณ **ไธญๆ** โ Chinese only
- ๐บ๐ธ **EN** โ English only
API responses include a `lang` field; pass `?lang=en` or `?lang=zh` (or `Cookie: opencosmetics_lang=...`) to switch.
---
## โจ Features / ็นๆง
| | EN | ไธญ |
|---|---|---|
| ๐ช๐บ **EU ๆณ่ง** | 50,169 CosIng + 1,927 regulatory (Annex II/III/IV/V/VI) | 50,169 CosIng + 1,927 ็็ฎก (Annex II/III/IV/V/VI) |
| ๐จ๐ณ **ไธญๅฝๆณ่ง** | 8,985 NMPA IECIC I + 2 IECIC II + 113 paragraphs adjustments | 8,985 NMPA IECIC I + 2 IECIC II + 113 ๆฎต่ฐๆด |
| ๐บ๐ธ **FDA ไบไปถ** | 85,511 cosmetic events + 4-dim aggregation | 85,511 ๅๅฆๅไบไปถ + 4 ็ปดๅบฆ่ๅ |
| ๐งฌ **ๅๆ็็ฉ** | 4 listed companies (Juzi/Jinbo/Huaxi/Chuangjian) | 4 ไธๅธ (ๅทจๅญ/้ฆๆณข/ๅ็/ๅๅฅ) |
| โ๏ธ **้ฃ้ฉ่งๅ** | 65 rules ร 7 categories (compat/pH/conc/pop/region/synbio/FDA) | 65 ่งๅ ร 7 ็ฑป (ๅ
ผๅฎน/pH/ๆตๅบฆ/็นๆฎไบบ็พค/ๅบๅ/ๅๆ็็ฉ/FDA) |
| ๐ **ๅคๅฐๅบๅ่ง** | CN / EU / US / KR / JP / ASEAN | CN / EU / US / KR / JP / ASEAN |
| ๐ก๏ธ **GB 7916-2026** | First mandatory national standard (effective 2028-01-01) | ้ฆไธชๅผบๅถๆงๅฝๆ (2028-01-01 ๅฎๆฝ) |
| ๐ค **MCP** | TypeScript SDK stdio + HTTP, 4 tools | TypeScript SDK stdio + HTTP, 4 ๅทฅๅ
ท |
## ๐ Quick Start / ๅฟซ้ๅผๅง
### 1. Web (5 minutes / 5 ๅ้)
```bash
git clone https://github.com/AndyZhuang/opencosmetics.git
cd opencosmetics
npm install
npm run dev
# โ http://localhost:3000
```
### 2. MCP server (Claude Desktop)
```json
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"opencosmetics": {
"command": "node",
"args": ["/path/to/opencosmetics/mcp-server/dist/index.js"]
}
}
}
```
### 3. Direct DuckDB
```bash
duckdb data/bebd.duckdb
> SELECT * FROM cn_iecic_i WHERE inci_name ILIKE '%RETINOL%' LIMIT 5;
> SELECT * FROM annex_ii_prohibited WHERE LOWER("Chemical name / INN") LIKE '%nitroglycerin%';
```
## ๐ Data Scale / ๆฐๆฎ่งๆจก
| Table | Records | Source |
|---|---|---|
| `cosing` | 50,169 | EU CosIng (unified) |
| `cosing_lite` | 28,354 | beauteeru (PubChem) |
| `cosing_obf` | 24,127 | OBF CosIng full |
| `annex_ii_prohibited` | 1,431 | EU Banned |
| `annex_iii_restricted` | 309 | EU Restricted |
| `annex_iv_colorants` | 153 | EU Colorants |
| `annex_v_preservatives` | 56 | EU Preservatives |
| `annex_vi_uv_filters` | 31 | EU UV Filters |
| **`cn_iecic_i`** | **8,985** | **NMPA Existing** |
| **`cn_iecic_ii`** | **2** | **NMPA New Ingredients** |
| **`cn_iecic_adjustments`** | **113 paragraphs** | **NMPA 2025-06-23** |
| `fda_cosmetic_events_*` | 85,511 | FDA Cosmetic Events |
| `companies.json` | 4 | ๅทจๅญ/้ฆๆณข/ๅ็/ๅๅฅ |
| `rules.json` | 65 rules | compat/pH/conc/pop/region/synbio/FDA |
**Total: ~130K+ records** + 65 risk rules + 4 companies
## ๐ค MCP Tools / 4 ๅทฅๅ
ท
| Tool | Args | EN | ไธญ |
|---|---|---|---|
| `ingredient_query` | `q: string` | Cross-source query (CN + EU + INCI) | ่ทจๆบๆฅ่ฏข (CN + EU + INCI) |
| `formula_review` | `ingredients: string[], context: {population, region}` | 65-rule review | 65 ่งๅๅฎกๆฅ |
| `compliance_check` | `ingredient: string, regions: string[]` | Multi-region compliance | ๅคๅฐๅบๅ่งๆซๆ |
| `synbio_company` | `id?: string` | 4 listed companies metadata | 4 ไธๅธๅ
ฌๅธๅ
ๆฐๆฎ |
**Example / ็คบไพ (curl):**
```bash
# Formula review / ้
ๆน้ฃ้ฉๅฎกๆฅ
curl -X POST http://localhost:3000/api/risk/check \
-H "Content-Type: application/json" \
-d '{"ingredients": ["RETINOL", "AHA", "VITAMIN_C"], "context": {"population": "pregnant", "region": "CN"}}'
# โ {"summary": "REJECT", "block_count": 3, "warn_count": 5, "findings": [...], "lang": "both"}
```
## ๐ Project Structure / ้กน็ฎ็ปๆ
```
opencosmetics/
โโโ app/ # Next.js 15 App Router
โ โโโ page.js # Home: 5 sources + Killer Finding
โ โโโ ingredients/ # Ingredients (50K)
โ โโโ regulatory/ # EU Regulatory
โ โโโ fda/ # FDA 85K events
โ โโโ china/ # ๐จ๐ณ NMPA 8,985 + GB 7916-2026
โ โโโ synbio/ # ๐งฌ Juzi/Jinbo/Huaxi/Chuangjian
โ โโโ risk/ # โ๏ธ 65-rule review
โ โโโ api/
โ โโโ mcp/route.js # MCP HTTP entry
โ โโโ china/ingredient/ # Chinese ingredient query
โ โโโ synbio/companies/ # Synbio companies
โ โโโ risk/check/ # Risk review
โ โโโ regions/ # Multi-region compliance
โ โโโ stats/ # Aggregate stats
โโโ lib/
โ โโโ db.js # DuckDB singleton + risk engine
โ โโโ i18n.js # i18n dictionary (zh/en/both)
โโโ components/
โ โโโ LangSwitcher.js # 3-state language switcher
โ โโโ Bilingual.js # Bilingual field component
โโโ data/
โ โโโ bebd.duckdb # 17 MB โ 25 tables (EU+CN+US)
โ โโโ companies.json # 4 synbio companies
โ โโโ rules.json # 65 risk rules
โโโ mcp-server/ # TypeScript stdio MCP server
โ โโโ src/index.ts # 4 tools
โ โโโ dist/index.js # 11.3 KB compiled
โ โโโ package.json
โโโ scripts/ # Data ingest pipeline
โ โโโ 01_download_sources.py
โ โโโ 02_merge_duckdb.py
โโโ docs/
โโโ ARCHITECTURE.md
โโโ MCP.md
```
## ๐ Links / ้พๆฅ
- GitHub: https://github.com/AndyZhuang/opencosmetics
- Demo: deployment in progress
- MCP: TypeScript SDK, stdio + HTTP
## ๐ฃ๏ธ Roadmap / ่ทฏ็บฟๅพ
### Q3 2026 (v0.2.0 โ DONE / ๅทฒๅฎๆ โ
)
- [x] 5 sources EU + NMPA + FDA + 4 synbio companies + 65 rules (v0.2.0)
- [x] **Bilingual UI (zh + en) + 3-mode language switcher (v0.2.1)**
### Q4 2026
- [ ] 1,284 banned + 109 plant/animal prohibited + STSC 2015 4 tables
- [ ] KR KCID 20,530 / JP JCIA 16,152 / ASEAN 1,870
- [ ] MCP Pro tier auth ($99/mo 100K req)
- [ ] Enterprise tier ($999/mo SLA)
### Q1 2027
- [ ] LLM-based auto-formulation
- [ ] Market-comp analysis + differentiation suggestions
## ๐ License / ่ฎธๅฏ่ฏ
- **Data / ๆฐๆฎ**: CC-BY 4.0 (per-source attribution in `data/sources.csv`)
- **Code / ไปฃ็ **: MIT
- **Docs / ๆๆกฃ**: CC-BY 4.0
## ๐ Maintainer / ็ปดๆค
- [AndyZhuang](https://github.com/AndyZhuang) + [Mavis AI agent](https://MiniMax.com)
- Feedback: GitHub Issues / Discussion
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues