MCPInstall

korean-law-mcp

MCP server providing access to 41 Korean legal APIs (법제처) with citation verification, impact analysis, and time-travel diff capabilities

Installs
215
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/reason-machines/mcp-skills --skill korean-law-mcp
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads korean-law-mcp automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

korean-law-mcp

Skill by ara.so — MCP Skills collection.

Overview

korean-law-mcp is a Model Context Protocol (MCP) server that transforms 41 Korean Ministry of Government Legislation (법제처) APIs into 17 streamlined tools. It provides comprehensive access to Korean legal information including statutes, precedents, administrative rules, local ordinances, treaties, and interpretations with advanced features like:

  • Citation verification to detect LLM hallucinations in legal responses
  • Impact mapping showing downstream effects of legal provisions
  • Time-travel diff comparing statute text between arbitrary dates
  • Citizen action plans converting natural language problems into 5-step legal guides

The server integrates with Claude Desktop, Cursor, Windsurf, Zed, and other MCP clients. All data comes from official 법제처 (Korea Legislation Research Institute) APIs.

Installation

NPX (Recommended)

Add to your MCP client configuration (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "korean-law": {
      "command": "npx",
      "args": [
        "-y",
        "korean-law-mcp"
      ],
      "env": {
        "MOLEG_API_KEY": "your-api-key-here"
      }
    }
  }
}

Global Install

npm install -g korean-law-mcp
korean-law-mcp

Local Development

git clone https://github.com/chrisryugj/korean-law-mcp.git
cd korean-law-mcp
npm install
npm run build
npm start

Configuration

Required Environment Variables

# 법제처 Open API key (required)
MOLEG_API_KEY=your_api_key_here

Get your API key from: https://www.law.go.kr/DRF/lawService.do

Optional Environment Variables

# Server configuration
PORT=3000                    # HTTP server port (default: 3000)
TRUST_PROXY=1               # Trust X-Forwarded-For (default: 1)
LAW_USER_AGENT=Mozilla/5.0  # Custom User-Agent for API calls

# Rate limiting (per IP)
RATE_LIMIT_WINDOW_MS=60000  # Window in ms (default: 60000)
RATE_LIMIT_MAX_REQUESTS=100 # Max requests per window (default: 100)

Core Tools

1. Citation Verification (verify_citations)

Detects LLM hallucinations by cross-referencing cited legal provisions against official databases.

// Natural language trigger
"민법 제750조에 따라 불법행위 손해배상을 청구하고, 형법 제9999조는 가중처벌을 정한다"

// Tool input
{
  "userText": "민법 제750조에 따라 불법행위 손해배상을 청구하고, 형법 제9999조는 가중처벌을 정한다"
}

// Response structure
{
  "citations": [
    {
      "lawName": "민법",
      "article": "750",
      "status": "verified",
      "exists": true,
      "title": "불법행위의 내용"
    },
    {
      "lawName": "형법", 
      "article": "9999",
      "status": "invalid",
      "exists": false,
      "reason": "해당 조문 없음 (존재 범위: 제1조~제372조)"
    }
  ],
  "summary": "검증 결과: 2건 중 ✓ 1건 실존, ✗ 1건 환각"
}

2. Impact Map (impact_map)

Generates dependency graphs showing which precedents, decisions, and regulations cite a specific provision.

// Natural language trigger
"민법 제103조 인용한 판례"

// Tool input
{
  "lawName": "민법",
  "article": "103"
}

// Response includes Mermaid graph code
{
  "graph": "graph LR\n    민법_제103조[\"⚖️ 민법 제103조\"] --> P[\"📚 대법원 판례\"]\n    ...",
  "precedents": [...],
  "constitutionalDecisions": [...],
  "localOrdinances": [...]
}

3. Time Travel Diff (time_travel)

Compares statute text between two dates with automatic article-level diff.

// Natural language trigger
"개인정보보호법 2020-01-01 vs 2025-11-01"

// Tool input
{
  "lawName": "개인정보보호법",
  "dateA": "20200101",
  "dateB": "20251101"
}

// Response structure
{
  "metadata": {
    "lawName": "개인정보보호법",
    "dateA": "2020-01-01",
    "dateB": "2025-11-01"
  },
  "diff": [
    {
      "article": "제15조",
      "changeType": "modified",
      "before": "...",
      "after": "...",
      "charDelta": "+120"
    },
    {
      "article": "제39조의2",
      "changeType": "added",
      "after": "..."
    }
  ]
}

4. Citizen Action Plan (action_plan)

Converts natural language legal problems into structured 5-step guides.

// Natural language trigger
"전세금 못 받았어"

// Tool input
{
  "situation": "전세금 못 받았어"
}

// Response structure
{
  "steps": [
    {
      "step": 1,
      "title": "상황진단",
      "content": "주택임대차보호법 제3조의2 (임차권등기명령)",
      "relevantLaws": ["주택임대차보호법"]
    },
    {
      "step": 2,
      "title": "권리/구제수단",
      "precedents": [...]
    },
    {
      "step": 3,
      "title": "신청기관/기한",
      "agencies": ["지방법원", "임대차분쟁조정위원회"]
    },
    {
      "step": 4,
      "title": "필요서류/양식",
      "documents": [...]
    },
    {
      "step": 5,
      "title": "함정/주의사항",
      "warnings": ["소멸시효 3년", "법률구조공단 무료 지원"]
    }
  ]
}

5. Search Laws (search_law)

Search Korean statutes by keyword.

// Tool input
{
  "query": "개인정보",
  "display": 10
}

// Response
{
  "results": [
    {
      "lawId": "001615",
      "lawName": "개인정보 보호법",
      "lawAbbr": "개인정보보호법",
      "promulgationDate": "20110329",
      "enforcementDate": "20110930"
    }
  ],
  "nextSteps": "💡 다음: get_law_text({lawName: '개인정보 보호법'})"
}

6. Get Law Text (get_law_text)

Retrieve full statute text with hierarchical structure.

// Tool input
{
  "lawName": "민법",
  "enforcementDate": "20250101" // optional
}

// Response
{
  "lawName": "민법",
  "articles": [
    {
      "articleNumber": "1",
      "articleTitle": "법원",
      "paragraphs": [
        {
          "paragraphNumber": "1",
          "content": "민사에 관하여 법률에 규정이 없으면..."
        }
      ]
    }
  ]
}

7. Get Precedents (get_precedents)

Search court decisions, constitutional decisions, and administrative appeals.

// Tool input
{
  "query": "부당해고",
  "decisionType": "precedent", // or "constitutional", "admin_appeal"
  "display": 5
}

// Response (with compact mode by default)
{
  "decisions": [
    {
      "caseNumber": "2023두12345",
      "court": "대법원",
      "decisionDate": "2023-05-15",
      "caseTitle": "부당해고구제재심판정취소",
      "summary": "판시사항 [800자] ... [중략] ... 주문 [400자]",
      "referenceLaws": ["근로기준법 제23조"],
      "referencePrecedents": ["2020.3.26. 2018두56077"]
    }
  ]
}

Add "full": true to get complete decision text:

{
  "query": "부당해고",
  "decisionType": "precedent",
  "full": true
}

Common Patterns

Multi-Step Legal Analysis

// Step 1: Search relevant law
search_law({ query: "식품위생법" })

// Step 2: Get full text
get_law_text({ lawName: "식품위생법" })

// Step 3: Check precedents
get_precedents({ 
  query: "식품위생법 영업정지", 
  decisionType: "admin_appeal" 
})

// Step 4: Get penalty schedules (별표)
get_annex({ 
  lawName: "식품위생법", 
  annexType: "별표" 
})

// Step 5: Check administrative rules
search_administrative_rules({ query: "식품위생법 시행규칙" })

Contract Review Workflow

// 1. Verify all cited provisions
verify_citations({ 
  userText: "[contract text with legal citations]" 
})

// 2. For each valid citation, get impact map
impact_map({ 
  lawName: "민법", 
  article: "103" 
})

// 3. Check if provisions have changed recently
time_travel({ 
  lawName: "민법",
  dateA: "20200101",
  dateB: "20250101"
})

Regulatory Compliance Check

// 1. Find all relevant regulations
search_law({ query: "개인정보" })
search_administrative_rules({ query: "개인정보" })

// 2. Get enforcement dates
get_law_text({ 
  lawName: "개인정보 보호법",
  enforcementDate: "20250101" 
})

// 3. Check interpretations
get_interpretations({ query: "개인정보 처리방침" })

// 4. Review recent precedents
get_precedents({ 
  query: "개인정보 유출",
  decisionType: "precedent" 
})

Advanced Features

Annexes and Forms (get_annex)

Retrieve penalty schedules (별표), forms (서식), and attachments.

{
  "lawName": "식품위생법",
  "annexType": "별표",
  "annexNumber": "1"
}

Treaty Search (search_treaty)

Search international treaties registered in Korea.

{
  "query": "FTA",
  "country": "미국" // optional
}

Local Ordinances (search_ordinance)

Search municipal and provincial ordinances.

{
  "query": "주차",
  "jurisdiction": "서울특별시" // optional
}

Administrative Rules (search_administrative_rules)

Search regulations, directives, and notices.

{
  "query": "건축법 시행규칙",
  "ruleType": "훈령" // optional: 훈령, 예규, 고시
}

Troubleshooting

API Key Issues

Error: 사용자 정보 검증에 실패하였습니다

# Verify API key is set
echo $MOLEG_API_KEY

# Check API key validity at:
# https://www.law.go.kr/DRF/lawService.do

Rate Limiting

Error: Too Many Requests

# Increase rate limit in config
RATE_LIMIT_MAX_REQUESTS=200
RATE_LIMIT_WINDOW_MS=60000

User-Agent Blocking

Error: fetch failed or [EXTERNAL_API_ERROR]

법제처 API blocks Node.js default User-Agent. The server automatically uses a browser UA, but you can override:

LAW_USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"

Citation Verification False Negatives

If verify_citations shows valid citations as invalid:

  1. Check law name matching: Use full official names (e.g., "민법" not "민사법")
  2. Article format: Use 제123조 or just 123조, not 123
  3. Increase search depth: The tool uses searchDisplay=100 internally

Empty Results

Symptom: Valid queries return [NOT_FOUND]

// Check enforcement date
get_law_text({ 
  lawName: "개인정보 보호법",
  enforcementDate: "20110930" // Must be after promulgation
})

// Try broader search
search_law({ 
  query: "개인정보",
  display: 50 
})

Time Travel Diff Issues

Error: No diff output or "identical" when laws changed

# Ensure date format is YYYYMMDD
dateA: "20200101"  # ✓ Correct
dateA: "2020-01-01" # ✗ Wrong

# Check if law existed at both dates
# Use get_law_text with each date first

Integration Examples

Claude Desktop Configuration

{
  "mcpServers": {
    "korean-law": {
      "command": "npx",
      "args": ["-y", "korean-law-mcp"],
      "env": {
        "MOLEG_API_KEY": "your-key-here",
        "RATE_LIMIT_MAX_REQUESTS": "150"
      }
    }
  }
}

Cursor Configuration

Add to .cursor/config.json:

{
  "mcp": {
    "servers": {
      "korean-law": {
        "command": "npx",
        "args": ["-y", "korean-law-mcp"],
        "env": {
          "MOLEG_API_KEY": "your-key-here"
        }
      }
    }
  }
}

Custom MCP Connector (claude.ai)

# Deploy to fly.io or Vercel
npm run build
fly deploy

# Use in claude.ai custom connector:
# https://korean-law-mcp.fly.dev/mcp?oc=YOUR_API_KEY

Natural Language Usage

The AI will automatically route these queries to appropriate tools:

  • "민법 750조가 실제로 존재하나?" → verify_citations
  • "근로기준법 개정 이력" → time_travel + get_law_text
  • "건축허가 절차 법적 근거" → search_law + search_administrative_rules
  • "전세금 못 받았을 때 대응 방법" → action_plan
  • "식품위생법 과태료 감경 가능?" → get_annex + get_precedents
  • "주차 조례 상위법 적합성" → search_ordinance + get_precedents

Performance Tips

  1. Use compact mode for precedents: Default compact saves ~74% tokens. Only use full: true when you need complete text.

  2. Chain related queries: The server suggests next steps in nextSteps field - copy and execute them.

  3. Cache law text: If analyzing multiple articles of the same law, call get_law_text once and reference locally.

  4. Batch verification: Include all citations in one verify_citations call rather than one per citation.

References

FAQ

What does the korean-law-mcp skill do?

MCP server providing access to 41 Korean legal APIs (법제처) with citation verification, impact analysis, and time-travel diff capabilities

How do I install korean-law-mcp?

Run npx skills add https://github.com/reason-machines/mcp-skills --skill korean-law-mcp in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/korean-law-mcp/ (personal) or .claude/skills/korean-law-mcp/ (project).

Which AI agents can use korean-law-mcp?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is korean-law-mcp safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains korean-law-mcp?

It is published by reason-machines in reason-machines/mcp-skills. It has 215 recorded installs.

More from reason-machines/mcp-skills

View all →

codebase-memory-mcp-intelligence

reason-machines/mcp-skills

High-performance code intelligence MCP server that indexes codebases into knowledge graphs for structural queries, call traces, and architecture analysis

AI & Agents505 installs

playwright-mcp-server

reason-machines/mcp-skills

Browser automation MCP server using Playwright's accessibility tree for LLM-friendly web interaction

AI & Agents285 installs

tradingview-mcp-assistant

reason-machines/mcp-skills

AI-assisted TradingView chart analysis and automation via Chrome DevTools Protocol for Claude Code

AI & Agents262 installs

lanhu-mcp-collaboration

reason-machines/mcp-skills

AI-powered design collaboration server connecting Lanhu design platform with AI coding assistants for requirements analysis, UI design extraction, and team knowledge sharing

AI & Agents256 installs

google-meta-ads-ga4-mcp

reason-machines/mcp-skills

MCP server for Google Ads, Meta Ads & GA4 — 250+ tools for campaign management, analytics & optimization across all platforms

Marketing & SEO240 installs

chrome-devtools-mcp-automation

reason-machines/mcp-skills

Expert guidance for Chrome DevTools MCP server - browser automation, debugging, and performance analysis for AI agents

AI & Agents239 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs