korean-law-mcp
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 3f7c7d8460e5
- Files read
- 400
This project is an MCP server, CLI, and Claude plugin that searches and analyzes South Korean laws, court precedents, ordinances, and legal citations using official government APIs. Its main risk is that exposed analysis tools declare themselves read-only (readOnlyHint: true) even though in local mode they can create folders and overwrite .hwpx files anywhere on disk if an agent is tricked by prompt injection, while the Claude plugin routes queries, submitted documents, and API keys through a third-party server (mcp.gomdori.app).
What it can reach
- Network
- Sends legal search and retrieval requests to South Korea's Ministry of Government Legislation (
www.law.go.kr) and National Tax Service (taxlaw.nts.go.kr), optionally throughLAW_EXTERNAL_HTTPS_PROXY; when installed as the Claude Code plugin, sends all tool calls to the author's hosted server (https://mcp.gomdori.app/law), and in optional--mode httpor--mode sseopens a local HTTP server. - Files
- In local STDIO and CLI modes,
amendment_table(also exposed vialegal_analysis) can create directories and write.hwpxdocument files to any user-writable path passed inoutputPath; thesetupwizard reads and writes MCP client config files (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI, Zed, Antigravity), and startup loads.envfrom the current directory. - Secrets
- Reads the user's 법제처 Open API key (
LAW_OCorKOREAN_LAW_API_KEY) from environment variables,.env, HTTP headers/query parameters, or plugin settings and sends it towww.law.go.kr(orhttps://mcp.gomdori.app/lawin the Claude plugin); optional HTTP mode also readsMCP_AUTH_TOKENand proxy credentials.
Findings
-
MediumFile-writing tools declare readOnlyHint: true and can overwrite .hwpx files anywhere on disk
In
listTools(), every exposed tool—includinglegal_analysisandexecute_tool—is advertised withreadOnlyHint: trueanddestructiveHint: false. However, local STDIO mode enablesenableAmendmentFileOutput()on startup, allowinglegal_analysis(mode="amendment_table")andexecute_tool(tool_name="amendment_table")to accept an unrestrictedoutputPath(including~and../traversal), create arbitrary parent directories withmkdir(..., { recursive: true }), and overwrite existing.hwpxfiles without checking if they exist. Because MCP clients usereadOnlyHint: trueto auto-approve tool calls without user confirmation, a prompt-injected agent reading untrusted text can silently overwrite existing.hwpxlegal documents anywhere in the user's home directory.Fix: Set
readOnlyHint: false,destructiveHint: true, andidempotentHint: falseonlegal_analysisandexecute_toolwhen file output is enabled (or split.hwpxfile saving into a separate tool marked destructive), restrictoutputPathto an allowed workspace directory, and pass{ flag: "wx" }towriteFileso existing files are not silently overwritten. -
LowSetup wizard writes unpinned npx -y config without --ignore-scripts or --omit=optional
When a user runs the
korean-law-mcp setupwizard to register the server with local AI clients,buildServerEntryandbuildZedEntrywritenpx -y korean-law-mcpwithout pinning the package version and without passing--ignore-scriptsor--omit=optional. Whenever the npm cache refreshes, the AI client will automatically download and execute the latest unverified version from npm, run transitivepostinstallscripts, and install optional native/ML packages (onnxruntime-node,@huggingface/transformers,adm-zip) that the documentation states are excluded.Fix: Pin the current version (
korean-law-mcp@${VERSION}) and include"--ignore-scripts"and"--omit=optional"in theargsarray generated bybuildServerEntryandbuildZedEntry. -
LowHTTP mode forwards unrecognized Authorization Bearer tokens to www.law.go.kr as API keys
In HTTP mode (
--mode httpor--mode sse), if an incoming request carries anAuthorization: Bearerheader that does not matchMCP_AUTH_TOKEN(for example, when deployed behind an OAuth/OIDC reverse proxy withMCP_ALLOW_UNAUTHENTICATED_REMOTE=1or alongsidex-mcp-token) and noapikeyheader is set, the server treats thatAuthorizationtoken as the user'sLAW_OCkey and sends it in the?OC=query parameter on outbound requests towww.law.go.kr.Fix: Reserve the
Authorizationheader strictly for authenticating to the MCP server itself and read upstreamLAW_OCcredentials only from dedicated headers such asapikeyorx-law-oc. -
InfoClaude Code plugin sends queries, contract texts, and API keys through a third-party server
Although the plugin manifest description states that it provides Korean law 'via the official 법제처 Open API' and prompts for the user's personal
LAW_OCkey, the plugin connects over HTTP to the author-operated serverhttps://mcp.gomdori.app/lawrather than running locally. Any user who installs the plugin sends their personalLAW_OCkey as well as full inputs to tools likedocument_review(contract text),amendment_table(draft bills), andverify_citationsthroughmcp.gomdori.app(this is noted in the repository README, but not in the plugin manifest shown during installation).Fix: Disclose in
.claude-plugin/plugin.json(descriptionanduserConfig.api_key.description) that requests, document texts, and theLAW_OCkey transit throughmcp.gomdori.app, and recommend local STDIO installation for confidential legal documents.
