Skip to main content
Glama
rubatoyd

nl-openapi-mcp

by rubatoyd

nl-openapi-mcp

CI Release Downloads

📈 사용량 — 최근 14일 조회 5회(고유 3) · 클론 141회(고유 64) · 릴리스 자산 누적 다운로드 203

일별 클론·조회 추이

2026-09-04 자동 갱신 · 전체 이력은 docs/usage.csv. GitHub 트래픽 통계는 14일 창만 제공하므로 이 저장소가 매일 찍어 누적한다.

국립중앙도서관 소장자료 검색 OpenAPI 를 Claude 등 MCP 클라이언트에서 바로 쓰는 서버 + CLI. 단행본·온라인자료의 서지, KDC 분류, 청구기호, 원문 제공 여부를 검색·수집하고 xlsx/csv/json/sqlite 로 내보냅니다.

자매 프로젝트: kci-openapi-mcp(학술논문·인용지수) · scienceON-mcp(KISTI 문헌)


이 도구가 특별히 신경 쓰는 것 — 조용한 절단 방지

국립중앙도서관 검색 API 는 한 검색식당 500건까지만 돌려줍니다(공식 오류코드 012 DATA LIMIT 500). 그런데 total 은 그보다 큰 값을 태연히 보고합니다.

교육복지: total=1,856  →  실제로 받을 수 있는 건 500건

이 사실을 모르면 부분 집합을 전수로 오인하게 됩니다. 그래서 모든 응답에 total·truncated·cap_hit 을 함께 싣고, 상한에 걸리면 처방까지 문장으로 알려줍니다.

신호

처방

truncated

이번 호출이 total 보다 적게 받음

대개 max_records 를 올리면 해결

cap_hit

total > 500 — API 가 더 안 줌

max_records 로는 불가 (아래 참조)

meta.cap_hit_terms

상한에 걸린 검색어 목록

그 검색어만 세분화

상한을 넘겨 모으는 방법 — 함께 쓰면 전수 수집이 됩니다

교육복지/도서(1,856건) 라이브 실측:

설정

회수

비율

요청

우회 없음

500

27%

1

sort_depth=3

1,746

94%

7

auto_partition=True + sort_depth=1

1,854

100%

24

sort_depth 가 비용 대비 효과가 압도적입니다 — 같은 검색식을 정렬 순서만 바꿔 다시 훑는데, ascdesc 의 교집합이 0건이라 정렬축 하나가 상한을 사실상 2배로 늘립니다. 분할(auto_partition)과 직교하므로 함께 쓸 수 있습니다.

auto_partition=True — 서버측 축으로 재귀 분할

응답 필드명을 파라미터로 넘겨보는 방식으로 실제 동작하는 축 3개를 찾았습니다: categorymanageName(둘 다 완전분할) → licYn. 상한에 걸린 조각만 다음 축으로 더 쪼개고, 부모 조각도 합집합에 넣어 불완전한 축을 써도 손해가 나지 않게 했습니다.

교육복지(전체 7,028건) 실측:

깊이

회수

비율

요청

분할 없음

500

7%

1

1

category

2,134

30%

13

2

+manageName (기본)

3,265

46%

25

3

+licYn

4,722

67%

60

partition_depth(1~3)로 조절합니다. ⚠️ 전수는 아니며 — 깊이 3에서도 33%가 남습니다 — 못 받은 건수는 meta.axes[].partition.unreachable 로 보고합니다.

exact=True — 큰따옴표 구문검색 (⚠️ 넓게 모을 때는 쓰지 마세요)

total 자체가 줄어들어(교육불평등 63 → 28) 상한 아래로 내려갈 수 있습니다. 다만 재현율 손실이 큽니다 — 실측 평균 47%, 최악 84%(교육형평성 31 → 5건). 구문검색은 토큰 인접을 요구하는데 한국어 복합어는 표제에서 조사·수식어로 갈라지기 때문입니다 (교육의 형평성, 초중등교육의 형평성과). 버려진 것의 76%가 관련 문헌이었습니다.

코퍼스 수집은 기본 검색 + contains 후처리, exact 는 전체 표제를 아는 특정 자료 조회용.

⚠️ year_from/contains이미 받은 레코드에 대한 후처리라 상한을 풀어주지 않습니다. 서버측 연도 범위 필터는 확인되지 않았습니다(11개 후보 무시).

🔴 정정(2026-08-12) — 이전 판에서 "정렬은 존재하지 않습니다"라고 적었으나 틀렸습니다. sort=ipub_year&order=asc|desc 가 동작합니다 → sort_depth 로 구현했습니다(위 표). detailSearch=true+f1/v1/and1필드 간 AND/OR/NOT 도 됩니다(AND+NOT=부모 검산 통과) — 이쪽은 아직 미구현입니다. 자세한 내용 → docs/NL_API_GUIDE.md §1-4-b·§1-6·§3-3


