█

AI/TLDR

Korean Law MCP

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

RAG Frameworks & PlatformsOpen source
Language
TypeScript
License
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.

VideoThe author's walkthrough of using Korean Law MCP (narration in Korean).딴짓하는 류주임 ↗

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.

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.

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.

bashbash
npx --ignore-scripts --omit=optional korean-law-mcp setup
VideoConnecting the server to Claude, step by step (in Korean).딴짓하는 류주임 ↗

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`).

jsonjson
{
  "mcpServers": {
    "korean-law": {
      "command": "korean-law-mcp",
      "env": {
        "LAW_OC": "your-api-key"
      }
    }
  }
}
VideoConnecting the remote endpoint to ChatGPT (in Korean).딴짓하는 류주임 ↗

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.

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

Query from the terminal

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

bashbash
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

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

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

How Korean Law MCP compares

Korean Law MCP alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Dify★ 158kAn open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code.
graphify★ 123kTurns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store.
RAGFlow★ 91.6kA RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer.
Context7★ 62.6kContext7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server.
Pathway★ 62.2kA Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes.
LightRAG★ 40kA graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates.
Quivr★ 39.6kQuivr is an open-source RAG framework that ingests your documents and answers questions about them, working with any LLM and any file type.
Korean Law MCP★ 2.6kKorean statutes, precedents and ordinances for any LLM, with citation checks