Skip to main content
Glama
santarosalia

legalize-kr MCP

by santarosalia

legalize-kr MCP

legalize-kr 로컬 Git 클론을 대상으로, README 빠른 시작과 같은 작업(현재 본문, git log, diff, 전역 검색, 특정 일자 시점 본문)을 Model Context Protocol 도구로 노출하는 stdio 서버입니다.

요구 사항

  • Node.js 18+

  • 환경 변수 LEGALIZE_KR_ROOT: legalize-kr 저장소 루트 절대 경로 (kr/ 포함)

  • Git 기반 도구(kr_git_log, kr_diff, kr_file_at_date)는 해당 경로가 Git 저장소여야 합니다.

Related MCP server: LexLink

설치 및 빌드

cd /path/to/search
npm install
npm run build

Cursor에서 사용

mcp.json 예시:

{
  "mcpServers": {
    "legalize-kr": {
      "command": "node",
      "args": ["/absolute/path/to/search/dist/index.js"],
      "env": {
        "LEGALIZE_KR_ROOT": "/absolute/path/to/legalize-kr"
      }
    }
  }
}

전역 설치 없이 npx tsx src/index.ts로 개발 실행할 수 있습니다 (tsx 설치 필요).

도구

도구

설명

kr_read_file

kr/{법령명}/{파일}.md 워킹 트리 내용 읽기

kr_list_laws

kr/ 직계 법령 폴더 목록

kr_search

kr/**/*.md 문자열 검색 (ripgrep 우선, 없으면 Node 순회)

kr_git_log

경로별 git log

kr_diff

동일 법령 폴더 안 두 Markdown 파일 git diff

kr_file_at_date

git log -1 --before=날짜로 커밋 조회, 선택 시 해당 시점 본문

특정 일자 결과는 커밋 날짜 기준 근사입니다. 공포일은 각 파일 YAML 공포일자를 참고하세요.

라이선스

MIT

Available Tools

6 tools
kr_diff두 법령 파일 비교A
Read-only

동일 법령 폴더 안 두 Markdown 파일에 대해 git diff를 실행합니다 (README의 diff 예시).

ParametersJSON Schema
NameRequiredDescriptionDefault
fileAYes비교 첫 파일
fileBYes비교 둘째 파일
lawDirYeskr/ 바로 아래 법령 폴더명 (예: 민법)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, so the agent knows it is a safe read operation. The description adds that it uses git diff and requires files in the same folder, which is useful context. However, it does not describe the output format, edge cases, or any side effects beyond the annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that front-loads the core operation (git diff) and the key constraint (same law folder). It contains no redundant information, and the README reference is a minor but acceptable addition. It is highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple diff tool with fully documented parameters and a read-only annotation, the description is largely complete. It states what it does and the folder constraint, and references the README for examples. Since there is no output schema, a direct statement about the return value would improve completeness, but the action and constraints are sufficiently clear for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully describes all three parameters with 100% coverage, including enums for fileA and fileB and lawDir's meaning. The description adds that files are Markdown and in the same folder, but this is already inferable from the schema enum values and lawDir description. The description does not significantly enhance parameter understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs git diff on two Markdown files within the same law folder, which is a specific verb and resource. It distinguishes itself from sibling tools like kr_read_file (single file reading) and kr_git_log (history) by focusing on comparing two files. The title "두 법령 파일 비교" reinforces this purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: when you need to compare two files in the same law folder. However, it does not explicitly mention alternatives or when not to use this tool, such as when reading a single file would suffice. The context is clear but lacking explicit exclusions or contrasts with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kr_file_at_date특정 일자 시점 법령 본문B
Read-only

git log -1 --before=날짜로 해당 시점 커밋을 찾고, 선택적으로 git show로 당시 본문을 가져옵니다.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes기준일 YYYY-MM-DD (커밋 날짜 기준)
lawDirYeskr/ 바로 아래 법령 폴더명 (예: 민법)
fileNameYes법령 Markdown 파일명
maxCharsNo
includeContentNo

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotation readOnlyHint=true already indicates this is a read-only operation, so the bar for behavioral disclosure is lower. The description adds context on the internal workflow (git log to find the commit, optionally git show to fetch content), which explains what the tool does under the hood. However, it does not disclose potential edge cases like invalid dates, missing commits, or how maxChars affects output, which would add further transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence with no filler. It is front-loaded with the core operation, though it leans on git jargon that may reduce clarity for some users. Overall, it is concise and avoids redundancy, earning a high but not perfect score due to the technical phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and moderate complexity (5 params, 3 required), so the description should compensate by explaining what the tool returns and when to use it. It only describes the internal git steps and does not mention return values, error behavior, or the practical difference between includeContent true/false. This leaves the agent underinformed for effective invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 60% of parameters with descriptions, including date, lawDir, fileName, and maxChars. The tool description adds a bit of semantic value by implying that 'date' is used for the commit lookup and that content retrieval is optional (i.e., includeContent). However, it does not systematically explain each parameter, and the coverage is moderate, so the description only partially compensates for the gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explains a specific action: finding the commit before a given date and optionally retrieving the content at that time. It identifies the resource (law file at a specific date) and the operation, which is more than a tautology. However, it uses git implementation details rather than a clear functional statement like 'retrieve the text of a law file as of a specific date,' and it does not explicitly distinguish itself from sibling tools like kr_read_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention that it is for historical/dated lookups, nor does it name kr_read_file or kr_git_log as alternatives. The only implicit hint is the date parameter and the phrase '당시 본문' (text at that time), but no explicit when/when-not context is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kr_git_log개정 이력 (git log)B
Read-only

