slicequeue/k-mfds-fooddb-mcp-server
If you are the rightful owner of k-mfds-fooddb-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The K-MFDS FoodDB MCP Server provides access to the Korean Ministry of Food and Drug Safety's food database using the Model Context Protocol.
K-MFDS FoodDB MCP Server
์ํ์์ฝํ์์ ์ฒ(K-MFDS) ์ํ์์์ฑ๋ถDB๋ฅผ MCP(Model Context Protocol) ๋๊ตฌ๋ก ๋ฐ๋ก ํ์ฉ!
์คํ ํ๋ฉด
์์1 ์ผ๋ฐ ๊ฒ์ |
---|
์์2 ์์ฉ ๊ฒ์ |
---|
์ฌ์ฉ๋ฐฉ๋ฒ์ ์๋ ๐ ๏ธ ์ฌ์ฉ ๊ฐ๋ฅํ MCP ๋๊ตฌ
๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์ :)
โจ ๋น ๋ฅธ ์์ (npx)
npx k-mfds-fooddb-mcp-server
- MCP ํธํ ํ๋ซํผ(์: ModelContext, MCP SDK ๋ฑ)์์ ๋ฐ๋ก ์คํํ ์ ์์ต๋๋ค.
- ํ์ค ์ ๋ ฅ/์ถ๋ ฅ(STDIO) ๊ธฐ๋ฐ MCP ์๋ฒ๋ก ๋์ํฉ๋๋ค.
๐ MCP ํด๋ผ์ด์ธํธ ์ค์
Gemini (Google AI Studio)
- Google AI Studio์์ ์ ํ๋ก์ ํธ ์์ฑ
- Tools ์น์ ์์ Add tool ํด๋ฆญ
- MCP Server ์ ํ
- ์ค์ :
Name: K-MFDS FoodDB Command: npx k-mfds-fooddb-mcp-server
- Save ํด๋ฆญ
Cursor
- Cursor ์ค์ ์์ Extensions โ MCP ํ์ฑํ
~/.cursor/mcp_servers.json
ํ์ผ ์์ฑ/์์ :{ "mcpServers": { "k-mfds-fooddb": { "command": "npx", "args": ["k-mfds-fooddb-mcp-server"], "env": { "GOV_API_KEY": "๋ฐ๊ธ๋ฐ์_์์ฝ์ฒ_API_ํค" } } } }
- Cursor ์ฌ์์
๐ก ํ๊ฒฝ๋ณ์ ์ค์ :
env
์น์ ์GOV_API_KEY
๋ฅผ ์ถ๊ฐํ์ธ์. API ํค๋ ๊ณต๊ณต๋ฐ์ดํฐํฌํธ์์ ๋ฐ๊ธ๋ฐ์ ์ ์์ต๋๋ค.
Continue
- Continue ์ค์ ์์ MCP Servers ์น์ ์ผ๋ก ์ด๋
- ์ ์๋ฒ ์ถ๊ฐ:
Name: k-mfds-fooddb Command: npx k-mfds-fooddb-mcp-server Environment Variables: GOV_API_KEY: ๋ฐ๊ธ๋ฐ์_์์ฝ์ฒ_API_ํค
- Save ํด๋ฆญ
๐ก ํ๊ฒฝ๋ณ์ ์ค์ : Environment Variables ์น์ ์
GOV_API_KEY
๋ฅผ ์ถ๊ฐํ์ธ์.
ModelContext
- ModelContext ์ค์ ์์ MCP Servers ํญ
- Add Server ํด๋ฆญ
- ์ค์ :
{ "name": "K-MFDS FoodDB", "command": "npx", "args": ["k-mfds-fooddb-mcp-server"], "env": { "GOV_API_KEY": "๋ฐ๊ธ๋ฐ์_์์ฝ์ฒ_API_ํค" } }
- Connect ํด๋ฆญ
๐ก ํ๊ฒฝ๋ณ์ ์ค์ :
env
์น์ ์GOV_API_KEY
๋ฅผ ์ถ๊ฐํ์ธ์.
๊ธฐํ MCP ํธํ ํด๋ผ์ด์ธํธ
๋๋ถ๋ถ์ MCP ํธํ ํด๋ผ์ด์ธํธ์์ ๋ค์๊ณผ ๊ฐ์ด ์ค์ :
{
"name": "k-mfds-fooddb",
"command": "npx",
"args": ["k-mfds-fooddb-mcp-server"],
"env": {
"GOV_API_KEY": "๋ฐ๊ธ๋ฐ์_์์ฝ์ฒ_API_ํค"
}
}
๐ก ํ๊ฒฝ๋ณ์ ์ค์ :
env
์น์ ์GOV_API_KEY
๋ฅผ ์ถ๊ฐํ์ธ์. API ํค๋ ๊ณต๊ณต๋ฐ์ดํฐํฌํธ์์ ๋ฐ๊ธ๋ฐ์ ์ ์์ต๋๋ค.
๐ฆ ์ค์น (npm)
Installing via Smithery
To install k-mfds-fooddb-mcp-server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @slicequeue/k-mfds-fooddb-mcp-server --client claude
Installing manually
npm install -g k-mfds-fooddb-mcp-server
# ๋๋ ํ๋ก์ ํธ์ ์ค์น
npm install k-mfds-fooddb-mcp-server
โก ํ๊ฒฝ ๋ณ์ ์ค์
.env
ํ์ผ์ ํ๋ก์ ํธ ๋ฃจํธ์ ์์ฑํ์ธ์. (์์:env.example
์ฐธ๊ณ )- ํ์ ํญ๋ชฉ:
GOV_API_KEY
: ์ํ์์ฝํ์์ ์ฒ OpenAPI ํค
GOV_API_KEY=๋ฐ๊ธ๋ฐ์_์์ฝ์ฒ_API_ํค
API ํค๋ ๊ณต๊ณต๋ฐ์ดํฐํฌํธ์์ ์ ์ฒญ/๋ฐ๊ธ๋ฐ์ ์ ์์ต๋๋ค.
๐ ๏ธ ์ฌ์ฉ ๊ฐ๋ฅํ MCP ๋๊ตฌ
1. ์ํ ๊ฒ์ ๋๊ตฌ (searchFoodNutrition
)
- ์ค๋ช : ์ํ๋ช , ์ ์กฐ์ฌ, ์นดํ ๊ณ ๋ฆฌ ๋ฑ ๋ค์ํ ์กฐ๊ฑด์ผ๋ก ์ํ ์์์ฑ๋ถ ์ ๋ณด๋ฅผ ๊ฒ์ํฉ๋๋ค.
- ์
๋ ฅ ํ๋ผ๋ฏธํฐ:
foodNameKr
: ์ํ๋ช (์: "์ฌ๊ณผ")makerName
: ์ ์กฐ์ฌ๋ช (์: "๋์ฌ")foodCategory1Name
: ์ํ ๋๋ถ๋ฅ๋ช (์: "๊ณผ์ผ๋ฅ")itemReportNo
: ํ๋ชฉ์ ์กฐ๋ณด๊ณ ๋ฒํธresearchYearMonthDate
: ๋ฐ์ดํฐ ์์ฑ์ผ์ (YYYYMMDD)pageNo
: ํ์ด์ง ๋ฒํธ (๊ธฐ๋ณธ๊ฐ: 1)numOfRows
: ํ ํ์ด์ง ๊ฒฐ๊ณผ์ (๊ธฐ๋ณธ๊ฐ: 10, ์ต๋: 100)updateDate
: ๋ฐ์ดํฐ ์์ ์ผ์ (YYYYMMDD)dbClassName
: ํ๋ชฉ๋ํ/์์ฉ์ ํ ๊ตฌ๋ถ
โ ์์ ์์ฒญ
{
"foodNameKr": "์ฌ๊ณผ",
"numOfRows": 5
}
โ ์์ ์๋ต
{
"data": [
{
"foodNameKr": "์ฌ๊ณผ",
"makerName": "๋ํ",
"foodCategory1Name": "๊ณผ์ผ๋ฅ",
"servingSize": "100g",
"nutritionComponents": [
{ "name": "์ด๋", "value": "52", "unit": "kcal" },
{ "name": "๋จ๋ฐฑ์ง", "value": "0.3", "unit": "g" }
],
"itemReportNum": "2020123456789",
"researchDate": "20201201"
}
],
"paging": {
"totalCount": "100",
"pageNo": "1",
"numOfRows": "10"
}
}
2. ์์์ฑ๋ถ ์ฝ๋ ์กฐํ ๋๊ตฌ (getNutritionComponentTypes
)
- ์ค๋ช : ์ํ์์์ฑ๋ถDB์์ ์ ๊ณตํ๋ ์์์ฑ๋ถ ์ฝ๋/์ด๋ฆ/๋จ์ ๋ชฉ๋ก์ ์กฐํํฉ๋๋ค.
- ์ ๋ ฅ ํ๋ผ๋ฏธํฐ: ์์
โ ์์ ์๋ต
{
"items": [
{
"code": "AMT_NUM1",
"name": "์๋์ง",
"label": "์๋์ง(kcal)",
"unit": "kcal"
},
{ "code": "AMT_NUM2", "name": "์๋ถ", "label": "์๋ถ(g)", "unit": "g" },
{ "code": "AMT_NUM3", "name": "๋จ๋ฐฑ์ง", "label": "๋จ๋ฐฑ์ง(g)", "unit": "g" }
// ... ์ดํ ์๋ต
]
}
๐ฌ ์ค์ ์ฌ์ฉ ์์ (LLM ์ง๋ฌธ)
๐ ์ํ ๊ฒ์ ๋๊ตฌ ์ฌ์ฉ ์์
Claude/Cursor์์ ๋ค์๊ณผ ๊ฐ์ด ์ง๋ฌธํ์ธ์:
"์ฌ๊ณผ์ ์์์ฑ๋ถ ์ ๋ณด๋ฅผ ์๋ ค์ค"
"๋์ฌ์์ ๋ง๋๋ ๋ผ๋ฉด์ ์์์ฑ๋ถ์ ๊ฒ์ํด์ค"
"๊ณผ์ผ๋ฅ ์นดํ ๊ณ ๋ฆฌ์์ ์นผ๋ก๋ฆฌ๊ฐ ๋ฎ์ ์ํ๋ค์ ์ฐพ์์ค"
๐ ์์์ฑ๋ถ ์ฝ๋ ์กฐํ ๋๊ตฌ ์ฌ์ฉ ์์
Claude/Cursor์์ ๋ค์๊ณผ ๊ฐ์ด ์ง๋ฌธํ์ธ์:
"์ํ์์์ฑ๋ถDB์์ ์ ๊ณตํ๋ ์์์ฑ๋ถ ์ฝ๋ ๋ชฉ๋ก์ ๋ณด์ฌ์ค"
"์ด๋ค ์์์ฑ๋ถ๋ค์ ์กฐํํ ์ ์๋์?"
"์์์ฑ๋ถ ๋จ์ ์ ๋ณด๋ฅผ ์๋ ค์ค"
"์ํ์์์ฑ๋ถDB์ ์์์ฑ๋ถ ๋ถ๋ฅ ์ฒด๊ณ๋ฅผ ์ค๋ช ํด์ค"
๐ฏ ์ค์ ๋ํ ์์
์ฌ์ฉ์: "์ฌ๊ณผ์ ์์์ฑ๋ถ์ ์๋ ค์ค"
AI: "์ฌ๊ณผ์ ์์์ฑ๋ถ ์ ๋ณด๋ฅผ ๊ฒ์ํด๋๋ฆฌ๊ฒ ์ต๋๋ค."
[MCP ๋๊ตฌ ํธ์ถ: searchFoodNutrition]
AI: "์ฌ๊ณผ์ ์์์ฑ๋ถ ์ ๋ณด์ ๋๋ค:
- ์ด๋: 52 kcal (100g ๊ธฐ์ค)
- ๋จ๋ฐฑ์ง: 0.3g
- ์ง๋ฐฉ: 0.2g
- ํ์ํ๋ฌผ: 13.8g
- ์์ด์ฌ์ : 2.4g ..."
์ฌ์ฉ์: "์ด๋ค ์์์ฑ๋ถ๋ค์ ์กฐํํ ์ ์๋์?"
AI: "์ํ์์์ฑ๋ถDB์์ ์ ๊ณตํ๋ ์์์ฑ๋ถ ์ฝ๋ ๋ชฉ๋ก์ ํ์ธํด๋๋ฆฌ๊ฒ ์ต๋๋ค."
[MCP ๋๊ตฌ ํธ์ถ: getNutritionComponentTypes]
AI: "๋ค์๊ณผ ๊ฐ์ ์์์ฑ๋ถ๋ค์ ์กฐํํ ์ ์์ต๋๋ค:
- ์๋์ง (kcal)
- ์๋ถ (g)
- ๋จ๋ฐฑ์ง (g)
- ์ง๋ฐฉ (g)
- ํ์ํ๋ฌผ (g)
- ์์ด์ฌ์ (g)
- ํ๋ถ (g)
- ๋ํธ๋ฅจ (mg)
- ์นผ๋ฅจ (mg) ..."
๐ ๊ณ ๊ธ ๊ฒ์ ์์
์ฌ์ฉ์: "๋ญ๊ฐ์ด์ด ์ค์ ์นผ๋ก๋ฆฌ๊ฐ ๋ฎ๊ณ ๋จ๋ฐฑ์ง์ด ๋์ ์ํ์ ์ฐพ์์ค"
AI: "๋ญ๊ฐ์ด์ด ๊ด๋ จ ์ํ ์ค์์ ์นผ๋ก๋ฆฌ๊ฐ ๋ฎ๊ณ ๋จ๋ฐฑ์ง์ด ๋์ ๊ฒ๋ค์ ๊ฒ์ํด๋๋ฆฌ๊ฒ ์ต๋๋ค. ์ํ์์์ฑ๋ถDB์์ ๋ญ๊ฐ์ด์ด ๊ด๋ จ ์ ํ๋ค์ ์ฐพ์๋ณด๊ฒ ์ต๋๋ค."
[MCP ๋๊ตฌ ํธ์ถ: searchFoodNutrition]
AI: "์ํ์์์ฑ๋ถDB์์ ๋ญ๊ฐ์ด์ด ๊ด๋ จ ์ ํ๋ค์ ๊ฒ์ํ ๊ฒฐ๊ณผ, ๋ค์๊ณผ ๊ฐ์ ์ํ๋ค์ ์ถ์ฒ๋๋ฆฝ๋๋ค:
- ๋ญ๊ฐ์ด์ด (์๊ฒ, 100g ๊ธฐ์ค)
- ์ด๋: 165 kcal
- ๋จ๋ฐฑ์ง: 31g
- ์ง๋ฐฉ: 3.6g
- ๋ญ๊ฐ์ด์ด (๊ตฌ์ด๊ฒ, 100g ๊ธฐ์ค)
- ์ด๋: 165 kcal
- ๋จ๋ฐฑ์ง: 31g
- ์ง๋ฐฉ: 3.6g
- ๋ญ๊ฐ์ด์ด (์ถ์๊ฒ, 100g ๊ธฐ์ค)
- ์ด๋: 165 kcal
- ๋จ๋ฐฑ์ง: 31g
- ์ง๋ฐฉ: 3.6g
- ๋ญ๊ฐ์ด์ด (ํ๊ธด๊ฒ, 100g ๊ธฐ์ค)
- ์ด๋: 165 kcal
- ๋จ๋ฐฑ์ง: 31g
- ์ง๋ฐฉ: 3.6g ..."
๐ MCP ์๋ฒ ์ง์ ์คํ ์์
npx k-mfds-fooddb-mcp-server
- MCP ํ๋ซํผ์์ ์๋์ผ๋ก ๋๊ตฌ๋ฅผ ์ธ์/๋ฑ๋กํฉ๋๋ค.
- STDIO ๊ธฐ๋ฐ์ด๋ฏ๋ก, MCP SDK/ModelContext ๋ฑ์์ ๋ฐ๋ก ์ฐ๊ฒฐํด ์ฌ์ฉํ ์ ์์ต๋๋ค.
๐๏ธ ํ๋ก์ ํธ ๊ตฌ์กฐ (์ฐธ๊ณ )
src/
โโโ config/ # ํ๊ฒฝ๋ณ์ ๋ฐ ์ค์
โโโ external/ # ์ธ๋ถ API ์ฐ๋/๋งคํ
โโโ tools/ # MCP ๋๊ตฌ ๊ตฌํ
โโโ index.ts # MCP ์๋ฒ ์ง์
์
๐งช ํ ์คํธ
npm test
๐ค ๊ธฐ์ฌ ๋ฐ ๋ฌธ์
- Pull Request/์ด์ ํ์ํฉ๋๋ค!
- ๋ฌธ์: GitHub Issues
- ์ ์ฅ์: GitHub Repository
๐ ๋ผ์ด์ ์ค
ISC