← MCP server and skill grades

korean-law-mcp

chrisryugj/korean-law-mcp

B
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 through LAW_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 http or --mode sse opens a local HTTP server.
Files
In local STDIO and CLI modes, amendment_table (also exposed via legal_analysis) can create directories and write .hwpx document files to any user-writable path passed in outputPath; the setup wizard reads and writes MCP client config files (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI, Zed, Antigravity), and startup loads .env from the current directory.
Secrets
Reads the user's 법제처 Open API key (LAW_OC or KOREAN_LAW_API_KEY) from environment variables, .env, HTTP headers/query parameters, or plugin settings and sends it to www.law.go.kr (or https://mcp.gomdori.app/law in the Claude plugin); optional HTTP mode also reads MCP_AUTH_TOKEN and proxy credentials.

Findings

1 medium2 low1 info
  1. MediumFile-writing tools declare readOnlyHint: true and can overwrite .hwpx files anywhere on disk

    src/tool-registry.ts:828

    In listTools(), every exposed tool—including legal_analysis and execute_tool—is advertised with readOnlyHint: true and destructiveHint: false. However, local STDIO mode enables enableAmendmentFileOutput() on startup, allowing legal_analysis(mode="amendment_table") and execute_tool(tool_name="amendment_table") to accept an unrestricted outputPath (including ~ and ../ traversal), create arbitrary parent directories with mkdir(..., { recursive: true }), and overwrite existing .hwpx files without checking if they exist. Because MCP clients use readOnlyHint: true to auto-approve tool calls without user confirmation, a prompt-injected agent reading untrusted text can silently overwrite existing .hwpx legal documents anywhere in the user's home directory.

    Fix: Set readOnlyHint: false, destructiveHint: true, and idempotentHint: false on legal_analysis and execute_tool when file output is enabled (or split .hwpx file saving into a separate tool marked destructive), restrict outputPath to an allowed workspace directory, and pass { flag: "wx" } to writeFile so existing files are not silently overwritten.

  2. LowSetup wizard writes unpinned npx -y config without --ignore-scripts or --omit=optional

    src/setup.ts:136

    When a user runs the korean-law-mcp setup wizard to register the server with local AI clients, buildServerEntry and buildZedEntry write npx -y korean-law-mcp without pinning the package version and without passing --ignore-scripts or --omit=optional. Whenever the npm cache refreshes, the AI client will automatically download and execute the latest unverified version from npm, run transitive postinstall scripts, 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 the args array generated by buildServerEntry and buildZedEntry.

  3. LowHTTP mode forwards unrecognized Authorization Bearer tokens to www.law.go.kr as API keys

    src/server/http-server.ts:304

    In HTTP mode (--mode http or --mode sse), if an incoming request carries an Authorization: Bearer header that does not match MCP_AUTH_TOKEN (for example, when deployed behind an OAuth/OIDC reverse proxy with MCP_ALLOW_UNAUTHENTICATED_REMOTE=1 or alongside x-mcp-token) and no apikey header is set, the server treats that Authorization token as the user's LAW_OC key and sends it in the ?OC= query parameter on outbound requests to www.law.go.kr.

    Fix: Reserve the Authorization header strictly for authenticating to the MCP server itself and read upstream LAW_OC credentials only from dedicated headers such as apikey or x-law-oc.

  4. InfoClaude Code plugin sends queries, contract texts, and API keys through a third-party server

    .claude-plugin/plugin.json:31

    Although the plugin manifest description states that it provides Korean law 'via the official 법제처 Open API' and prompts for the user's personal LAW_OC key, the plugin connects over HTTP to the author-operated server https://mcp.gomdori.app/law rather than running locally. Any user who installs the plugin sends their personal LAW_OC key as well as full inputs to tools like document_review (contract text), amendment_table (draft bills), and verify_citations through mcp.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 (description and userConfig.api_key.description) that requests, document texts, and the LAW_OC key transit through mcp.gomdori.app, and recommend local STDIO installation for confidential legal documents.