
klaws — Korean compliance risk scanner
io.github.rostradamusPublished by GitHub account rostradamusv0.1.6Updated Oct 24, 2026
Scan code for Korean compliance risks — PIPA/개인정보보호법, Network Act, Credit Info. Not legal advice.
Overview
A local MCP server that scans source code for possible Korean privacy and e-commerce compliance risks and maps findings to specific statutes.
- What you can do
- Scan a directory or a single file for compliance risk patterns and get findings with severity, location, snippet and matched law articles (scan_directory, scan_file). List the available detectors and what each one looks for (list_detectors). Look up bundled Korean law provisions by ID, optionally fetching current text from law.go.kr (get_law_reference). Detectors use regex matching on English and Korean field names across PIPA, the Network Act, the Credit Information Act and the E-Commerce Act.
- When to use it
- Useful when reviewing a codebase that handles Korean users' personal, credit or transaction data and you want a quick first pass flagging consent checks, unencrypted identifiers, logging of personal data, retention and third-party transfers before a legal review.
- Requirements
- Runs as a local process over stdio, launched with the klaws serve command; the binary must be installed (Docker image, prebuilt binary, go install, or Go 1.23+ from source) or run via the published container image. No accounts, API keys or environment variables are required. The optional live law lookup needs network access to law.go.kr.
Installation
In SourceWeft
- Open klaws — Korean compliance risk scanner in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
klaws
[CI] [Release] [Container] [Glama] [License: MIT]
Korean law compliance risk scanner for codebases. Scans source code for patterns that may indicate compliance risks under Korean law and maps findings to specific legal provisions. Runs as an MCP server (so AI coding assistants can scan on request) and as a standalone CLI.
Currently covers PIPA (Personal Information Protection Act), the Network Act (정보통신망법), the Credit Information Act (신용정보법), and the E-Commerce Act (전자상거래법).
Disclaimer: klaws identifies possible compliance risks for review. It does not constitute legal advice. Consult qualified legal counsel for definitive guidance.
Privacy: klaws analyzes code locally and transmits nothing. The only outbound network call is the optional
--livelaw lookup to law.go.kr; without that flag it is fully offline. See Privacy & Security.
Quick Start
Installation
Docker (recommended)
No toolchain required — the image is published to GitHub Container Registry and works identically on macOS, Linux, and Windows:
Prebuilt binary
Download the archive for your platform from the latest release, extract it, and move klaws onto your PATH.
go install
From source
Requirements: Go 1.23+
Verify the install:
Usage
Scan
Example Output
Look Up Law Provisions
List Detectors
Detectors
Detectors use regex-based pattern matching. They support both English and Korean field names (e.g., email/이메일, residentNumber/주민번호, consent/동의).
MCP Server
klaws can run as an MCP server, making its scanning capabilities available to AI coding assistants.
Available Tools
Configuration
All clients use the same launch command: klaws serve over stdio. Use the absolute path to the binary (run which klaws, or where klaws on Windows, to find it), or just klaws if it is on your PATH. Prefer not to install anything? Use the Docker variant below — it works in any client that supports stdio MCP servers.
Claude Code — ~/.claude/settings.json:
Or add it in one command:
Claude Desktop — claude_desktop_config.json (Settings → Developer → Edit Config):
Cursor — ~/.cursor/mcp.json (or .cursor/mcp.json in a project):
VS Code — .vscode/mcp.json:
Once connected, ask your assistant something like "scan this directory for Korean compliance risks with klaws."
Run the MCP server via Docker
No binary install needed — swap the command/args for a docker run that mounts the code you want scannable. The -i flag keeps stdin open for the stdio transport; --scan-root /src confines scans to the mounted directory:
Point the assistant at paths under /src (the container-side mount), e.g. "scan /src for Korean compliance risks."
Remote (Streamable HTTP)
By default klaws serve uses stdio (local). To run it as a remote MCP server over HTTP, pass --http:
The MCP endpoint is then available at http://<host>:8080/mcp (Streamable HTTP transport). Point an HTTP-capable MCP client at that URL.
Securing a remote server
--auth-token <token>— requiresAuthorization: Bearer <token>on every HTTP request; unauthenticated requests get401. Can also be supplied via theKLAWS_AUTH_TOKENenvironment variable. Applies to--httponly.--scan-root <dir>— restrictsscan_directory/scan_fileto paths within<dir>; requests for paths outside it are rejected. (Also honored in stdio mode.)
Notes:
--auth-tokenprovides bearer auth but not TLS. For untrusted networks, still terminate TLS at a reverse proxy / gateway in front of klaws.- The
scan_directoryandscan_filetools read the server's filesystem (the paths you pass resolve on the host running klaws). For remote scanning, run klaws where the code lives (e.g. a CI runner with the repo checked out) and set--scan-rootto that checkout. Theget_law_referenceandlist_detectorstools have no filesystem dependency.
Bundled Law Provisions
klaws ships with 40 articles across 4 Korean laws embedded in the binary (no external files needed):
PIPA (개인정보 보호법) — 10 articles
Network Act (정보통신망법) — 11 articles
Credit Information Act (신용정보법) — 10 articles
E-Commerce Act (전자상거래법) — 9 articles
Full Korean article text is included. Use --live to fetch the latest version from law.go.kr.
Privacy & Security
klaws is designed to be safe to point at private code:
- Local-only analysis. Scanning is pure static pattern-matching on files you pass in. Source code never leaves your machine — nothing is uploaded, logged remotely, or sent to any service.
- One optional outbound call. The only network request klaws ever makes is the
--livelaw lookup (CLI) /get_law_referencewith live fetch (MCP), which fetches public statute text from law.go.kr. It sends only the statute's name (e.g.개인정보보호법, resolved from the provision you looked up) as the search query — never your code. Omit--liveto stay fully offline. - Read-only by design. klaws only reads the files it scans; it never modifies your code. Its MCP tools are annotated read-only.
- Confine the reachable filesystem. When exposing the MCP server, pass
--scan-root <dir>to restrictscan_directory/scan_fileto a single tree, and--auth-tokenwhen serving over--http. See Securing a remote server.
To report a vulnerability, see SECURITY.md.
Architecture
Roadmap
- More detectors: marketing-message consent (NIA-MKT-001) (done), unprotected credit information (CIA-ENC-001) (done), transaction-record retention (ECA-RET-001) (done), personal-data retention (PIPA-RET-001) (done), third-party/cross-border transfer (PIPA-XBR-001) (done)
- Multi-language: Python, JavaScript/TypeScript detection patterns
- More Korean laws: E-Commerce Act (전자상거래법) consumer protection rules (done), Network Act (정보통신망법) (done), Credit Information Act (신용정보법) (done)
- CI/CD: GitHub Action, SARIF output, severity thresholds (done)
- Configuration: custom pattern rules via config file
GitHub Action (CI)
klaws ships a composite action that scans your code and produces a SARIF report, which you can upload to GitHub code scanning so findings appear inline on pull requests and in the Security tab.
Set fail-on: HIGH (or MEDIUM) to make the check fail the PR when findings at that severity or above are present. The if: always() on the upload step ensures the SARIF is still published when the gate fails.
Releasing
Maintainers: see RELEASE.md for how to cut a release and publish to the MCP registry.
License
MIT
Source: README.md at commit 1b3b071
Tools
0Version history
1- v0.1.6LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts