Skip to main content
Glama

๐ŸŒ Read this in other languages: English | ํ•œ๊ตญ์–ด (Korean)

Kakao PlayMCP 10 3rd Prize MCP Python

LexLink is an MCP (Model Context Protocol) server that exposes the Korean National Law Information API (open.law.go.kr) to AI agents and LLM applications. It enables AI systems to search, retrieve, and analyze Korean legal information through standardized MCP tools.

Features

  • 54 MCP Tools + 2 MCP Resources for comprehensive Korean law information access

    • Search and retrieve Korean laws (effective date & announcement date)

    • Search and retrieve English-translated laws

    • Search and retrieve administrative rules (ํ–‰์ •๊ทœ์น™)

    • Query specific articles, paragraphs, and sub-items

    • Law-ordinance linkage (๋ฒ•๋ น-์ž์น˜๋ฒ•๊ทœ ์—ฐ๊ณ„)

    • Delegated law information (์œ„์ž„๋ฒ•๋ น)

    • Phase 3 - Case Law & Legal Research

      • Court precedents (ํŒ๋ก€)

      • Constitutional Court decisions (ํ—Œ์žฌ๊ฒฐ์ •๋ก€)

      • Legal interpretations (๋ฒ•๋ นํ•ด์„๋ก€)

      • Administrative appeal decisions (ํ–‰์ •์‹ฌํŒ๋ก€)

    • Phase 4 - Article Citation Extraction

      • Extract legal citations from any law article (100% accuracy)

    • NEW: Phase 5 - AI-Powered Search

      • Semantic search for natural language queries (aiSearch)

      • Related laws discovery (aiRltLs_search)

    • MCP Resources - Law ID Cache

      • Cached mapping of ~20 frequently-used law names to stable ๋ฒ•๋ นID codes

      • Template lookup by Korean name or abbreviation (lexlink://law/{name})

      • Dynamic caching: search results automatically populate the cache

  • Smart Features (inspired by korean-law-mcp):

    • Intelligent Caching - Per-tool TTL caching (search 1hr, articles 24hr, AI search 30min)

    • Law Name Resolution - Auto-resolves Korean abbreviations (์žํ†ต๋ฒ•โ†’์ž๋ณธ์‹œ์žฅ๊ณผ ๊ธˆ์œตํˆฌ์ž์—…์— ๊ด€ํ•œ ๋ฒ•๋ฅ ), 52 seed aliases + dynamic learning

    • Chain Tools - Multi-step research workflows in one call (Phase 9)

  • 100% Semantic Validation - All Phase 1-5 tools confirmed returning real law data

  • Error Handling - Actionable error messages with resolution hints

  • Korean Text Support - Proper UTF-8 encoding for Korean characters

  • Response Formats - JSON (default), HTML, or XML (multiple formats supported)

Related MCP server: Legal Search MCP

Project Status

๐ŸŽ‰ Production Ready - Phase 9 Complete!

Metric

Status

Tools Implemented

54/54 (100%) โœ…

Semantic Validation

26/26 (Phase 1-5 tools) โœ…

MCP Prompts

9/9 (100%) โœ…

MCP Resources

2 (1 static + 1 template) โœ…

API Coverage

~28% of 191+ endpoints

LLM Integration

โœ… Validated (Gemini)

Code Quality

Clean, documented, tested

Version

v2.1.0

Latest: v2.1.0 โ€” 54 tools (Phase 9 added), intelligent caching (cache.py), law name resolution (resolver.py), chain tools for multi-step research workflows.

Prerequisites

Quick Start

1. Install Dependencies

uv sync

2. Configure Your OC Identifier

Option A: Environment Variable (Recommended)

# Set OC in your environment
export OC=your_id_here

Option B: Pass in Tool Arguments

# Override OC in each tool call
eflaw_search(query="๋ฒ•๋ น๋ช…", oc="your_id")

3. Run the Server

# Stdio transport (for Claude Code, Cursor, etc.)
OC=your_oc uv run stdio

# HTTP transport (for Kakao PlayMCP)
OC=your_oc TRANSPORT=http uv run serve

Available Tools

Phase 1: Core Law APIs (6 tools)

1. eflaw_search - Search Laws by Effective Date

Search for laws organized by effective date (์‹œํ–‰์ผ ๊ธฐ์ค€).

eflaw_search(
    query="์ž๋™์ฐจ๊ด€๋ฆฌ๋ฒ•",      # Search keyword
    display=10,                # Results per page
    type="XML",                # Response format
    ef_yd="20240101~20241231"  # Optional date range
)

2. law_search - Search Laws by Announcement Date

Search for laws organized by announcement date (๊ณตํฌ์ผ ๊ธฐ์ค€).

law_search(
    query="๋ฏผ๋ฒ•",
    display=10,
    type="XML"
)

3. eflaw_service - Retrieve Law Content (Effective Date)

Get full law text and articles by effective date.

IMPORTANT: For specific article queries (e.g., "์ œ174์กฐ"), use the jo parameter. Some laws have 400+ articles and responses can exceed 1MB without jo.

# Get specific article (RECOMMENDED)
eflaw_service(
    mst="279823",              # Law MST
    jo="017400",               # Article 174 (์ œ174์กฐ)
    type="XML"
)

# Get full law (WARNING: large response)
eflaw_service(
    id="001823",
    type="XML"
)

4. law_service - Retrieve Law Content (Announcement Date)

Get full law text and articles by announcement date.

IMPORTANT: For specific article queries (e.g., "์ œ174์กฐ"), use the jo parameter. Some laws have 400+ articles and responses can exceed 1MB without jo.

# Get specific article (RECOMMENDED)
law_service(
    mst="279823",              # Law MST
    jo="017400",               # Article 174 (์ œ174์กฐ)
    type="XML"
)

5. eflaw_josub - Query Article/Paragraph (Effective Date)

Best tool for querying specific articles. Returns only the requested article/paragraph.

eflaw_josub(
    mst="279823",              # Law MST
    jo="017400",               # Article 174 (์ œ174์กฐ)
    type="XML"
)
# jo format: "XXXXXX" where first 4 digits = article (zero-padded), last 2 = branch (00=main)
# Examples: "017400" (์ œ174์กฐ), "000300" (์ œ3์กฐ), "001502" (์ œ15์กฐ์˜2)

6. law_josub - Query Article/Paragraph (Announcement Date)

Best tool for querying specific articles. Returns only the requested article/paragraph.

law_josub(
    mst="279823",              # Law MST
    jo="017200",               # Article 172 (์ œ172์กฐ)
    type="XML"
)

Phase 2: Extended APIs (9 tools)

7. elaw_search - Search English-Translated Laws

Search for Korean laws translated to English.

elaw_search(
    query="employment",
    display=10,
    type="XML"
)

8. elaw_service - Retrieve English Law Content

Get full English-translated law text.

elaw_service(
    id="009589",
    type="XML"
)

9. admrul_search - Search Administrative Rules

Search administrative rules (ํ›ˆ๋ น, ์˜ˆ๊ทœ, ๊ณ ์‹œ, ๊ณต๊ณ , ์ง€์นจ).

admrul_search(
    query="ํ•™๊ต",
    display=10,
    type="XML"
)

10. admrul_service - Retrieve Administrative Rule Content

Get full administrative rule text with annexes.

admrul_service(
    id="62505",
    type="XML"
)

11. lnkLs_search - Search Law-Ordinance Linkage

Find laws linked to local ordinances.

lnkLs_search(
    query="๊ฑด์ถ•",
    display=10,
    type="XML"
)

12. lnkLsOrdJo_search - Search Ordinance Articles by Law

Find ordinance articles linked to specific law articles.

lnkLsOrdJo_search(
    knd="002118",              # Law ID
    display=10,
    type="XML"
)

13. lnkDep_search - Search Law-Ordinance Links by Ministry

Find laws linked to ordinances by government ministry.

lnkDep_search(
    org="1400000",             # Ministry code
    display=10,
    type="XML"
)

14. drlaw_search - Retrieve Law-Ordinance Linkage Statistics

Get linkage statistics table (HTML format).

drlaw_search(
    lid="001823",              # Law ID
    type="HTML"
)

15. lsDelegated_service - Retrieve Delegated Law Information

Get information about delegated laws, rules, and ordinances.

lsDelegated_service(
    id="001823",
    type="XML"
)

Tip: All *_service tools in Phase 3 support a sections="summary" parameter to return only a brief summary instead of the full document text.

16. prec_search - Search Court Precedents

Search Korean court precedents from Supreme Court and lower courts.

prec_search(
    query="๋‹ด๋ณด๊ถŒ",
    display=10,
    type="XML",
    curt="๋Œ€๋ฒ•์›"             # Optional: Court name filter
)

17. prec_service - Retrieve Court Precedent Full Text

Get complete court precedent text with case details.

prec_service(
    id="228541",
    type="XML"
)

18. detc_search - Search Constitutional Court Decisions

Search Korean Constitutional Court decisions.

detc_search(
    query="๋ฒŒ๊ธˆ",
    display=10,
    type="XML"
)

19. detc_service - Retrieve Constitutional Court Decision Full Text

Get complete Constitutional Court decision text.

detc_service(
    id="58386",
    type="XML"
)

20. expc_search - Search Legal Interpretations

Search legal interpretation precedents issued by government agencies.

expc_search(
    query="์ž„์ฐจ",
    display=10,
    type="XML"
)

21. expc_service - Retrieve Legal Interpretation Full Text

Get complete legal interpretation text.

expc_service(
    id="334617",
    type="XML"
)

22. decc_search - Search Administrative Appeal Decisions

Search Korean administrative appeal decisions.

decc_search(
    query="*",                # Search all decisions
    display=10,
    type="XML"
)

23. decc_service - Retrieve Administrative Appeal Decision Full Text

Get complete administrative appeal decision text.

decc_service(
    id="243263",
    type="XML"
)

Phase 4: Article Citation Extraction (1 tool - NEW!)

24. article_citation - Extract Citations from Law Article

Extract all legal citations referenced by a specific law article.

# First, search for the law to get MST
eflaw_search(query="๊ฑด์ถ•๋ฒ•")  # Returns MST: 268611

# Then extract citations
article_citation(
    mst="268611",              # Law MST from search result
    law_name="๊ฑด์ถ•๋ฒ•",          # Law name
    article=3                  # Article number (์ œ3์กฐ)
)

Response:

{
    "success": true,
    "law_name": "๊ฑด์ถ•๋ฒ•",
    "article": "์ œ3์กฐ",
    "citation_count": 12,
    "internal_count": 4,
    "external_count": 8,
    "citations": [
        {
            "type": "external",
            "target_law_name": "ใ€Œ๊ตญํ† ์˜ ๊ณ„ํš ๋ฐ ์ด์šฉ์— ๊ด€ํ•œ ๋ฒ•๋ฅ ใ€",
            "target_article": 56,
            "target_paragraph": 1
        }
    ]
}

Key Features:

  • 100% accuracy via HTML parsing (not LLM-based)

  • Zero API cost (no external LLM calls)

  • ~350ms average extraction time

  • Distinguishes internal vs external citations

Phase 5: AI-Powered Search (2 tools - NEW!)

25. aiSearch - AI-Powered Semantic Law Search

โญ PREFERRED TOOL for vague or natural language queries. Use this FIRST when user's intent is unclear or conversational.

Uses intelligent/semantic search to find relevant law articles with full article text.

aiSearch(
    query="๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ",           # Natural language query
    search=0,                      # 0: law articles, 1: appendix, 2: admin rules, 3: admin appendix
    display=20,                    # Results per page
    page=1,                        # Page number
    type="JSON"                    # Response format (JSON default)
)

Best for: Natural language queries like "์Œ์ฃผ์šด์ „ ๋ฒŒ๊ธˆ", "์ดํ˜ผ ์žฌ์‚ฐ๋ถ„ํ• ", "์ƒ์† ๋ฌธ์ œ"

26. aiRltLs_search - AI-Powered Related Laws Search

โญ PREFERRED TOOL for discovering related laws from vague topics. Use this when user wants to explore laws around a general subject.

Finds laws semantically related to a given law name or keyword.

aiRltLs_search(
    query="๋ฏผ๋ฒ•",                  # Law name or keyword
    search=0,                      # 0: law articles, 1: admin rule articles
    type="JSON"                    # Response format (JSON default)
)

Best for: Finding related laws like "๋ฏผ๋ฒ•" โ†’ ์ƒ๋ฒ•, ์˜๋ฃŒ๋ฒ•, ์†Œ์†ก์ด‰์ง„๋ฒ•

Category

Tools

์ž์น˜๋ฒ•๊ทœ (Local Ordinances)

ordin_search, ordin_service, ordinLsCon_search

์กฐ์•ฝ (Treaties)

trty_search, trty_service

๋ฒ•๋ น์ •๋ณด ์ง€์‹๋ฒ ์ด์Šค (Knowledge Base)

lstrm_ai_search, dlytrm_search, lstrm_rlt_search, dlytrm_rlt_search, lstrm_rlt_jo_search, jo_rlt_lstrm_search, ls_rlt_search

์œ„์›ํšŒ ๊ฒฐ์ •๋ฌธ (Committee Decisions)

committee_search, committee_service

์ค‘์•™๋ถ€์ฒ˜ 1์ฐจ ํ•ด์„ (Ministry Interpretations)

cgm_expc_search, cgm_expc_service

ํŠน๋ณ„ํ–‰์ •์‹ฌํŒ (Special Appeals)

special_decc_search, special_decc_service

Phase 9: Chain Tools (5 tools)

Inspired by korean-law-mcp, these tools run multi-step research workflows in a single call โ€” eliminating the need for an LLM to orchestrate sequential tool calls manually.

Tool

Description

chain_full_research

Complete legal research: statutes + precedent analysis + interpretations

chain_amendment_track

Revision history + article-level diff across amendments

chain_dispute_prep

All case law sources across 4 databases (ํŒ๋ก€, ํ—Œ์žฌ๊ฒฐ์ •๋ก€, ๋ฒ•๋ นํ•ด์„๋ก€, ํ–‰์ •์‹ฌํŒ๋ก€)

chain_law_system

Full law hierarchy: delegation tree + admin rules + ordinances

cache_stats

Cache and resolver performance monitoring

Tool Selection Guide

When searching Korean law, select tools based on query clarity:

Query Type

Recommended Tools

Examples

๐Ÿ” Vague/Natural language

aiSearch, aiRltLs_search

"์Œ์ฃผ์šด์ „ ์ฒ˜๋ฒŒ", "์ดํ˜ผ ์žฌ์‚ฐ๋ถ„ํ• "

๐Ÿ“‹ Specific law/article

eflaw_search, law_search

"ํ˜•๋ฒ• ์ œ148์กฐ์˜2", "๋ฏผ๋ฒ• ์ƒ์†ํŽธ"

โš–๏ธ Case law

prec_search, detc_search

"๋Œ€๋ฒ•์› 2023๋‹ค12345"

๐Ÿ”— Related laws

aiRltLs_search

"๋ฏผ๋ฒ•๊ณผ ๊ด€๋ จ๋œ ๋ฒ•๋ฅ "

Configuration

Environment Variables

Variable

Default

Description

OC

(required)

law.go.kr API identifier (email local part)

LEXLINK_BASE_URL

http://www.law.go.kr

API base URL

LEXLINK_TIMEOUT

60

HTTP request timeout in seconds

SLIM_RESPONSE

(unset)

Set true to remove redundant raw XML when parsed data exists (for PlayMCP)

TRANSPORT

sse

Transport type: sse or http

OC Priority

When resolving the OC identifier:

  1. Tool argument (highest priority) - oc parameter in tool call

  2. Environment variable - OC env var (set via .env or HTTP header middleware)

Usage Examples

# Search for automobile management law
result = eflaw_search(
    query="์ž๋™์ฐจ๊ด€๋ฆฌ๋ฒ•",
    display=5,
    type="XML"
)

# Returns:
{
    "status": "ok",
    "request_id": "uuid",
    "upstream_type": "XML",
    "data": {
        # Law search results...
    }
}

Example 2: Search with Date Range

# Find laws effective in 2024
result = eflaw_search(
    query="๊ตํ†ต",
    ef_yd="20240101~20241231",
    type="XML"
)

Example 3: Error Handling

# Missing OC parameter
result = eflaw_search(query="test")

# Returns helpful error:
{
    "status": "error",
    "error_code": "MISSING_OC",
    "message": "OC parameter is required but not provided.",
    "hints": [
        "1. Tool argument: oc='your_value'",
        "2. Environment variable: OC=your_value"
    ]
}

Golden MCP Tool Trajectories

These examples demonstrate real-world conversation flows showing how LLMs interact with LexLink tools to answer legal research questions.

Trajectory 1: Basic Law Research

User Query: "What is Article 20 of the Civil Code?"

Tool Calls:

  1. law_search(query="๋ฏผ๋ฒ•", display=50, type="XML") โ†’ Find Civil Code ID

  2. law_service(id="000021", jo="002000", type="XML") โ†’ Retrieve Article 20 text

Result: LLM provides formatted explanation of Civil Code Article 20 with full legal text and context.


Trajectory 2: Court Precedent Analysis

User Query: "Find recent Supreme Court precedents about security interests"

Tool Calls:

  1. prec_search(query="๋‹ด๋ณด๊ถŒ", curt="๋Œ€๋ฒ•์›", display=50, type="XML") โ†’ Search Supreme Court precedents

  2. prec_service(id="228541", type="XML") โ†’ Retrieve top precedent details

Result: LLM summarizes key precedents with case numbers, dates, and holdings related to security interests.


User Query: "How does the Labor Standards Act handle overtime, and are there relevant court precedents?"

Tool Calls:

  1. eflaw_search(query="๊ทผ๋กœ๊ธฐ์ค€๋ฒ•", display=50, type="XML") โ†’ Find Labor Standards Act

  2. eflaw_service(id="001234", jo="005000", type="XML") โ†’ Retrieve Article 50 (overtime provisions)

  3. prec_search(query="๊ทผ๋กœ๊ธฐ์ค€๋ฒ• ์—ฐ์žฅ๊ทผ๋กœ", display=30, type="XML") โ†’ Search overtime precedents

  4. prec_service(id="234567", type="XML") โ†’ Retrieve leading precedent

Result: LLM provides comprehensive analysis combining statutory text with judicial interpretation, showing how courts apply the overtime provisions.


Trajectory 4: Constitutional Review

User Query: "Has the Constitutional Court reviewed laws about fines?"

Tool Calls:

  1. detc_search(query="๋ฒŒ๊ธˆ", display=50, type="XML") โ†’ Search Constitutional Court decisions

  2. detc_service(id="58386", type="XML") โ†’ Retrieve decision full text

  3. law_search(query=<law_name_from_decision>, type="XML") โ†’ Find related law for context

Result: LLM explains Constitutional Court holdings on fine-related provisions and their impact on specific laws.


Trajectory 5: Administrative Law Research

User Query: "What administrative rules exist for schools, and are there related legal interpretations?"

Tool Calls:

  1. admrul_search(query="ํ•™๊ต", display=50, type="XML") โ†’ Search school-related administrative rules

  2. admrul_service(id="62505", type="XML") โ†’ Retrieve rule content

  3. expc_search(query="ํ•™๊ต", display=30, type="XML") โ†’ Search legal interpretations

  4. expc_service(id="334617", type="XML") โ†’ Retrieve interpretation details

Result: LLM provides overview of administrative framework for schools with official agency interpretations.


User Query: "I'm researching rental housing disputes. Show me the relevant law, court precedents, and administrative appeal decisions."

Tool Calls:

  1. eflaw_search(query="์ฃผํƒ์ž„๋Œ€์ฐจ๋ณดํ˜ธ๋ฒ•", display=50, type="XML") โ†’ Find Housing Lease Protection Act

  2. eflaw_service(id="002876", type="XML") โ†’ Retrieve full law text

  3. prec_search(query="์ฃผํƒ์ž„๋Œ€์ฐจ", display=50, type="XML") โ†’ Search housing lease precedents

  4. prec_service(id="156789", type="XML") โ†’ Retrieve key precedent

  5. decc_search(query="์ฃผํƒ์ž„๋Œ€์ฐจ", display=30, type="XML") โ†’ Search administrative appeal decisions

  6. decc_service(id="243263", type="XML") โ†’ Retrieve appeal decision

Result: LLM provides comprehensive legal research report covering statutory framework, judicial interpretation, and administrative precedents for rental housing disputes.


Trajectory 7: Citation Network Analysis (Phase 4)

User Query: "What laws does Article 3 of the Building Act cite?"

Tool Calls:

  1. eflaw_search(query="๊ฑด์ถ•๋ฒ•", display=50, type="XML") โ†’ Find Building Act, get MST

  2. article_citation(mst="268611", law_name="๊ฑด์ถ•๋ฒ•", article=3) โ†’ Extract all citations

Result: LLM provides complete citation analysis showing 12 citations (8 external laws, 4 internal references) including specific article and paragraph references.


Trajectory 8: AI-Powered Natural Language Search (Phase 5)

User Query: "What's the penalty for hit-and-run accidents?"

Tool Calls:

  1. aiSearch(query="๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ", search=0, display=20, type="XML") โ†’ Semantic search for hit-and-run penalties

Result: LLM receives full article text from relevant laws (ํŠน์ •๋ฒ”์ฃ„ ๊ฐ€์ค‘์ฒ˜๋ฒŒ ๋“ฑ์— ๊ด€ํ•œ ๋ฒ•๋ฅ  ์ œ5์กฐ์˜3) with complete provisions about hit-and-run penalties, enabling comprehensive answer without needing to know specific law names.


User Query: "What laws are related to the Civil Code?"

Tool Calls:

  1. aiRltLs_search(query="๋ฏผ๋ฒ•", search=0, type="XML") โ†’ Find semantically related laws

Result: LLM discovers related laws like ์ƒ๋ฒ• (Commercial Act), ์˜๋ฃŒ๋ฒ• (Medical Service Act), ์†Œ์†ก์ด‰์ง„๋ฒ• (Act on Special Cases Concerning Expedition of Litigation), showing connections across legal domains.


Key Patterns

  1. AI Tools for Vague Queries: Use aiSearch or aiRltLs_search FIRST when user intent is unclear or conversational

  2. Search First, Then Retrieve: Always search to find IDs before calling service tools

  3. Use display=50-100 for Law Searches: Ensures exact matches are found due to relevance ranking

  4. Combine Phases: Mix Phase 1 (laws), Phase 2 (administrative rules), Phase 3 (precedents), and Phase 5 (AI search) for complete research

  5. Type Parameter: Default is type="JSON"; specify type="XML" if your pipeline requires XML

  6. Article Numbers: Use 6-digit format (e.g., "002000" for Article 20) when querying specific articles

Development

Project Structure

lexlink-ko-mcp/
โ”œโ”€โ”€ src/lexlink/
โ”‚   โ”œโ”€โ”€ server.py        # Main MCP server with 54 tools
โ”‚   โ”œโ”€โ”€ _helpers.py      # Shared helpers: run_search, run_service, TOOL_ANNOTATIONS
โ”‚   โ”œโ”€โ”€ cache.py         # Intelligent per-tool TTL caching (~183 lines)
โ”‚   โ”œโ”€โ”€ resolver.py      # Korean law name/abbreviation resolution (~225 lines)
โ”‚   โ”œโ”€โ”€ http_server.py   # HTTP/SSE server for Kakao PlayMCP
โ”‚   โ”œโ”€โ”€ stdio_server.py  # Stdio transport entry point
โ”‚   โ”œโ”€โ”€ params.py        # Parameter resolution & mapping
โ”‚   โ”œโ”€โ”€ validation.py    # Input validation
โ”‚   โ”œโ”€โ”€ parser.py        # XML parsing utilities
โ”‚   โ”œโ”€โ”€ ranking.py       # Relevance ranking
โ”‚   โ”œโ”€โ”€ citation.py      # Article citation extraction (Phase 4)
โ”‚   โ”œโ”€โ”€ client.py        # HTTP client for law.go.kr API
โ”‚   โ”œโ”€โ”€ errors.py        # Error codes & responses
โ”‚   โ”œโ”€โ”€ raw_logger.py    # PlayMCP traffic logging
โ”‚   โ””โ”€โ”€ log_processor.py # Log format converter
โ”œโ”€โ”€ logs/playmcp/         # PlayMCP traffic logs (daily JSONL)
โ”œโ”€โ”€ pyproject.toml        # Project configuration
โ””โ”€โ”€ README.md             # This file

Running Tests

# Install test dependencies
uv sync

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/lexlink --cov-report=html

# Run specific test category
uv run pytest -m unit
uv run pytest -m integration
uv run pytest -m e2e

Adding New Tools

Current Status: 54/54 tools implemented (Phase 1-9 complete). Phase 1-5 tools validated.

For implementing additional tools from the 124+ remaining APIs:

  1. Follow the pattern established in src/lexlink/server.py

  2. Use ctx: Context = None parameter for MCP logging/progress

  3. Use generic parser functions (extract_items_list, update_items_list)

  4. Add semantic validation tests

Tool Implementation Pattern:

  • Each tool is a decorated function with MCP schema

  • Uses ctx: Context = None parameter for MCP context

  • 2-tier OC resolution: tool arg > env var

  • Generic parser functions work with any XML tag

  • Comprehensive error handling with actionable hints

Deployment

Deploy to Kakao PlayMCP (HTTP Server)

LexLink can also be deployed as an HTTP server for platforms like Kakao PlayMCP.

Important: Kakao PlayMCP does not accept port numbers in URLs. You must use Nginx as a reverse proxy to serve on port 80.

Quick Start (Local Testing):

# Run the HTTP server
OC=your_oc uv run serve

# Server starts at: http://localhost:8000/sse

Production Setup:

Internet โ†’ Nginx (port 80) โ†’ LexLink (port 8000)

PlayMCP Registration:

Field

Value

MCP Endpoint

http://YOUR_SERVER_IP/sse (no port!)

Authentication

Key/Token (Header: OC)

For detailed deployment instructions (AWS EC2, Nginx, systemd, HTTPS), see docs/DEPLOYMENT_GUIDE.md.

PlayMCP Traffic Logging

LexLink includes built-in logging for PlayMCP traffic analysis. Logs are saved in dashboard-compatible JSONL format.

Log Location: logs/playmcp/YYYY-MM-DD.jsonl

Log Schema:

{
  "rpc_id": "3",
  "request_id": "d8ee45eb",
  "session_id": "9ff9dc23431848a4901b4cb6326ba5bd",
  "timestamp": "2025-12-25T05:40:23.957987",
  "duration_ms": 1.52,
  "method": "tools/call",
  "tool_name": "aiSearch",
  "params": { "arguments": {"query": "๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ"} },
  "client": "PlayMCP",
  "client_version": "2025.0.0",
  "protocol_version": "2025-06-18",
  "client_ip": "220.64.111.219",
  "oc": "user_id",
  "status": "success",
  "status_code": 200,
  "result": { ... }
}

Features:

  • Daily log rotation (one file per day)

  • Dashboard-compatible format for filtering and analysis

  • Captures request/response pairs with timing

  • SSE streaming response parsing

Converting Old Raw Logs:

uv run python -m lexlink.log_processor input.jsonl output.jsonl

Troubleshooting

"OC parameter is required" error

Solution: Set your OC identifier using one of the three methods above.

Korean characters not displaying correctly

Solution: Ensure your terminal supports UTF-8:

export PYTHONIOENCODING=utf-8

"Timeout" errors

Solution: Increase timeout via environment variable:

export LEXLINK_TIMEOUT=90  # Increase from default 60s

Server won't start after updating dependencies

Solution: Re-sync dependencies:

uv sync --reinstall

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Write tests for new functionality

  4. Ensure all tests pass (uv run pytest)

  5. Commit changes (git commit -m 'Add amazing feature')

  6. Push to branch (git push origin feature/amazing-feature)

  7. Open a Pull Request

License

This project is open source. See LICENSE file for details.

Acknowledgments

  • law.go.kr - Korean National Law Information API

  • MCP - Model Context Protocol by Anthropic

  • korean-law-mcp - Inspiration for caching, law name resolution, and chain tools (Phase 9)

Support


Changelog

v2.1.0 - 2026-03-30

New: Caching, Law Name Resolution, Chain Tools (Phase 9)

  • Added intelligent per-tool TTL caching (cache.py): search 1hr, articles 24hr, AI search 30min

  • Added law name/abbreviation resolution (resolver.py): 52 seed aliases + dynamic learning

  • Added 5 Phase 9 chain tools: chain_full_research, chain_amendment_track, chain_dispute_prep, chain_law_system, cache_stats

  • Inspired by korean-law-mcp

  • See CHANGELOG.md for full details

v2.0.0 - 2026-03-30

Major Release: Phase 7 Tools, JSON Default, sections Parameter

  • Added 18 new Phase 7 tools (์ž์น˜๋ฒ•๊ทœ, ์กฐ์•ฝ, ๋ฒ•๋ น์ •๋ณด ์ง€์‹๋ฒ ์ด์Šค, ์œ„์›ํšŒ ๊ฒฐ์ •๋ฌธ, ์ค‘์•™๋ถ€์ฒ˜ ํ•ด์„, ํŠน๋ณ„ํ–‰์ •์‹ฌํŒ)

  • JSON is now the default response format (was XML)

  • Added sections="summary" parameter for case law service tools

  • Refactored shared logic into _helpers.py

  • See CHANGELOG.md for full details

v1.5.0 - 2026-02-28

Refactor: Remove Smithery Dependency

  • Removed smithery package and 8 transitive dependencies

  • Simplified OC resolution to 2-tier (tool arg > env var)

  • Added stdio_server.py entry point for stdio transport

  • See CHANGELOG.md for full details

For the full changelog (v1.0.0 โ€“ v2.1.0), see CHANGELOG.md.


Powered by MCP

Available Tools

54 tools
admrul_serviceA
Read-onlyIdempotent

Retrieve administrative rule full text (ํ–‰์ •๊ทœ์น™ ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of Korean administrative rules. Includes rule content, addenda, and annexes (forms/attachments).

Args: id: Rule sequence number (required if lid/lm not provided) lid: Rule ID (alternative to id) lm: Rule name (exact match search) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full administrative rule text with content and annexes or error

Examples: Retrieve by ID: >>> admrul_service(id="62505", type="XML")

Retrieve by LID:
>>> admrul_service(lid="10000005747", type="XML")

Inputs: id, lm, oc, lid, +1 more.

aiSearchA
Read-onlyIdempotent

โญ PREFERRED TOOL for vague or natural language queries. Use this FIRST when user's intent is unclear or conversational.

์ง€๋Šฅํ˜• ๋ฒ•๋ น๊ฒ€์ƒ‰ ์‹œ์Šคํ…œ ๊ฒ€์ƒ‰ API (AI-powered semantic law search).

Uses intelligent/semantic search to find relevant law articles. Returns FULL ARTICLE TEXT (์กฐ๋ฌธ๋‚ด์šฉ) - more comprehensive than eflaw_search.

Best for: Natural language queries like "๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ", "์Œ์ฃผ์šด์ „ ๋ฒŒ๊ธˆ"

Args: query: Search query (natural language supported, e.g., "๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ") search: Search scope: - 0: ๋ฒ•๋ น์กฐ๋ฌธ (law articles, default) - 1: ๋ฒ•๋ น ๋ณ„ํ‘œยท์„œ์‹ (law appendix/forms) - 2: ํ–‰์ •๊ทœ์น™ ์กฐ๋ฌธ (administrative rule articles) - 3: ํ–‰์ •๊ทœ์น™ ๋ณ„ํ‘œยท์„œ์‹ (administrative rule appendix/forms) display: Results per page (default 20) page: Page number (default 1) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: AI search results with full article text (๋ฒ•๋ น์กฐ๋ฌธ items with ์กฐ๋ฌธ๋‚ด์šฉ)

Example: >>> aiSearch(query="๋บ‘์†Œ๋‹ˆ ์ฒ˜๋ฒŒ", search=0) # Returns: ํŠน์ •๋ฒ”์ฃ„ ๊ฐ€์ค‘์ฒ˜๋ฒŒ ๋“ฑ์— ๊ด€ํ•œ ๋ฒ•๋ฅ  ์ œ5์กฐ์˜3 (๋„์ฃผ์ฐจ๋Ÿ‰ ์šด์ „์ž์˜ ๊ฐ€์ค‘์ฒ˜๋ฒŒ)

Inputs: query (required), oc, page, type, +2 more.

article_amendment_diffA
Read-onlyIdempotent

Compare how a specific article changed between two law versions (์กฐ๋ฌธ ์‹ ๊ตฌ๋Œ€์กฐ).

Use MST values from law_amendment_summary to compare article text across revisions.

Args: mst_old: MST of the older version (๋ฒ•๋ น์ผ๋ จ๋ฒˆํ˜ธ, from law_amendment_summary) mst_new: MST of the newer version article: Article number (e.g., 52 for ์ œ52์กฐ) article_branch: Branch number (e.g., 2 for ์ œ52์กฐ์˜2, default 0) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Side-by-side comparison with line-level diff

Examples: >>> article_amendment_diff(mst_old="269000", mst_new="273000", article=52)

Inputs: article (required), mst_new (required), mst_old (required), oc, +2 more.

article_citationA
Read-onlyIdempotent

Extract citations from a law article (์กฐ๋ฌธ ์ธ์šฉ ์กฐํšŒ).

This tool extracts all legal citations referenced by a specific law article. It parses the official hyperlinked citations from law.go.kr HTML pages, providing 100% accurate citation data with zero API cost.

The tool identifies:

  • External citations (references to other laws)

  • Internal citations (references within the same law)

  • Article, paragraph, and item level references

Args: mst: Law MST code (๋ฒ•๋ น์ผ๋ จ๋ฒˆํ˜ธ) - get this from eflaw_search or law_search results law_name: Law name in Korean (e.g., "์ž๋ณธ์‹œ์žฅ๊ณผ ๊ธˆ์œตํˆฌ์ž์—…์— ๊ด€ํ•œ ๋ฒ•๋ฅ ") article: Article number (์กฐ๋ฒˆํ˜ธ, e.g., 3 for ์ œ3์กฐ) article_branch: Article branch number (์กฐ๊ฐ€์ง€๋ฒˆํ˜ธ, e.g., 2 for ์ œ37์กฐ์˜2, default 0) oc: Optional OC override (defaults to env var)

Returns: Citation extraction result with: - success: Whether extraction succeeded - law_id: MST code - law_name: Law name - article: Article display (e.g., "์ œ3์กฐ" or "์ œ37์กฐ์˜2") - citation_count: Total number of citations found - citations: List of citation objects with target law, article, paragraph, item - internal_count: Number of same-law citations - external_count: Number of other-law citations

Examples: Get citations from ์ž๋ณธ์‹œ์žฅ๋ฒ• ์ œ3์กฐ: >>> article_citation( ... mst="268611", ... law_name="์ž๋ณธ์‹œ์žฅ๊ณผ ๊ธˆ์œตํˆฌ์ž์—…์— ๊ด€ํ•œ ๋ฒ•๋ฅ ", ... article=3 ... )

Get citations from ๊ฑด์ถ•๋ฒ• ์ œ37์กฐ์˜2:
>>> article_citation(
...     mst="270986",
...     law_name="๊ฑด์ถ•๋ฒ•",
...     article=37,
...     article_branch=2
... )

Workflow: 1. First use eflaw_search(query="๋ฒ•๋ช…") to find the law and get MST 2. Then use article_citation(mst=..., law_name=..., article=...) to get citations 3. Optionally use eflaw_service to get the full article text

Inputs: mst (required), article (required), law_name (required), oc, +1 more.

cache_statsA
Read-onlyIdempotent

Show cache and resolver statistics (์บ์‹œ ํ†ต๊ณ„).

Returns current cache hit rate, entry count, and law name resolver stats. Useful for monitoring server performance.

Returns: Cache statistics and resolver stats

Inputs: no named parameters.

cgm_expc_serviceA
Read-onlyIdempotent

Retrieve ministry interpretation full text (์ค‘์•™๋ถ€์ฒ˜ 1์ฐจ ํ•ด์„ ๋ณธ๋ฌธ ์กฐํšŒ).

Args: ministry: Ministry name (same values as cgm_expc_search) id: Interpretation serial number (ํ•ด์„๋ก€์ผ๋ จ๋ฒˆํ˜ธ) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full interpretation text or error

Inputs: id (required), ministry (required), oc, type.

chain_amendment_trackA
Read-onlyIdempotent

Track law amendment history with optional article-level diff (๋ฒ•๋ น ๊ฐœ์ • ์ถ”์ ).

Chains: amendment summary โ†’ article diff between latest two versions. If article=0, returns only the revision list. If article is specified, also diffs that article between the two most recent revisions.

Args: law_name: Law name (e.g., "๊ทผ๋กœ๊ธฐ์ค€๋ฒ•") article: Article number to diff (0 = summary only, e.g., 52 for ์ œ52์กฐ) date_from: Start date YYYYMMDD (default "20200101") date_to: End date YYYYMMDD (default "20261231") oc: Optional OC override type: Response format

Returns: Revision history and optional article diff

Examples: >>> chain_amendment_track(law_name="๊ทผ๋กœ๊ธฐ์ค€๋ฒ•") >>> chain_amendment_track(law_name="๊ทผ๋กœ๊ธฐ์ค€๋ฒ•", article=52, date_from="20180101")

Inputs: law_name (required), oc, type, article, +2 more.

chain_dispute_prepA
Read-onlyIdempotent

Prepare for a legal dispute by gathering all case law (๋ถ„์Ÿ ์ค€๋น„ ์ž๋ฃŒ).

Chains: precedent search + admin appeals + constitutional decisions + special tribunal. Gathers all decision-type legal sources in one call.

Args: query: Dispute topic (e.g., "๋ถ€๋‹นํ•ด๊ณ ", "๊ฐœ์ธ์ •๋ณด ์œ ์ถœ", "์กฐ์„ธ ๋ถ€๊ณผ ์ทจ์†Œ") display: Results per category (default 5) oc: Optional OC override type: Response format

Returns: Precedents, admin appeals, constitutional decisions, and special tribunal decisions

Examples: >>> chain_dispute_prep(query="๋ถ€๋‹นํ•ด๊ณ ") >>> chain_dispute_prep(query="๊ฐœ์ธ์ •๋ณด ์œ ์ถœ ๊ณผ์ง•๊ธˆ")

Inputs: query (required), oc, type, display.

chain_full_researchA
Read-onlyIdempotent

Complete legal research in one call (์ข…ํ•ฉ ๋ฒ•๋ฅ  ์กฐ์‚ฌ).

Chains: AI search โ†’ statutes โ†’ precedents with outcome analysis โ†’ interpretations โ†’ citations. This is the most comprehensive single-call research tool.

Args: query: Natural language query (e.g., "์Œ์ฃผ์šด์ „ ์ฒ˜๋ฒŒ ๊ธฐ์ค€", "์ž„๋Œ€์ฐจ ๋ณด์ฆ๊ธˆ ๋ฐ˜ํ™˜") display: Results per sub-query (default 5) oc: Optional OC override type: Response format

Returns: Combined legal analysis with statutes, precedent statistics, interpretations, and citations

Examples: >>> chain_full_research(query="๋ถ€๋‹นํ•ด๊ณ  ๊ตฌ์ œ") >>> chain_full_research(query="๊ฐœ์ธ์ •๋ณด ์œ ์ถœ ์‹ ๊ณ  ์˜๋ฌด")

Inputs: query (required), oc, type, display.

chain_law_systemA
Read-onlyIdempotent

Map the full law system hierarchy (๋ฒ•๋ น ์ฒด๊ณ„ ์กฐํšŒ).

Chains: law search โ†’ delegation tree โ†’ related admin rules โ†’ linked ordinances. Shows how a law connects to its subordinate regulations.

Args: law_name: Law name (e.g., "๊ฑด์ถ•๋ฒ•", "๊ทผ๋กœ๊ธฐ์ค€๋ฒ•") oc: Optional OC override type: Response format

Returns: Law hierarchy: parent law, delegated decrees/rules, linked ordinances

Examples: >>> chain_law_system(law_name="๊ฑด์ถ•๋ฒ•") >>> chain_law_system(law_name="๊ฐœ์ธ์ •๋ณด ๋ณดํ˜ธ๋ฒ•")

Inputs: law_name (required), oc, type.

check_precedent_oddsA
Read-onlyIdempotent

Find precedent statistics and key outcome factors for a legal question (ํŒ๋ก€ ์Šน๋ฅ  ๋ถ„์„).

Searches court precedents, analyzes outcomes (์ธ์šฉ/๊ธฐ๊ฐ/ํŒŒ๊ธฐ), and extracts key factors that influenced decisions. Useful for assessing legal odds.

Args: query: Legal question or keywords (e.g., "ํƒ๋ฐฐ ํŒŒ์† ๋ณด์ƒ", "์ž„๋Œ€์ฐจ ๋ณด์ฆ๊ธˆ ๋ฐ˜ํ™˜") display: Number of precedents to search (max 100, default 20) top_n: Number of top precedents to analyze in detail (default 5) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Outcome statistics, key factors, and representative case summaries

Examples: >>> check_precedent_odds(query="ํƒ๋ฐฐ ํŒŒ์† ๋ณด์ƒ") >>> check_precedent_odds(query="๋ถ€๋‹นํ•ด๊ณ ", display=50, top_n=10)

Inputs: query (required), oc, type, top_n, +1 more.

committee_serviceA
Read-onlyIdempotent

Retrieve committee decision full text (์œ„์›ํšŒ ๊ฒฐ์ •๋ฌธ ๋ณธ๋ฌธ ์กฐํšŒ).

Args: committee: Committee name (same values as committee_search) id: Decision serial number (๊ฒฐ์ •๋ฌธ์ผ๋ จ๋ฒˆํ˜ธ) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full decision text or error

Inputs: id (required), committee (required), oc, type.

decc_serviceA
Read-onlyIdempotent

Retrieve administrative appeal decision full text (ํ–‰์ •์‹ฌํŒ๋ก€ ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of Korean administrative appeal decisions. Includes case details, disposition information, decision summary, and reasoning.

Args: id: Decision sequence number (required) lm: Decision name (optional) sections: "summary" to exclude ์ด์œ  (detailed reasoning), or "full"/None for everything. Returns ์‚ฌ๊ฑด๋ช…, ์ฒญ๊ตฌ์ทจ์ง€, ์žฌ๊ฒฐ์š”์ง€, ์ฃผ๋ฌธ in summary mode. oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full administrative appeal decision text with details or error

Examples: Retrieve by ID: >>> decc_service(id="243263", type="XML")

Retrieve with case name:
>>> decc_service(id="245011", lm="๊ณผ์ง•๊ธˆ ๋ถ€๊ณผ์ฒ˜๋ถ„ ์ทจ์†Œ์ฒญ๊ตฌ", type="XML")

Inputs: id (required), lm, oc, type, +1 more.

detc_serviceA
Read-onlyIdempotent

Retrieve Constitutional Court decision full text (ํ—Œ์žฌ๊ฒฐ์ •๋ก€ ๋ณธ๋ฌธ ์กฐํšŒ).

Args: id: Constitutional Court decision sequence number (ํ—Œ์žฌ๊ฒฐ์ •๋ก€์ผ๋ จ๋ฒˆํ˜ธ) lm: Decision name (optional) sections: "summary" to exclude ์ „๋ฌธ (full text), or "full"/None for everything. Recommended: "summary" for PlayMCP to stay under 20KB. oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Full Constitutional Court decision text or error

Examples: >>> detc_service(id="58386") >>> detc_service(id="58386", sections="summary")

Inputs: id (required), lm, oc, type, +1 more.

eflaw_josubA
Read-onlyIdempotent

Query specific article/paragraph by effective date (์‹œํ–‰์ผ ๊ธฐ์ค€ ์กฐยทํ•ญยทํ˜ธยท๋ชฉ ์กฐํšŒ).

BEST TOOL for querying specific articles like "์ œ174์กฐ", "์ œ3์กฐ" etc. This returns only the requested article/paragraph, avoiding large full-law responses.

Args: id: Law ID (either id or mst is required) mst: Law serial number (MST) ef_yd: Effective date (YYYYMMDD) - required when using mst jo: Article number in XXXXXX format. Format: first 4 digits = article number (zero-padded), last 2 digits = branch suffix (00=main). Examples: "017400" (์ œ174์กฐ), "017200" (์ œ172์กฐ), "000300" (์ œ3์กฐ), "001502" (์ œ15์กฐ์˜2) hang: Paragraph number (6 digits, e.g., "000100" for ์ œ1ํ•ญ) ho: Item number (6 digits, e.g., "000200" for ์ œ2ํ˜ธ) mok: Subitem (UTF-8 encoded, e.g., "๋‹ค" for ๋‹ค๋ชฉ) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Specific law section content

Examples: Query ์ž๋ณธ์‹œ์žฅ๋ฒ• ์ œ174์กฐ: >>> eflaw_josub(mst="279823", jo="017400", type="XML")

Query ๊ฑด์ถ•๋ฒ• ์ œ3์กฐ ์ œ1ํ•ญ:
>>> eflaw_josub(mst="276925", jo="000300", hang="000100", type="XML")

Inputs: ho, id, jo, oc, +5 more.

eflaw_serviceA
Read-onlyIdempotent

Retrieve full law content by effective date (์‹œํ–‰์ผ ๊ธฐ์ค€ ๋ฒ•๋ น ๋ณธ๋ฌธ ์กฐํšŒ).

Retrieves the complete text of a law organized by effective date.

IMPORTANT: For specific article queries (e.g., "์ œ174์กฐ"), ALWAYS use the jo parameter. Some laws (e.g., ์ž๋ณธ์‹œ์žฅ๋ฒ•) have 400+ articles and the full response can exceed 1MB. Using jo returns only the requested article, which is much faster and cleaner.

Args: id: Law ID (either id or mst is required) mst: Law serial number (MST/lsi_seq) ef_yd: Effective date (YYYYMMDD) - required when using mst jo: REQUIRED for specific articles. Article number in XXXXXX format. Format: first 4 digits = article number (zero-padded), last 2 digits = branch suffix (00=main). Examples: "017400" (์ œ174์กฐ), "017200" (์ œ172์กฐ), "000300" (์ œ3์กฐ), "001502" (์ œ15์กฐ์˜2) chr_cls_cd: Language code - "010202" (Korean, default) or "010201" (Original) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Full law content or specific article content

Examples: Retrieve specific article (RECOMMENDED): >>> eflaw_service(mst="279823", jo="017400", type="XML") # ์ž๋ณธ์‹œ์žฅ๋ฒ• ์ œ174์กฐ

Retrieve full law (WARNING: large response for some laws):
>>> eflaw_service(id="1747", type="XML")

Inputs: id, jo, oc, mst, +3 more.

elaw_serviceA
Read-onlyIdempotent

Retrieve English law full text (์˜๋ฌธ๋ฒ•๋ น ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of Korean laws translated to English. Useful for international legal research and cross-border understanding.

Args: id: Law ID (required if mst not provided) mst: Law master number (required if id not provided) lm: Law name (alternative search method) ld: Announcement date (YYYYMMDD) ln: Announcement number oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full English law text with articles or error

Examples: Retrieve by ID: >>> elaw_service(id="000744", type="XML")

Retrieve by MST:
>>> elaw_service(mst="127280", type="XML")

Inputs: id, ld, lm, ln, +3 more.

expc_serviceA
Read-onlyIdempotent

Retrieve legal interpretation full text (๋ฒ•๋ นํ•ด์„๋ก€ ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of a legal interpretation precedent, including the question summary, answer, and reasoning.

Args: id: Legal interpretation sequence number (required) lm: Legal interpretation name (optional) sections: "summary" to exclude ์ด์œ  (detailed reasoning), or "full"/None for everything. Returns ์•ˆ๊ฑด๋ช…, ์งˆ์˜์š”์ง€, ํšŒ๋‹ต in summary mode (~2KB vs ~5KB full). oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full legal interpretation text with question, answer, and reasoning or error

Examples: Retrieve by ID: >>> expc_service(id="334617", type="XML")

Retrieve with name:
>>> expc_service(id="315191", lm="์—ฌ์„ฑ๊ฐ€์กฑ๋ถ€ - ๊ฑด๊ฐ•๊ฐ€์ •๊ธฐ๋ณธ๋ฒ• ์ œ35์กฐ ์ œ2ํ•ญ ๊ด€๋ จ", type="XML")

Inputs: id (required), lm, oc, type, +1 more.

law_amendment_summaryA
Read-onlyIdempotent

List all revisions of a law within a date range (๋ฒ•๋ น ๊ฐœ์ • ์ด๋ ฅ ์กฐํšŒ).

Shows when and how a law was amended over time. Use the MST values from the results with article_amendment_diff to see specific article changes.

Args: law_name: Law name (e.g., "๊ทผ๋กœ๊ธฐ์ค€๋ฒ•") date_from: Start date YYYYMMDD (default "20100101") date_to: End date YYYYMMDD (default "20261231") oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: List of revisions with dates, types, and MST identifiers

Examples: >>> law_amendment_summary(law_name="๊ทผ๋กœ๊ธฐ์ค€๋ฒ•", date_from="20200101") >>> law_amendment_summary(law_name="๋ฏผ๋ฒ•", date_from="20150101", date_to="20251231")

Inputs: law_name (required), oc, type, date_to, +1 more.

law_josubA
Read-onlyIdempotent

Query specific article/paragraph by announcement date (๊ณตํฌ์ผ ๊ธฐ์ค€ ์กฐยทํ•ญยทํ˜ธยท๋ชฉ ์กฐํšŒ).

BEST TOOL for querying specific articles like "์ œ174์กฐ", "์ œ3์กฐ" etc. This returns only the requested article/paragraph, avoiding large full-law responses.

Args: id: Law ID (either id or mst is required) mst: Law serial number (MST) jo: Article number in XXXXXX format. Format: first 4 digits = article number (zero-padded), last 2 digits = branch suffix (00=main). Examples: "017400" (์ œ174์กฐ), "017200" (์ œ172์กฐ), "000300" (์ œ3์กฐ), "001502" (์ œ15์กฐ์˜2) hang: Paragraph number (6 digits, e.g., "000100" for ์ œ1ํ•ญ) ho: Item number (6 digits, e.g., "000200" for ์ œ2ํ˜ธ) mok: Subitem (UTF-8 encoded, e.g., "๋‹ค" for ๋‹ค๋ชฉ) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Specific law section content

Examples: Query ์ž๋ณธ์‹œ์žฅ๋ฒ• ์ œ174์กฐ: >>> law_josub(mst="279823", jo="017400", type="XML")

Query ๊ฑด์ถ•๋ฒ• ์ œ3์กฐ ์ œ1ํ•ญ:
>>> law_josub(mst="276925", jo="000300", hang="000100", type="XML")

Inputs: ho, id, jo, oc, +4 more.

law_serviceA
Read-onlyIdempotent

Retrieve full law content by announcement date (๊ณตํฌ์ผ ๊ธฐ์ค€ ๋ฒ•๋ น ๋ณธ๋ฌธ ์กฐํšŒ).

Retrieves the complete text of a law organized by announcement (publication) date.

IMPORTANT: For specific article queries (e.g., "์ œ174์กฐ"), ALWAYS use the jo parameter. Some laws (e.g., ์ž๋ณธ์‹œ์žฅ๋ฒ•) have 400+ articles and the full response can exceed 1MB. Using jo returns only the requested article, which is much faster and cleaner.

Args: id: Law ID (either id or mst is required) mst: Law serial number (MST) lm: Law modification parameter ld: Law date parameter (YYYYMMDD) ln: Law number parameter jo: REQUIRED for specific articles. Article number in XXXXXX format. Format: first 4 digits = article number (zero-padded), last 2 digits = branch suffix (00=main). Examples: "017400" (์ œ174์กฐ), "017200" (์ œ172์กฐ), "000300" (์ œ3์กฐ), "001502" (์ œ15์กฐ์˜2) lang: Language - "KO" (Korean) or "ORI" (Original) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Full law content or specific article content

Examples: Retrieve specific article (RECOMMENDED): >>> law_service(mst="279823", jo="017400", type="XML") # ์ž๋ณธ์‹œ์žฅ๋ฒ• ์ œ174์กฐ

Retrieve full law (WARNING: large response for some laws):
>>> law_service(id="009682", type="XML")

Inputs: id, jo, ld, lm, +5 more.

lsDelegated_serviceA
Read-onlyIdempotent

Retrieve delegated laws/rules/ordinances (์œ„์ž„ ๋ฒ•๋ น ์กฐํšŒ).

This tool retrieves information about laws, administrative rules, and local ordinances that are delegated by a parent law. Shows the delegation hierarchy and which specific articles delegate authority.

โš ๏ธ Note: This API does NOT support HTML format (only XML/JSON).

Args: id: Law ID (required if mst not provided) mst: Law master number (required if id not provided) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default) or "XML" (HTML not available for this endpoint) ctx: MCP context (injected automatically)

Returns: Delegation hierarchy with delegated laws/rules/ordinances or error

Examples: Retrieve delegations for ์ดˆยท์ค‘๋“ฑ๊ต์œก๋ฒ•: >>> lsDelegated_service(id="000900", type="XML")

Inputs: id, oc, mst, type.

ordin_serviceA
Read-onlyIdempotent

Retrieve local ordinance full text (์ž์น˜๋ฒ•๊ทœ ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of a Korean local ordinance.

Args: id: Ordinance ID (either id or mst is required) mst: Ordinance master number (either id or mst is required) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full ordinance text or error

Examples: Retrieve by ID: >>> ordin_service(id="000001", type="XML")

Retrieve by MST:
>>> ordin_service(mst="123456", type="XML")

Inputs: id, oc, mst, type.

prec_serviceA
Read-onlyIdempotent

Retrieve court precedent full text (ํŒ๋ก€ ๋ณธ๋ฌธ ์กฐํšŒ).

Args: id: Precedent sequence number (ํŒ๋ก€์ผ๋ จ๋ฒˆํ˜ธ) lm: Precedent name (optional) sections: Response detail level: - "summary": Returns ํŒ์‹œ์‚ฌํ•ญ, ํŒ๊ฒฐ์š”์ง€, ์ฐธ์กฐ์กฐ๋ฌธ, ์ฐธ์กฐํŒ๋ก€ only (~5KB). Excludes ํŒ๋ก€๋‚ด์šฉ (full judgment text, often 15-25KB). Recommended for PlayMCP to stay under 20KB limit. - "full" or None: Returns everything including ํŒ๋ก€๋‚ด์šฉ (default). oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Full precedent text with details or error

Examples: >>> prec_service(id="228541") >>> prec_service(id="228541", sections="summary") # PlayMCP-safe

Inputs: id (required), lm, oc, type, +1 more.

simplify_articleA
Read-onlyIdempotent

Get a law article with legal terms replaced by everyday Korean (์‰ฌ์šด ๋ฒ•๋ฅ  ์ฝ๊ธฐ).

Fetches a law article and annotates legal jargon with plain Korean equivalents using the official ๋ฒ•์ œ์ฒ˜ legal terminology database.

Args: law_name: Law name (e.g., "๋ฏผ๋ฒ•", "๊ทผ๋กœ๊ธฐ์ค€๋ฒ•") article: Article number (e.g., 750 for ์ œ750์กฐ) article_branch: Branch number (e.g., 2 for ์ œ37์กฐ์˜2, default 0) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML"

Returns: Original text, simplified text with inline annotations, and term glossary

Examples: >>> simplify_article(law_name="๋ฏผ๋ฒ•", article=750) >>> simplify_article(law_name="๊ฑด์ถ•๋ฒ•", article=37, article_branch=2)

Inputs: article (required), law_name (required), oc, type, +1 more.

special_decc_serviceA
Read-onlyIdempotent

Retrieve special administrative appeal decision full text (ํŠน๋ณ„ํ–‰์ •์‹ฌํŒ ๋ณธ๋ฌธ ์กฐํšŒ).

Args: tribunal: Tribunal name (same values as special_decc_search) id: Decision serial number (์žฌ๊ฒฐ๋ก€์ผ๋ จ๋ฒˆํ˜ธ) oc: Optional OC override type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full decision text or error

Inputs: id (required), tribunal (required), oc, type.

trty_serviceA
Read-onlyIdempotent

Retrieve treaty full text (์กฐ์•ฝ ๋ณธ๋ฌธ ์กฐํšŒ).

This tool retrieves the complete text of a Korean international treaty.

Args: id: Treaty sequence number (์กฐ์•ฝ์ผ๋ จ๋ฒˆํ˜ธ, required) oc: Optional OC override (defaults to env var) type: Response format - "JSON" (default), "XML", or "HTML" ctx: MCP context (injected automatically)

Returns: Full treaty text with details or error

Examples: Retrieve a treaty by ID: >>> trty_service(id="123")

Inputs: id (required), oc, type.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    A3.6/5.0

    Scored across 54 tools

    Disambiguation2/5

    Multiple tools have overlapping purposes, such as eflaw_search/law_search (differing only by effective vs announcement date), and numerous linkage/term tools (lstrm_rlt_search, lstrm_rlt_jo_search, dlytrm_rlt_search, jo_rlt_lstrm_search, ls_rlt_search) that are easily confused. The composite tools (chain_full_research, legal_resolver, check_precedent_odds) also overlap significantly in aggregating legal sources.

    Naming Consistency2/5

    Naming conventions are mixed: snake_case (eflaw_search, law_service), camelCase (aiSearch, aiRltLs_search), and bare noun phrases (article_citation, legal_resolver). The suffix pattern is inconsistentโ€”some use _search, some _service, and some use neither (check_precedent_odds, simplify_article).

    Tool Count2/5

    At 53 tools (per the list, though the server claims 54), this is far above the typical well-scoped range. The large number reflects the broad legal domain, but it makes the server unwieldy and increases the risk of misselection.

    Completeness4/5

    The tool set covers an extensive range of Korean legal resources: statutes, administrative rules, ordinances, treaties, precedents, constitutional decisions, interpretations, administrative appeals, committee decisions, and legal terminology, plus composite research workflows. There are minor gaps (e.g., no update/create operations, but these are read-only by design) and some redundant coverage, but overall the domain is well covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Enables searching, comparing, and analyzing Korean laws and public institution regulations through natural language, integrating 110 MCP tools covering statutes, precedents, and internal rules.
      100
      56 npm
      24
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      This MCP server integrates South Korea's national law information, building registers from MOLIT, and KOSIS statistics for housing development research. It enables searching laws, retrieving building details, and accessing statistical data through natural language.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables searching and retrieving Korean statutes, precedents, and constitutional court decisions via MCP, using the National Law Information Center API.
      4,629 npm
      1
      MIT