Skip to main content
Glama

DAPA MCP

DAPA MCP is a read-only Model Context Protocol server that supports the Republic of Korea's defense acquisition work. Instead of relying on the LLM's memory, it queries the Ministry of Government Legislation's National Legal Information Center shared-use Open API and the source-attributed DAPA_info. The core principle is Search → Retrieve → Verify → Compare → Cite → Explain.

v0.1.0 implements the first phase of Core and Legal Information MCP Parity. It provides local stdio, 17 tools, the DAPA official statutes and administrative rules catalog, structured legal details, history lookup, and as-of-date search. Streamable HTTP, patents, papers, news, open data, and new/old provision comparison are not implemented yet and are classified in ROADMAP.md.

Why MCP?

  • Prioritize official sources to avoid confusing current statutes with past or repealed regulations.

  • Re-query and verify cited statute names, provisions, and case numbers.

  • Distinguish NOT_FOUND (a normal zero-result case) from SOURCE_UNAVAILABLE (timeout, 429, 5xx, or corrupted response).

  • Attach source, verification date, and verification status to organizational and work knowledge as well.

Related MCP server: 갈피 법령조회 MCP

Architecture

Claude / Gemini / Codex / MCP Client
                  │ stdio
                  ▼
         DAPA MCP Tool Registry
           ├── LawProvider ── 국가법령정보 Open API
           ├── DapaCatalogProvider ── DAPA 공식 목록 스냅샷
           └── DapaInfoProvider ── DAPA_info

See docs/ARCHITECTURE.md for detailed design and benchmark records.

Installation and Execution

Requires Node.js 20.19 or higher.

npm install
cp .env.example .env
npm run build
npm test
npm run start

npm run start is a stdio JSON-RPC server, so it is normal for it to wait in the terminal. It does not output general logs to stdout.

To update the official DAPA statutes and administrative rules list, run the following command.

npm run sync:dapa-catalog

To compare each catalog item with the current search results of the National Legal Information Center shared-use Open API and create a list of unmatched items, run the following command. The development script explicitly passes the public default authentication value.

LAW_API_OC=dusgh4847 npm run audit:dapa-catalog

In PowerShell, run it as follows.

$env:LAW_API_OC = "dusgh4847"
npm run audit:dapa-catalog
Remove-Item Env:LAW_API_OC

The result is saved to DAPA_info/legal/coverage-report.json. missing means the title in DAPA's official list was not found identically in the National Legal Information Center API; it does not assert that the document does not legally exist. Items with repeal/enactment history, title notation differences, or originals provided only as files require separate verification. title_variant is a case where the DAPA display title differs from the API canonical title but the corresponding document was confirmed. metadata_mismatch is a case where the title is the same but the administrative rule issuance number or date differs, and external_only refers to statutes for which DAPA provides only an external original text link outside the National Legal Information Center.

This report depends on a catalog snapshot. Whenever the catalog is synchronized again, the audit must also be re-run. The number of missing items means candidates that have not yet been linked to API documents, not legal non-existence. Therefore, do not treat the entire catalog as fully covered by National Legal Information Center texts.

To update the 업무·정책 menu and the sub-tab content of each page into DAPA_info/policy/catalog.json, run the following command. It collects only DAPA internal pages and removes duplicates based on menuSeq and the final page ID. If run twice at the same time, it detects a lock file and terminates the second synchronization.

npm run sync:dapa-policy

To sequentially call the official 14 categories and 40 detailed APIs against the current live server and check list/body connections and errors, run the following command. The custom default sample code uses the L/A/O codes from the official guide and can be replaced with environment variables.

LAW_API_OC=dusgh4847 npm run backtest:law-api

Environment Variables

Name

Required

Default

Description

LAW_API_OC

No

dusgh4847

Public default authentication value for the National Legal Information Center shared-use API; can be overridden with a separate value

LAW_API_TIMEOUT_MS

No

10000

Request timeout

LAW_API_RETRY_LIMIT

No

2

Upper limit for 429/5xx retries

LAW_API_CACHE_TTL_MS

No

300000

API search cache TTL (milliseconds); 0 disables the cache

LAW_API_MAX_TEXT_RESPONSE_BYTES

No

8388608

Maximum bytes for JSON/HTML API responses

LAW_API_MAX_RESOURCE_RESPONSE_BYTES

No

26214400

Maximum bytes for attached table/form files

LAW_API_MAX_TOOL_RESPONSE_CHARS

No

250000

Maximum characters for JSON output of legal API MCP tools

DAPA_INFO_PATH

No

./DAPA_info

Public knowledge root

The default authentication value dusgh4847 is disclosed in code and documentation so that anyone can use it immediately. To use a separate authentication value, override LAW_API_OC. .env is excluded from Git.

You can use the legal API with the default authentication value without any separate authentication procedure. If you have your own authentication value, the MCP client passes it as the LAW_API_OC environment variable when starting the server, and you can check law: healthy in source_health.

MCP Tools

Tool

Role

search_legal

Searches statutes, administrative rules, precedents, Constitutional Court decisions, interpretation cases, and administrative appeals

search_legal_content

Queries the National Legal Information Center API candidate list and then retrieves the detailed text and provisions of each document

get_legal_detail

Retrieves details of a search result documentId

get_legal_history

Retrieves the enactment, amendment, and repeal history of statutes

list_legal_apis

Retrieves the catalog of 14 categories and 40 list/body National Legal Information Center APIs related to DAPA

query_legal_api

Queries official list/body on demand by catalog apiId

get_legal_api_body

Automatically links the body API using the list apiId and result identifier; extracts body text from attached table/form files

verify_citations

Verifies statute provisions and case numbers

search_dapa_info

Searches public knowledge about organizations, terms, and work

get_dapa_organization

Retrieves details of an organization name or alias

search_dapa_policy

Searches the content of the work/policy menu and sub-tabs

get_dapa_policy_page

Retrieves the full work/policy text by search result ID

search_dapa_legal_catalog

Searches the DAPA official statutes and administrative rules list

get_dapa_legal_catalog_item

Retrieves details of a DAPA official list item

get_dapa_legal_content

Links DAPA items to National Legal Information Center texts and retrieves them

dapa_catalog_status

Synchronization status of the DAPA official list

source_health

Checks provider settings and status

committee_decision only provides an input contract; the actual provider is not configured yet. asOfDate is handled as an effective-date search in the Ministry of Government Legislation's eflaw, and returns NOT_FOUND when no data exists for that effective date. The default value of currentOnly is true, and it also excludes administrative rules with explicit history or repeal status. Use currentOnly: false when past data is needed, and forceRefresh: true when a fresh API re-query is needed. The default cache TTL for successful search results is 5 minutes.

list_legal_apis returns only the API metadata for the 14 categories below. The actual response body is queried from the Ministry of Government Legislation at request time by query_legal_api, and get_legal_api_body retrieves the body using the identifier or attachment link from the list result, so the full legal data is not loaded into the MCP context or DAPA_info. Each API in list_legal_apis is returned with an executable bodyTool and, when a separate body API exists, a bodyApiId.

Category

List/body processing

Prior consultation opinions

Board of Audit and Inspection baiPvcs list/body

Central government first-instance interpretation

Defense Acquisition Program Administration dapaCgmExpc list/body

Legal information knowledge base

9 types: terms, provisions, related statutes, and intelligent search

Custom

6 types of statute, administrative rule, and local ordinance lists and provisions; requires vcode

Legal terms

lstrm list/body

Attached tables/forms

Lists of statutes, administrative rules, and local ordinances, and extraction of HWP/HWPX/PDF/XLSX/DOCX original text bodies

Treaties

trty list/body

Constitutional Court decisions

detc list/body

Statutory interpretation cases

expc list/body

Administrative appeal cases

decc list/body

Statutes

law list/body

Administrative rules

admrul list/body

Local ordinances

ordin list/body

Precedents

prec list/body

Since the official guide does not provide an independent body API for attached tables/forms, pass the list response's 별표서식파일링크 or 별표서식PDF파일링크 to attachmentUrl in get_legal_api_body. The server downloads only official Ministry of Government Legislation links and converts the files into Markdown body text. Custom lists are interpreted through the linked general statute body API, and custom provision APIs are interpreted through their own responses.

The DAPA catalog preserves the scope, classification, and issuance metadata from the official website, while actual provisions and legal texts are queried from the National Legal Information Center shared-use API in search_legal and get_legal_detail.

MCP Client Connection

Replace /absolute/path/to/DAPA MCP in all examples with the actual absolute path and build first.

Codex CLI

The current local stdio registration command for Codex CLI is as follows.

codex mcp add dapa-mcp -- node "/absolute/path/to/DAPA MCP/dist/index.js"
codex mcp list

Claude Code

Use the stdio format from the official Claude Code MCP documentation.

claude mcp add --transport stdio dapa-mcp -- \
  node "/absolute/path/to/DAPA MCP/dist/index.js"
claude mcp list

Claude Desktop currently recommends deploying the local server as a Desktop Extension. Since v0.1.0 does not provide a .mcpb package, use a Claude Code stdio connection during development.

Gemini CLI

Following the official Gemini CLI MCP documentation, add it to mcpServers in ~/.gemini/settings.json.

{
  "mcpServers": {
    "dapa-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/DAPA MCP/dist/index.js"],
      "timeout": 30000,
      "trust": false
    }
  }
}

ChatGPT and OpenAI API

MCP tools for the ChatGPT custom connector and the OpenAI Responses API use a remote MCP server_url. Since v0.1.0 is local stdio only, it does not claim to support direct connection. After Phase 2, which adds Streamable HTTP and authentication, connect according to the official OpenAI Remote MCP documentation.

How to Add to DAPA_info

Structured items are written as JSON with an items array. The required fields are id, name, category, description, source, sourceUrl, lastVerifiedAt, and verified. Store unverified information as verified: false and do not present it as official fact. Keep explanatory materials in Markdown, but state that they do not replace legal grounds.

{
  "items": [
    {
      "id": "term-example",
      "name": "예시 용어",
      "aliases": [],
      "category": "terminology",
      "description": "쉬운 설명",
      "source": "공식 문서명",
      "sourceUrl": "https://example.go.kr/source",
      "lastVerifiedAt": "2026-08-27",
      "verified": false
    }
  ]
}

Development and Verification

npm run lint
npm run typecheck
npm test
npm run build

Tests include normalization, local knowledge search, official API wire fakes, 429/5xx/corrupted responses, citation verification, and actual stdio MCP listing and invocation.

  • Store only publicly disclosable information. Personal information, non-public business information, military secrets, and internal network addresses are prohibited.

  • MCP results do not replace legal opinions or policy decisions.

  • verified: true means the data was retrieved from an official source, not a guarantee of legal judgment.

  • Even if news is added in the future, it will not be used as a legal basis.

Data Sources and License

The source code is distributed under the MIT License. The rights to and terms of use of the provided data follow the policies of each original provider. Detailed notices are in NOTICE.

Available Tools

17 tools
dapa_catalog_statusB
Read-onlyIdempotent

DAPA 공식 법령·행정규칙 카탈로그의 동기화 상태를 반환합니다.

Inputs: no named parameters.

get_dapa_organizationA
Read-onlyIdempotent

방위사업청 조직명 또는 별칭으로 조직 상세를 조회합니다.

Inputs: query (required).

get_dapa_policy_pageA
Read-onlyIdempotent

search_dapa_policy에서 받은 ID로 업무·정책 페이지 전체 본문을 조회합니다.

Inputs: id (required).

search_dapa_infoB
Read-onlyIdempotent

공개 출처 기반 DAPA_info에서 조직·용어·업무 지식을 검색합니다.

Inputs: query (required), limit, categories.

search_dapa_policyB
Read-onlyIdempotent

방위사업청 업무·정책 메뉴와 하위 탭에서 동기화한 공개 본문을 검색합니다.

Inputs: query (required), limit, section.

source_healthA
Read-onlyIdempotent

각 데이터 Provider의 설정 및 가용 상태를 반환합니다.

Inputs: no named parameters.

verify_citationsA
Read-onlyIdempotent

법령 조문 또는 사건번호가 공식 출처에 실제 존재하는지 검증합니다.

Inputs: citations (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 17 tools

    Disambiguation3/5

    The set is separated by source and action, but get_legal_detail, get_legal_api_body, get_dapa_legal_content, and search_legal_content all concern retrieving legal document text or detail, creating real selection risk. The five search_* tools are more distinct because their source targets are clearer.

    Naming Consistency4/5

    Most tools follow a predictable verb_noun snake_case pattern such as search_*, get_*, and list_*. A few exceptions like source_health and dapa_catalog_status are noun-phrase status checks, and the placement of 'dapa' varies across names.

    Tool Count4/5

    With 17 tools, this is on the heavier side but each covers a distinct area: official legal APIs, DAPA catalog, policy pages, organization lookup, citation verification, and provider health. The count is slightly above a lean toolkit but not bloated.

    Completeness4/5

    The read-only domain is broadly covered with search, detail retrieval, legal history, citation verification, catalog status, policy pages, and organization lookup. Minor gaps remain for enumerated browsing such as listing all policy pages or the full organization tree, but agents can work around them.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI programs to search and retrieve approved public regulations with citations, supporting PDF, HWP, HWPX, and DOCX formats.
      44
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to search and retrieve Korean laws, regulations, administrative rules, legal interpretations, and precedents via official APIs for legal review workflows.
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables deterministic research of Korean tax-law issues by retrieving and scoring official statutory evidence from law.go.kr and other legal sources, with citation verification and provenance, without deciding legal conclusions.
      8
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Korean tax law for AI agents: search NTS rulings, court and Tax Tribunal decisions; read point-in-time statutes with the Act → Decree → Rule chain and amendment history; basic rules and execution standards; 96 tax treaties with withholding rates; forms and schedules; and verify citations in drafts. Fact-pattern comparison is done by your AI (or optional on-prem/cloud Upstage Solar).
      54
      1,626 PyPI
      13
      MIT