-
-
Korean Law Review Workbench with four read-only WebMCP tools ready for collaboration.
-
The person selects the statute, article, archive dates, and review question before the agent retrieves evidence.
-
Agent-generated review brief preserves the person's question, identifies the textual change, and provides verification checks and citations.
-
A source-linked comparison shows that Article 1004-2 was added between the selected archive dates.
-
Four structured WebMCP tools cover statute search, exact article retrieval, version comparison, and review-brief generation.
Inspiration
Korean legal review depends on exact text, exact dates, and verifiable sources. Finding only the current version of a statute is often insufficient. A reviewer must determine which text existed at the relevant time, identify what changed, and check the official source before drawing a conclusion.
Browser agents normally have to infer the meaning of controls, scrape long documents, and guess whether visible text corresponds to the requested date. I built this project to explore a clearer division of responsibility: the person defines the legal question and review boundaries, while the agent performs structured and reproducible evidence retrieval through WebMCP.
What it does
Korean Law Review Workbench lets a person select:
- a Korean statute
- a specific article
- an earlier and later archive date
- a question that defines the scope of the review
The page exposes four read-only WebMCP tools:
search_lawsfinds matching Korean statutes for a requested archive date.get_articlesretrieves one exact article with its official and archived sources.compare_versionsclassifies the article as added, removed, changed, or unchanged.build_review_briefprepares a deterministic, source-linked review memo around the person's question.
Tool calls update the same visible workspace used by the person. The reviewer can inspect the exact text, dates, revision identifiers, and source links used by the agent.
The default demonstration compares Article 1004-2 of the Korean Civil Act between January 1, 2020 and August 31, 2026. The archived versions show that the provision concerning the declaration of loss of inheritance rights was added during that period.
The application performs textual and source comparison only. It does not provide legal advice or decide how a provision applies to a particular case.
How we built it
I created a new public, MIT-licensed repository and wrote the application from scratch during the WebMCP Challenge period. The project does not copy source code from the existing Legalize-KR production website.
The application is built with TypeScript, Vite, and Vitest. The human interface and WebMCP tools use the same legal-data and comparison functions so that agent results can be reproduced through the visible interface.
Each tool is registered through document.modelContext.registerTool() with:
- a narrow JSON Schema
readOnlyHint: trueuntrustedContentHint: true- cancellation propagation for network requests
- compact results designed for agent context
A bundled index contains 1,733 Korean statute titles and repository paths, but no statute bodies. At execution time, the app resolves the last archived Git revision available on or before the requested Korean calendar date. It then retrieves the statute Markdown from that immutable commit and extracts only the requested article.
Every comparison includes the requested dates and links to the official Korean Law Information Center source and both immutable Legalize-KR revisions.
The app requires no account and has no database, analytics, cookies, or personal-data storage. Its production build is designed for a static Cloudflare Pages deployment without Pages Functions, Workers compute, or paid storage bindings.
Challenges we ran into
One challenge was controlling the size of tool results. An early comparison response contained every parsed article from both statute versions. This produced an unnecessarily large agent context. I replaced the full snapshots with compact revision references and returned only the selected article.
Historical-date resolution also required care. A requested date must resolve to the last revision available by the end of that calendar day in Korea, rather than returning the repository's current version.
Another challenge was parsing legal Markdown conservatively. Article text must stop before the next article or structural heading. Real-data testing revealed a boundary case where the following section heading could be included in the final article. I added a regression test and corrected the parser.
Finally, legal text presents a trust problem. Retrieved content must be treated as evidence, not as instructions or an automatic legal conclusion. The tools therefore remain read-only, mark external legal text as untrusted, and return explicit attribution and non-legal-advice notices.
Accomplishments that we're proud of
I am proud that the project exposes four working WebMCP tools rather than adding a thin natural-language wrapper around an existing search interface.
The human and agent paths share the same data functions and visible evidence state. When an agent performs a comparison or builds a review brief, the result also appears in the workspace for immediate human verification.
The project uses real historical statute data and immutable Git revisions. The default scenario produces a reproducible added result for Article 1004-2 of the Korean Civil Act and provides direct links to the earlier archive, later archive, and official current source.
I also added automated coverage for schemas, date handling, article parsing, comparison states, compact tool results, tool annotations, and visible-result publication. A deployment guard prevents Cloudflare Worker entry points, Pages Functions, routing files, and compute or storage bindings from being added accidentally.
What we learned
WebMCP is most useful when it exposes meaningful domain operations instead of reproducing a general-purpose prompt box. Explicit tools for article retrieval, historical comparison, and source-linked brief generation reduce ambiguity and make the agent's work easier to verify.
I also learned that human-agent collaboration requires shared state. Returning evidence only to the agent would make review difficult. Publishing the same result into the visible workspace lets the person inspect the sources, correct the scope, and retain control over the final judgment.
Finally, compactness is part of tool quality. A legally accurate result can still be unsuitable for an agent if it includes an entire statute when only one article was requested.
What's next for Legalize-KR WebMCP
The MVP intentionally covers statutes only. The next improvements could include:
- paragraph-level and item-level change highlighting
- retrieval of supplementary provisions and transitional rules
- selection of multiple related articles for one review
- exportable review packages that remain local to the user
- improved handling of GitHub API rate limits
Precedents, administrative rules, and local ordinances may be considered later, but each dataset requires a separate review of source rights, schemas, and attribution requirements.
The core principle will remain unchanged: people control the legal question, scope, and judgment, while agents retrieve structured and verifiable evidence.
Built With
- api
- cloudflare
- css3
- git
- github
- html5
- legalize-kr
- node.js
- pages
- pnpm
- typescript
- vite
- vitest
- webmcp
- webmcp-types
- wrangler
Log in or sign up for Devpost to join the conversation.