
klaws — Korean compliance risk scanner
io.github.rostradamus由 GitHub 账号 rostradamus 发布v0.1.6更新于 Oct 24, 2026
Scan code for Korean compliance risks — PIPA/개인정보보호법, Network Act, Credit Info. Not legal advice.
概览
一个本地 MCP 服务器,扫描源代码中可能违反韩国个人信息与电商法规的风险,并将结果对应到具体法条。
- 可以做什么
- 扫描目录或单个文件中的合规风险模式,返回严重程度、位置、代码片段和对应法条(scan_directory、scan_file)。列出可用的检测器及其检查内容(list_detectors)。按编号查询内置的韩国法律条文,可选从 law.go.kr 获取最新文本(get_law_reference)。检测器基于正则匹配,支持英文和韩文字段名,覆盖《个人信息保护法》、信息通信网法、信用信息法和电子商务法。
- 适用场景
- 适合在代码库处理韩国用户的个人、信用或交易数据时做初步排查,在正式法律审查前发现同意校验、未加密标识符、个人信息写入日志、保存期限和第三方传输等问题。
- 运行要求
- 以本地进程通过 stdio 运行,启动命令为 klaws serve;需先安装二进制(Docker 镜像、预编译包、go install 或 Go 1.23+ 源码构建),或使用已发布的容器镜像。无需账号、API 密钥或环境变量。可选的在线法条查询需要访问 law.go.kr 的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 klaws — Korean compliance risk scanner,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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
来源:README.md,提交 1b3b071
工具
0版本历史
1- v0.1.6最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分