Related MCP server: scienceon-mcp

설치

1) Claude Code / Claude Desktop (uvx — 권장)

{
  "mcpServers": {
    "nl": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/rubatoyd/nl-openapi-mcp", "nl-mcp"],
      "env": { "NL_API_KEY": "발급받은_인증키" }
    }
  }
}

2) Claude Desktop .mcpb 원클릭

Releases 에서 내려받아 실행합니다. Python·uv 가 없는 환경이면 OS별 자체완결 번들(-win-x64 / -macos-arm64 / -linux-x64)을 쓰세요.

3) 로컬 개발

git clone https://github.com/rubatoyd/nl-openapi-mcp
cd nl-openapi-mcp
uv sync
uv run pytest -q

클라우드 동기화 폴더(OneDrive 등)에서 작업한다면 venv 를 폴더 밖에 두세요: UV_PROJECT_ENVIRONMENT=~/.venvs/nl-openapi-mcp

4) 다른 MCP 클라이언트

표준 stdio MCP 서버이므로 MCP 를 지원하는 에이전트면 그대로 붙습니다 — Cursor · Windsurf · Cline · Zed · VS Code Copilot(agent mode) · OpenAI Agents SDK · 자체 클라이언트 등. 위 command/args/env 3요소를 각 클라이언트 설정에 옮기면 됩니다.

전송 방식 — stdio(기본) · SSE · Streamable HTTP

로컬 서브프로세스뿐 아니라 HTTP 로도 띄울 수 있습니다. 원격 호스팅이나 stdio 를 못 쓰는 클라이언트를 위한 경로입니다.

nl-mcp                                # stdio (기본)
nl-mcp --transport streamable-http    # http://127.0.0.1:8000/mcp
nl-mcp --transport sse --port 9000    # http://127.0.0.1:9000/sse

환경변수: NL_MCP_TRANSPORT · NL_MCP_HOST · NL_MCP_PORT.

⚠️ HTTP 전송에는 인증이 없습니다. 기본 바인드는 루프백(127.0.0.1)이라 같은 PC 에서만 접근됩니다. --host 0.0.0.0 으로 외부에 열면 인증키를 품은 서버를 그대로 공개하는 것과 같습니다 — 신뢰된 망에서만 쓰세요. 서버도 기동 시 경고를 찍습니다.

Claude 앱 안에서 검색해 설치할 수는 없습니다. 공식 MCP 레지스트리 등재와 Claude Desktop 인앱 커넥터 디렉터리는 별개이고 자동 동기화되지 않습니다. 위 설치 방법 중 하나를 쓰세요.


인증키

www.nl.go.kr 오픈API 신청으로 발급받아 NL_API_KEY 로 설정합니다. 토큰 발급·AES 암호화·공인IP 등록이 필요 없습니다(평문 key 쿼리 파라미터).

cp .env.example .env   # NL_API_KEY 를 채워 넣으세요 (.env 는 gitignore 됩니다)

환경변수

기본값

설명

NL_API_KEY

(필수)

국립중앙도서관 오픈API 인증키

NL_OS_TRUST

1

교육망·사내망 SSL 인터셉션 대응(OS 신뢰저장소 사용). 0 이면 비활성

학교·교육청·사내망은 자체서명 루트 CA로 TLS를 가로챕니다. 이 도구는 검증을 끄지 않고 truststore 로 OS 신뢰저장소를 사용해 통과합니다.


MCP 도구

도구

설명

nl_status

인증키 유효성 + API 실제 왕복 1회 점검

nl_search

소장자료 검색 (total·truncated·cap_hit 동반)

nl_collect

검색어 합집합 수집 → 파일 저장. save=false 면 미리보기만

예시

"국립중앙도서관에서 '교육불평등', '교육격차', '학력격차' 관련 단행본을 모아서 xlsx로 저장해줘"

nl_collect 가 세 검색어를 각각 조회해 id 기준으로 합집합을 만들고, 상한에 걸린 검색어가 있으면 meta.cap_hit_terms 로 지목합니다.

출력 파일명은 정규화됩니다. name 을 지정하지 않으면 검색어가 그대로 파일명이 되므로, 경로 구분자·..·윈도 금지문자는 제거되고 결과는 항상 out_dir 안에만 저장됩니다. 한글 파일명은 그대로 보존됩니다.


CLI

nl status
nl search 교육불평등 --category 도서 --rows 20
nl collect --terms 교육불평등 교육격차 학력격차 --category 도서 --format xlsx json

# 500 상한을 넘겨 모으기 — 정렬 뒤집기가 가장 값싸다 (7요청에 94%)
nl collect --kwd 교육복지 --category 도서 --sort-depth 3 --format xlsx