지정한 법령 경로에 대한 git log를 반환합니다 (README의 git log -- kr/.../).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
formatNooneline
lawDirYeskr/ 바로 아래 법령 폴더명 (예: 민법)
fileNameNo생략 시 해당 법령 폴더 전체

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint annotation already covers safety, and the description adds minimal context (path scope and a README reference). It does not disclose behavioral details such as default limit/format behavior or how fileName granularity works, which remain in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that efficiently conveys the core purpose without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple read-only nature and lack of output schema, the description is minimally adequate but omits context about return value structure or when to use it relative to siblings. It relies heavily on the tool name and schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (lawDir and fileName) but limit and format lack descriptions. The tool description does not compensate by explaining these parameters, leaving their semantics to the schema's defaults and enums.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns a git log for a specified law path, using a specific verb and resource. It distinguishes itself from siblings like kr_diff (which deals with diffs) and kr_read_file (which reads content) by naming 'git log' explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like kr_diff or kr_file_at_date. The description only mentions 'README의 git log' without explaining contexts, exclusions, or relative advantages.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kr_list_laws법령 폴더 목록A
Read-only

kr/ 직계 하위 법령 디렉터리 이름을 정렬해 반환합니다.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint annotation already declares the tool is safe for reads. The description adds useful behavioral context by specifying the result is sorted and limited to immediate subdirectories (직계 하위). This goes beyond the annotation without contradicting it, though it omits details like error handling or hidden files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence in Korean that immediately states the return type and scope. It is front-loaded and contains no filler, making it highly concise and efficient for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple listing tool with no input parameters and no output schema, the description provides sufficient information about what is returned (sorted folder names) and the scope (direct children of kr/). It could mention the exact format (e.g., array) but this is implied by '디렉터리 이름을 반환합니다'. Overall, it is complete enough for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, and schema coverage is 100%. The baseline for no parameters is 4, and the description correctly does not invent parameter details. Since there are no parameters to explain, the description is adequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns sorted names of direct sub-law directories under 'kr/'. It specifies the verb '반환합니다' (returns), the resource '법령 디렉터리 이름' (law directory names), and the scope 'kr/ 직계 하위' (immediate subdirectories). This distinguishes it from sibling tools like kr_read_file or kr_diff, which operate on file contents or changes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool should be used to list law categories, but it does not explicitly state when to use it versus alternatives like kr_search or kr_file_at_date. No exclusions or alternative tool references are provided, leaving the usage context to inference rather than direct guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kr_read_file법령 파일 현재 내용B
Read-only

워킹 트리에서 kr/{lawDir}/{fileName} 전문을 UTF-8로 읽습니다 (README의 cat 예시와 동일).

ParametersJSON Schema
NameRequiredDescriptionDefault
lawDirYeskr/ 바로 아래 법령 폴더명 (예: 민법)
fileNameYes법령 Markdown 파일명
maxCharsNo최대 문자 수(초과 시 잘림)

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, so the safe-read nature is covered. The description adds useful context: UTF-8 encoding and the working-tree scope. However, it claims to read the 'full text' (전문) while the schema allows truncation via maxChars, a behavioral trait not disclosed in the description. This is not a contradiction with annotations but is an omission.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that includes the core operation and a helpful README reference ('cat example'). It is concise, front-loaded, and contains no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the readOnlyHint annotation, and complete parameter schema, the description covers the essential purpose and mode (UTF-8, working tree). It falls slightly short by not mentioning the truncation behavior tied to maxChars, but the schema already explains that, so the gap is minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with each parameter already well-described (e.g., lawDir, fileName enum, maxChars with default and maximum). The description only repeats the placeholders {lawDir}/{fileName}, adding minimal value beyond what the schema already provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads the full text of a specified file from the working tree, with a specific verb ('읽습니다') and resource (kr/{lawDir}/{fileName}). It distinguishes itself from siblings by emphasizing '워킹 트리' (current content), though it does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives such as kr_file_at_date. The working-tree reference implies current content, but the description lacks any when/when-not statements or mention of sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 6 tool updatesv1.0.0
    • First observedkr_diff
    • First observedkr_file_at_date
    • First observedkr_git_log
    • First observedkr_list_laws
    • First observedkr_read_file
    • First observedkr_search

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct operation: reading current files, listing law directories, diffing files, searching, viewing git history, and retrieving historical versions. The only slight overlap between kr_read_file and kr_file_at_date is clearly differentiated by temporal focus.

Naming Consistency4/5

All tools share the 'kr_' prefix, and most follow a verb_noun pattern (read_file, list_laws, git_log, file_at_date). However, kr_diff and kr_search are verb-only, creating a minor inconsistency in naming style.

Tool Count5/5

With 6 tools, the set is well-scoped for a legal document browsing server. Each tool serves a clear purpose without unnecessary redundancy, fitting comfortably within the ideal 3-15 range.

Completeness4/5

The server covers core read-only workflows: discovering laws, reading current and historical content, searching, diffing, and viewing git history. A notable gap is the lack of a tool to list individual files within a law directory, which prevents agents from enumerating files without guessing.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables searching and retrieving Korean legal information including laws, court precedents, legal interpretations, and local ordinances from the Korean National Law Information Center API with intelligent search ranking.
    -
  • F
    license
    A
    quality
    B
    maintenance
    Enables AI systems to search, retrieve, and analyze Korean legal information from the National Law Information API (law.go.kr), including laws, administrative rules, English translations, and law-ordinance linkages.
    26
    2
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides tools for querying Korean laws, precedents, administrative rules, and ordinances via GitHub REST API, enabling natural language access to legal data.
    11
    Apache 2.0
  • 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,664 npm
    1
    MIT