
Kosis Openapi Mcp
io.github.rubatoydPublished by GitHub account rubatoydv0.1.0Updated Oct 24, 2026
Korean official statistics (KOSIS) — tables, metadata and observations
Overview
Queries Korean official statistics (KOSIS) tables, metadata and figures, and exports results to xlsx, csv, json or sqlite.
- What you can do
- Wraps the KOSIS shared-service OpenAPI so an assistant can search statistical tables, walk the table list tree, read table metadata (items, classifications, periodicity, source), fetch statistical explanations, and pull actual values by time, classification and item. It also covers the separate key-indicator series, projects a table into citation fields, and saves collected figures to xlsx, csv, json or sqlite. Requests over the 40,000-cell limit are split by period automatically, and multi-axis tables are handled by widening the axis list until it matches.
- When to use it
- Use it when you need Korean national statistics — figures, table structure or survey descriptions — inside an assistant session, for example to look up a table, check its items and periodicity, then retrieve or export the numbers. It is a data-retrieval tool, not a general web search.
- Requirements
- Runs locally over stdio, typically via uvx from the Git repository (no PyPI package yet), so a Python/uv runtime and network access to the KOSIS API are needed. A KOSIS_API_KEY is required: sign up at kosis.kr and request API access (auto-approved). The optional KOSIS_OS_TRUST variable controls use of the OS trust store for TLS.
Installation
In SourceWeft
- Open Kosis Openapi Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
kosis-openapi-mcp
📈 사용량 — 최근 14일 조회 0회(고유 0) · 클론 0회(고유 0) · 릴리스 자산 누적 다운로드 111
2026-11-02 자동 갱신 · 전체 이력은
docs/usage.csv. GitHub 트래픽 통계는 14일 창만 제공하므로 이 저장소가 매일 찍어 누적한다.
KOSIS(국가통계포털) 공유서비스 OpenAPI 를 검색·수집하는 MCP 서버 + CLI.
통계표를 찾고, 항목·분류·주기를 확인하고, 수치를 받아 xlsx·csv·json·sqlite 로 내보낸다. 4만 셀 제한에 걸리면 기간을 알아서 쪼개 전수를 회수한다.
자매 저장소: law-openapi-mcp(법제처) · na-openapi-mcp(국회도서관) · nl-openapi-mcp(국립중앙도서관) · kci-openapi-mcp · scienceON-mcp
무엇을 돌려주나
통계 그 자체다. 표의 메타(작성기관·조사명·수록기간·주기)와 수치(시점 × 분류 × 항목 → 값)를 도메인 그대로 준다.
서지·인용 형식은 부가 기능(kosis_citation)으로 따로 두었다. 서지관리 도구로
넘길 때만 쓰면 되고, 그 도구가 아는 유형 목록이 통계 응답의 모양을 바꾸지는 않는다.
준비물
인증키 하나. kosis.kr 회원가입 후 공유서비스 활용신청(자동 승인).
🔴 발급된 값을 그대로 넣으세요. base64 처럼 보여도(끝이
=) 디코드하면err 11(유효하지 않은 인증키)이 납니다.
설치·실행
MCP 등록:
PyPI 에 올린 패키지가 아직 없어 저장소에서 바로 받아 쓴다(자매 저장소와 같은 방식).
main의 HEAD 를 쓰므로 다음 기동에 최신이 반영된다.
MCP 도구
알아 둘 것 (전부 실측)
172쪽짜리 공식 개발가이드가 있는데도 가장 중요한 셋이 그 안에 없거나 틀리다:
- 🔴
jsonVD=Y가 없으면 JSON 이 아니다 — 키에 따옴표가 없는 자바스크립트 객체 리터럴이 온다. 이 파라미터는 가이드의 입력 변수 표에 없고 JSP 예제 안에만 있다. - 🔴 통계자료를
orgId/tblId로 부르려면/openapi/Param/statisticsParameterData.do를 써야 한다. 가이드가 표를 실어 둔statisticsData.do로 보내면 항상 err 20. - 🔴 인증키를 디코드하지 말 것.
그 밖에:
- 🔴 분류축(
objL) 개수가 표의 축 수와 정확히 맞아야 한다 — 모자라면err 20 (objL), 넘치면err 21. 그런데 축 개수를 알려 주는 메타 서비스가 없다(NCD는 분류가 아니라 신규수록 시점이고OBJ·CLS는err 30).kosis_data가 축을 하나씩 늘려 맞추므로 다축 표(예: 산업 × 규모)도 그냥 부르면 된다 — 확정된 축은meta.obj_levels에 실린다. - 모든 실패가 HTTP 200 이다. 성공은 배열, 실패는
{err, errMsg}객체.Content-Type은 둘 다text/html이라 믿을 수 없다. err 30(결과 없음)은 오류가 아니다 — 0건과 실패를 구분해서 보고한다.- 요청당 4만 셀(err 31) · 분당 200건(err 40).
- 페이징이 없다 — 통합검색·목록·통계자료는 서버가 준 만큼이 전부다(조용히 자르지 않고 알린다).
단 통계주요지표 계열만 예외로
pageNo·numOfRows를 받고 안 주면 10건에서 잘린다 —kosis_indicator_*가 끝까지 넘겨 전수를 회수한다(docs §7). - 🔴 주요지표 계열은 시점 범위를 거르지 않는다(모드 스위치일 뿐 값은 무시된다).
kosis_indicator_data가 전 구간을 받아 직접 거르고meta.server_filtered=false로 알린다. parentListId는 필수라고 적혀 있지만 생략하면 최상위가 온다.
자세한 근거와 재현 방법은 docs/KOSIS_API_GUIDE.md.
라이선스
MIT
Source: README.md at commit 13e07c6
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts