# Korean Law MCP

> Korean statutes, precedents and ordinances for any LLM, with citation checks

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/chrisryugj/korean-law-mcp
- Website: https://www.npmjs.com/package/korean-law-mcp
- Canonical page: https://ai-tldr.dev/tools/korean-law-mcp/

## In short

Korean Law MCP is an MCP server and command-line tool that connects an AI assistant to Korea's official legal database, the Open API of the Ministry of Government Legislation (법제처). It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in TypeScript and licensed MIT.

## Overview

Korean Law MCP is an MCP server and command-line tool that connects an AI assistant to Korea's official legal database, the Open API of the Ministry of Government Legislation (법제처). Instead of answering Korean legal questions from memory, the model searches and reads the actual source text: statutes, administrative rules, local ordinances, treaties, court precedents, Constitutional Court decisions, tax tribunal and customs rulings, and official interpretations. The project describes it as 42 government APIs compressed into 10 tools, and it works with Claude Desktop, Cursor, Windsurf, Zed, Claude.ai and other MCP-compatible clients.

The advertised tools are deliberately few so they take little of the model's context. `search_law`, `get_law_text` and `get_annexes` look up statutes, article text and annex tables or forms; `search_decisions` and `get_decision_text` cover precedents, Constitutional Court decisions, tax and customs rulings, interpretations, treaties and other decision domains through a single `domain` parameter; `legal_research` runs multi-step research workflows selected by a `task` value; `legal_analysis` bundles the verification features; `ordinance_radar` checks local ordinances against their parent statutes; and `discover_tools` plus `execute_tool` reach the remaining specialised tools. The server also understands Korean legal shorthand — it resolves abbreviations such as 화관법 to 화학물질관리법 and converts article numbers like 제38조 to the API's 003800 format.

Its distinguishing feature is a guard against hallucinated legal citations. `verify_citations` cross-checks every statute and precedent cited in a piece of text against the official database, flagging articles or paragraphs that do not exist and catching real articles cited under the wrong title. `cite_check` traces later decisions that cite a precedent to report whether it is still followed or has been overruled, and `applicable_law` pins the version of a statute that was in force on a given date and diffs it against the current text. The author, a Korean civil servant, built it after searching 법제처 by hand one time too many.

## What it does

- Ten advertised MCP tools covering 42 법제처 Open API endpoints: statutes, administrative rules, ordinances, treaties, precedents and other decision domains
- Citation verification that checks both that a cited statute article or precedent exists and that its cited title matches the real one
- Precedent citator (`cite_check`) and point-in-time law resolution (`applicable_law`) with old-versus-current text diffs and transitional provisions
- Ordinance revision radar that reads an ordinance's statutory basis and flags parent laws amended after the ordinance took effect
- Annex extraction that downloads HWPX, HWP, PDF, XLSX and DOCX attachments and converts them to Markdown with the author's kordoc parser
- Runs locally over stdio, as a self-hosted HTTP server or Docker container, via a hosted remote endpoint, or as a plain `korean-law` CLI

## Getting started

Every setup needs a free 법제처 Open API key, passed to the server as `LAW_OC`. Then either run the interactive setup wizard, register the server by hand, or point a client at the remote endpoint.

1. Get a 법제처 Open API key

   Sign up for a free key on the Ministry of Government Legislation's Open API site (https://open.law.go.kr/LSO/openApi/guideResult.do). The server reads it from the `LAW_OC` environment variable.

2. Run the setup wizard

   The wizard asks for the API key, lets you pick a client and writes its config file. It supports Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI, Zed and Antigravity. For project-folder configs that may be committed to git, Claude Code gets a `${LAW_OC}` reference instead of the key and VS Code prompts for it on first run.

```bash
npx --ignore-scripts --omit=optional korean-law-mcp setup
```

3. Or install globally and register it by hand

   Install the package with `npm install --ignore-scripts --omit=optional -g korean-law-mcp`, then add the server to your MCP client's config (for Claude Desktop, `claude_desktop_config.json`; for Cursor, `.cursor/mcp.json`).

```json
{
  "mcpServers": {
    "korean-law": {
      "command": "korean-law-mcp",
      "env": {
        "LAW_OC": "your-api-key"
      }
    }
  }
}
```

4. Or use the remote endpoint without installing

   Clients with native remote HTTP support, and web clients such as Claude.ai, can use the URL directly. Claude Desktop needs the `mcp-remote` adapter instead (`"command": "npx", "args": ["-y", "mcp-remote", "<same URL>"]`). The key can also be sent as an `apikey` header rather than in the query string.

```json
{
  "mcpServers": {
    "korean-law": {
      "url": "https://korean-law-mcp.fly.dev/mcp?oc=your-api-key"
    }
  }
}
```

5. Query from the terminal

   The same package installs a `korean-law` CLI that calls the tools directly.

```bash
export LAW_OC=your-api-key

korean-law search_law --query "관세법"
korean-law get_law_text --mst 160001 --jo "제38조"
korean-law search_precedents --query "부당해고"
korean-law list                 # all tools
korean-law help search_law      # tool help
```

## When to use it

- Ground an assistant's answers about Korean law in the official statute text instead of the model's memory
- Check an AI-drafted legal memo, contract review or student answer for citations to articles or precedents that do not exist
- Find out whether a Korean precedent is still followed, or which version of a statute applied on the date of an incident
- Help local-government staff spot ordinances whose parent statutes have been amended since the ordinance took effect
