
Korea Data Suite
io.github.choiyounggi由 GitHub 账号 choiyounggi 发布v0.1.1更新于 Oct 24, 2026
Korean public holidays, business-day math, and MOLIT real-estate transactions as MCP tools.
概览
本地 MCP 服务器,通过托管 JSON API 让助手查询韩国公休日、工作日计算以及国土交通部不动产实际交易数据
- 可以做什么
- 查询某年或某月的韩国公休日,包括替代公休日、临时公休日和选举日,并判断某日期是否为公休日或工作日。在指定日期上增加工作日,或统计区间内的工作日数量,自动跳过周末和公休日。查询公寓、写字楼和土地的正常化国土交通部实际交易价格,涵盖买卖、全租和月租,支持日期筛选和游标分页。列出用于筛选不动产查询的 LAWD 地区代码。
- 适用场景
- 当助手需要可靠的韩国日历逻辑来处理排期或截止日期,或需要按地区和房产类型查询韩国不动产实际成交价格时适用。适合原本需要阅读韩文政府文档和 XML 响应的工作流程。
- 运行要求
- 以本地进程运行,通常通过 PyPI 包用 uvx 启动。需要在 KDS_API_KEY 环境变量中提供 Korea Data Suite API 密钥,可在 RapidAPI 页面订阅获取。KDS_API_BASE 变量设置 API 源地址,默认指向托管服务,因此需要能访问该主机的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Korea Data Suite,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Korea Data Suite
English | 한국어
Clean, developer-friendly REST APIs for Korean public data. Korean government open data is powerful but hard to consume — Korean-only docs, XML responses, legacy auth. This suite normalizes it into simple JSON APIs.
▶ Try it on RapidAPI — free tier, no setup. Hosted and auto-updated; same code as this repo. For AI agents, it's on the MCP Registry — uvx korea-data-mcp.
APIs
Get started
Hosted (recommended) — a maintained instance with a free tier and no setup:
→ Subscribe on RapidAPI, grab your key, and call any endpoint. RapidAPI injects the key for you — copy a ready-made snippet from its Code Snippets panel.
Both run the exact same code (this repo). Pick RapidAPI if you'd rather not operate data pipelines; self-host if you want full control.
Self-host
Holidays & Business Days API
Covers official public holidays, substitute holidays (대체공휴일), temporary holidays (임시공휴일), and election days — the cases most global holiday APIs get wrong for Korea.
Real Estate Transactions API
Normalized MOLIT (Ministry of Land) real transaction prices — apartment, officetel, and land; sale, jeonse, and monthly-rent — as clean English JSON with cursor pagination.
Daily sync ingests the current + previous month; use the backfill CLI for history:
Configuration
Environment variables (prefix KDS_, .env supported):
Data sources & attribution
- Holiday data: KASI Special Day Information (한국천문연구원 특일정보), via Korea Public Data Portal (data.go.kr) — KOGL Type 1. Ships with bundled seed data (2025–2027); refreshed weekly when a service key is configured.
- Real transaction data: MOLIT 실거래가 공개시스템 (국토교통부), via Korea Public Data Portal (data.go.kr) — KOGL Type 1.
Run as a daemon (macOS)
To keep the machine awake for serving, disable system sleep
(sudo pmset -a sleep 0) or use a dedicated always-on machine.
See deploy/cloudflared.example.yml for exposing the API via Cloudflare Tunnel
without opening ports.
Handling concurrent traffic
The read path and the write path are separated so traffic scales independently:
- SQLite in WAL mode (set once at init) +
busy_timeout— readers never block the daily writer and vice-versa, and multiple read workers can run concurrently. - API process is read-only, multi-worker.
scripts/run.shruns uvicorn with--workers ${KDS_WORKERS:-2}andKDS_ENABLE_SCHEDULER=false. Each worker is a separate process (separate GIL); WAL lets them all read at once. RaiseKDS_WORKERSto scale reads with cores. - The daily ingest runs as its own process (
com.choiyounggi.kds-sync, 04:00) viascripts/sync.py— never inside the API server, so a multi-thousand-row batch never competes with request handling for the GIL. - Edge caching (optional): responses carry
Cache-Control: no-storefor security. The real-estate data is public and changes at most daily — if origin load grows, serve it with a shortCache-Control: public, max-age=...and let the CDN absorb reads.
Security checklist before exposing externally
The app is hardened at the code layer (API-key auth fail-closed, parameterized SQL, strict input validation, security headers on every response including 5xx, docs/schema off by default, sanitized errors). The following are edge/deploy responsibilities that must be in place before opening the tunnel:
- Never set
KDS_DEV_MODE=truein production — it disables all auth. The app logs a warning at startup if it is on. - Cloudflare rate limiting + WAF on the tunnel hostname — the app has no app-layer rate limit by design (edge responsibility).
- HSTS + TLS are terminated at the Cloudflare edge; confirm HSTS is enabled
there (the origin serves plain HTTP on
127.0.0.1only). - Keep
KDS_ENABLE_DOCSunset (orfalse) in production; settrueonly to serve/docs/openapi.jsonat the origin.
SEO marketing site (programmatic)
A static, SEO-optimized marketing site is generated from the live DB by
scripts/gen_site.py. For every region that has real transaction data it emits a
Korean landing page (the query users actually type — "강남구 아파트 실거래가 API" — backed
by real MOLIT stats, a working curl example, and a signup CTA), plus a holidays
pillar page, a home page, sitemap.xml, and robots.txt.
Quality gate (important): a region is only published if it has at least
MIN_SALE_ROWS (30) apartment-sale rows. Regions without enough data are skipped —
this deliberately avoids thin/doorway pages, which search engines penalize.
Config is env-driven so the same generator works for any domain (put these in
deploy/site.env, gitignored — copy deploy/site.env.example):
Serving — the API app serves it
The FastAPI app serves site/dist at all non-API paths (app.mount("/")),
while /v1/* stays the JSON API. The two get different response headers: the API
keeps its locked-down default-src 'none' CSP + no-store; the site gets an
HTML-renderable CSP (script-src 'none', inline styles allowed) + public cache.
Files are read from disk per request, so regenerating the site goes live with no
app restart — only a code change needs a restart.
The site is served on the same host as the API (api.korea-data.cloud) — the
API lives under /v1, the site everywhere else — so no new tunnel hostname or DNS
is needed. One-time on the serving host:
Submit https://api.korea-data.cloud/sitemap.xml once in Google Search Console.
Want the site on a bare
korea-data.cloud/wwwlater? Add an ingress rule pointing that hostname at the samehttp://127.0.0.1:8642, route its DNS, and switchKDS_SITE_URLto it. Not required — the api host works for SEO today.
First run needs history: the daily sync only ingests the current month. To give pages real depth, backfill once —
uv run python scripts/backfill.py --from 2025-07 --to 2026-06 --regions <codes> --datasets apt_trade,apt_rent.
Automate (macOS daemon)
deploy/com.choiyounggi.kds-site.plist regenerates the site daily at 04:30 (right
after the 04:00 sync) via scripts/publish_site.sh. Because the app serves from
disk, the refreshed pages are live immediately — no restart, no external deploy:
Uptime note: since the site is served by the local app (not a CDN), its SEO availability tracks the machine — keep it awake for serving (
pmset, as the API already requires). If always-on hosting is wanted later, the samesite/distcan be pushed to Cloudflare Pages instead.
MCP server (AI-agent access)
The API is also packaged as a standalone Model Context Protocol
server — packages/korea-data-mcp/ — so AI agents
(Claude Desktop/Code, Cursor, …) can discover and call the endpoints directly. It
is its own minimal package (deps: mcp, httpx) and is what gets published to
PyPI / listed in the MCP Registry.
Quick add (before PyPI, straight from this repo — users bring their own key):
See packages/korea-data-mcp/README.md
for tools, client config, and uvx korea-data-mcp (once on PyPI).
License
MIT © choiyounggi
来源:README.md,提交 1d6e375
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分