# 분할과 함께 쓰면 전수 수집 (실측 100%)
nl collect --kwd 교육복지 --category 도서 --auto-partition --sort-depth 1 --format xlsx

응답 필드

정규화 25개 컬럼 + 원본 24개 필드(raw) 보존. 전체 표와 결측률은 docs/NL_API_GUIDE.md §2 참조.

주의할 필드 2가지 — 이름이 …Yn 이지만 불리언이 아닙니다:

  • docYndoc_type: NL_VIEWER · LD_VIEWER · FILE · LINK · N

  • licYnlic_code: L · F · S · D · N · Y

원문 보유 판정은 Holding.has_fulltext() 를 쓰세요("N"·빈값만 거짓).


검증 상태

  • ✅ 응답 스키마 24개 필드 — 실응답 1,124건 전수 집계로 확정

  • ✅ 500건 상한 — 공식 오류코드 + 실제 수집 로그 + 오프셋 기준까지 실측

  • 호출 규격 라이브 전수 검증srchTarget 지원/폴백, category 12종, sort 색인 필드명, ipub_year 연도 필터, f-슬롯 불리언, 오류 봉투, 0건 응답 형태. scripts/probe_api.py 로 재현 가능

  • ✅ 오프라인 회귀 186건 · MCP stdio 핸드셰이크 · CI 콜드 스타트 스모크 · 자체완결 바이너리 클린 환경 검증

  • ⚠️ 서버측 연도 범위(from~to) 필터만 미확인 — 단일 연도(ipub_year)는 동작합니다


라이선스

MIT

Available Tools

3 tools
nl_collectA

[수집] 검색어들을 각각 조회해 합집합으로 모으고 파일로 저장한다.

terms: 변형어 목록(각각 개별 검색 후 합집합). 검색어를 쪼갤수록 500건 상한을 덜 받으므로 넓은 말 하나보다 좁은 말 여럿이 회수량이 많다. kwd: 단일 검색어(terms 대신). exact: 🔴 코퍼스 수집에는 쓰지 말 것. 구문검색은 토큰 인접을 요구해 한국어 복합어가 조사·수식어로 갈라진 표제(교육의 형평성)를 전부 놓친다. 실측 재현율 손실 평균 47%, 최악 84%(교육형평성 31→5건)이고 버려진 것의 76%가 관련 문헌이었다. 변형어를 늘려도 회복되지 않는다(12/31). 자료를 넓게 모으려면 False 로 두고 걸러내기는 contains 후처리로 하라. exact 는 전체 표제를 아는 특정 자료 조회용이다. category: 도서·학위논문·잡지/학술지·기사 등. ⚠️ "전체" 는 오류(013) — 생략할 것. auto_partition: 500 상한 우회. 검색어가 상한에 걸리고 category 를 지정하지 않았으면 서버측 축으로 재귀 분할해 재수집한다. 축은 실측으로 찾은 3개다 — categorymanageName(둘 다 완전분할) → licYn(값이 빈 레코드는 못 잡음). 상한에 걸린 조각만 다음 축으로 더 쪼개고, 부모 조각도 합집합에 넣어 불완전한 축을 써도 손해가 나지 않게 한다. partition_depth: 분할 깊이(1~3, 기본 2). 실측 회복량(교육복지 전체 7,028건): 분할 없음 500(7%) → 깊이1 2,134(30%) → 깊이2 3,265(46%) → 깊이3 4,722(67%). ⚠️ 호출 수가 함께 는다(13 → 25 → 60회). 깊이 3은 코퍼스 전수성이 중요할 때만. ⚠️ 전수는 여전히 불가능하다. meta.axes[].partition.unreachablestill_capped 가 못 받은 건수와 남은 조각을 보고한다. contains: 결과 텍스트 부분일치 후처리. year_from/year_to: 발행연도 필터. formats: xlsx/csv/json/sqlite (기본 3종). save=false 면 저장 없이 미리보기만. out_dir 미지정 시 홈의 nl-output/. extra_params: 임의 API 파라미터 전달.

⚠️ year_from/year_to/contains 는 로컬 후처리다 — 이미 받은 레코드에만 걸린다. 500건 상한을 풀어주지 않는다. 서버측 연도 필터는 존재하지 않는다(실측: startPubYear·pubYearStart 등 11개 후보 전부 무시됨). 연도로 상한을 우회할 수는 없다.

⚠️ meta.cap_hit_terms 에 검색어가 있으면 그 검색어는 500건에서 잘린 것이다. max_records 를 올려도 해결되지 않는다 — 검색어를 좁히거나 category 로 쪼갤 것. meta.year_missing_dropped 는 발행연도가 비어 연도 필터에서 탈락한 건수다 (실측 5.2%의 레코드는 pubYearInfo 가 비어 있다).

ParametersJSON Schema
NameRequiredDescriptionDefault
kwdNo
nameNo
saveNo
exactNo
termsNo
formatsNo
out_dirNo
year_toNo
categoryNo
containsNo
year_fromNo
max_recordsNo
srch_targetNotitle
extra_paramsNo
auto_partitionNo
partition_depthNo

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations, the description discloses many behavioral traits: local post-processing for year filters ('year_from/year_to/contains 는 로컬 후처리다'), the 500-record cap, inability to achieve full enumeration ('전수는 여전히 불가능하다'), and side effects like file saving and multiple API calls. It also details measured failure rates for `exact`, providing valuable real-world context. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a one-line summary followed by parameter-by-parameter explanations and clearly marked warnings (⚠️). Although long, every sentence provides essential information or empirical data, and the use of bold and bullet-like formatting improves readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (16 parameters, no output schema), the description covers almost every aspect, including meta output fields (`meta.cap_hit_terms`, `meta.year_missing_dropped`, `meta.axes[].partition.unreachable`), failure modes, and performance metrics. The only omissions are `name` and `srch_target`, but these are relatively minor and inferred by name.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates thoroughly, explaining nearly all 16 parameters including `terms`, `kwd`, `exact`, `category`, `auto_partition`, `partition_depth`, `contains`, `formats`, `save`, `out_dir`, `year_from/year_to`, `extra_params`, and `max_records`. It adds critical meanings such as the union logic and local filtering behavior that schema alone cannot convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with '[수집] 검색어들을 각각 조회해 **합집합**으로 모으고 파일로 저장한다' (collects queries into a union and saves to file), clearly stating the tool's function. It distinguishes from sibling tools by emphasizing saving to file and union aggregation, which is not mentioned in nl_search or nl_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive usage guidance: warnings against using `exact` for corpus collection ('코퍼스 수집에는 쓰지 말 것'), instructions for `auto_partition` to bypass the 500 limit, and trade-offs for `partition_depth`. However, it does not explicitly compare with sibling tools `nl_search` or `nl_status` to clarify when to choose this tool over them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nl_statusA
Read-only

연결 점검 — 인증키 보유 여부 + 소장자료 검색 API 실제 왕복 1회.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds that the tool performs an actual network round trip and checks for the auth key, which provides useful behavioral context beyond what annotations offer. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise Korean sentence that front-loads the tool's purpose ('연결 점검') followed by specific details. There is no waste or unnecessary repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description sufficiently covers its purpose and behavioral aspects. It does not specify the return format, but for a status check this is likely inferred and not critical. Adequate for the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the input schema is complete and coverage is 100%. The description correctly does not include parameter details, and the baseline of 4 applies for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies the tool as a connection check ('연결 점검') and specifies that it verifies authentication key presence and performs one actual round trip to the search API. This clearly sets it apart from sibling tools nl_search and nl_collect, which are focused on searching and collecting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies that this tool is for checking connectivity and auth status before using search/collect tools. While it does not explicitly state 'use this before nl_search', the context is evident from the tool name and description, providing clear usage context without explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.4.0
    • First observednl_collect
    • First observednl_search
    • First observednl_status

TDQS

A4.7/5.0
Disambiguation5/5

Each tool has a distinct purpose: nl_status verifies connectivity, nl_search performs a single query, and nl_collect aggregates multiple searches with saving and partitioning. Though nl_search and nl_collect both search, their roles are clearly separated (single vs. batch), so an agent cannot confuse them.

Naming Consistency5/5

All tool names share the consistent 'nl_' prefix and lowercase_snake_case format. While 'status' is a noun and 'search'/'collect' are verbs, the naming is predictable and each name directly reflects its function, making the pattern easy to infer.

Tool Count5/5

Three tools is a well-scoped count for a library search MCP, providing essential operations without redundancy. Each tool carries substantial functionality, especially nl_collect which bundles complex features like recursive partitioning and filtering, so every tool earns its place.

Completeness5/5

The set covers the full lifecycle of searching and collecting library records: health check, individual search, and batch collection with export options. It also addresses API limitations (e.g., 500-record cap) through built-in partitioning and provides explicit workarounds, leaving no obvious gaps for the stated domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    MCP server for searching Korean scientific literature, patents, reports, and more via the KISTI ScienceON API.
    17
    1
    Creative Commons Attribution Non Commercial 4.0 International
  • A
    license
    A
    quality
    A
    maintenance
    Enables searching and collecting academic literature metadata from KISTI ScienceOn via Claude or CLI, supporting various document types and export formats.
    5
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables searching and harvesting Korean Citation Index literature, citation indices, and references via REST API and OAI-PMH.
    7
    2
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Enables querying the Korea Citation Index (KCI) Open API to search reference lists, retrieve journal citation indices, and view citation detail history for Korean academic journals.
    5
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rubatoyd/nl-openapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server