@pipeworx/mcp-kr-law 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mojibake Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,178 @@
1
- # Temporary Holding Version
1
+ # @pipeworx/kr-law
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ South Korean national statutes: search by title, fetch one article (조문) at
4
+ a time with its own effective date, and a statute's revision history. Bring
5
+ your own OC (Open API user id) — every call runs on your own registration.
6
+
7
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1815+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.
8
+
9
+ ## Tools
10
+
11
+ - `kr_law_search(...)` — find statutes by title keyword. Returns each
12
+ match's `mst` (the version id every other tool needs), ministry,
13
+ promulgation/effective dates, and whether it's the current or a superseded
14
+ version.
15
+ - `kr_law_article(...)` — fetch ONE article by `mst` + `article_no` (e.g.
16
+ `"5"` or `"4-2"` for 제4조의2). Never the whole law body. Omit
17
+ `article_no` for a paginated table of contents (numbers + titles) instead.
18
+ Returns the article's own text, its paragraphs (항) and items (호), and its
19
+ own effective date — which can differ from the law's own when only that
20
+ article was later amended.
21
+ - `kr_law_history(...)` — revision history for a statute: every
22
+ promulgation with its own promulgation date/number and entry-into-force
23
+ date, each a separate historical `mst` you can pass back to
24
+ `kr_law_article`.
25
+
26
+ ## Auth
27
+
28
+ BYO only, and will stay that way. Every tool requires `_apiKey` — your own OC
29
+ from https://open.law.go.kr/LSO/main.do (로그인 → OPEN API → OPEN API 신청).
30
+ With no key, every tool refuses before any network call, naming the argument
31
+ and where to register.
32
+
33
+ **Registering an OC requires Korean real-name verification** — a Korean
34
+ mobile-carrier identity check or an i-PIN. There is no alien-registration,
35
+ passport, or overseas-signup path on the Ministry's own form. Pipeworx has no
36
+ Korean-resident staff and cannot complete either method, so there is no
37
+ platform key for this pack and none is coming (ruled, fleet #3128,
38
+ 2026-10-15).
39
+
40
+ For a quick smoke test only (never use this as a real credential, and never
41
+ rely on it being stable), the Ministry's own public demo id `"test"` works
42
+ for `kr_law_search` and `kr_law_article`.
43
+
44
+ **`kr_law_history` needs a service your OC may not have by default.** Even a
45
+ real, verified OC must separately enable 법령연혁 (law history) under
46
+ *My Applications* on the open.law.go.kr dashboard (OPEN API → 신청내역 →
47
+ check the 법령종류 box). An OC without it gets a specific, named error from
48
+ this tool rather than a generic failure — follow the steps the error gives.
49
+ The public demo id does not have this entitlement at all.
50
+
51
+ ## Data sources
52
+
53
+ - Ministry of Government Legislation (법제처), National Law Information
54
+ Center Open API — South Korea's official statute database (law, cabinet
55
+ order, and ministerial-ordinance text, with promulgation and
56
+ entry-into-force dates and revision history).
57
+
58
+ ## Known gaps and gotchas
59
+
60
+ - **Korean-language text only.** No translation is attempted or labelled
61
+ official. The Ministry does not publish an official English statute text
62
+ through this API.
63
+ - **`kr_law_history`'s success shape is unproven against a live call** — no
64
+ OC entitled to the history service was available while building this pack.
65
+ The error path (an OC *without* that entitlement) is proven live and is
66
+ what most callers without a premium/full registration will actually see.
67
+ Flag this if it ever drifts from the documented row shape.
68
+ - **`article_no` branch numbering**: Korean statutes insert new articles
69
+ between existing ones as "제4조의2" rather than renumbering everything —
70
+ pass that as `"4-2"`. `kr_law_article` with no `article_no` lists every
71
+ valid value for a given `mst`.
72
+ - A law's own `시행일자` (effective date) and one specific article's
73
+ `조문시행일자` can differ — an amendment sometimes only moves one article's
74
+ effective date forward. Both are returned, kept separate.
75
+ - **www.law.go.kr is itself Cloudflare-fronted and intermittently answers a
76
+ legitimate request with HTTP 522/524/503** (measured live, 2026-10-15: 1 of
77
+ 20 real calls). Every tool retries up to 3 times with backoff before giving
78
+ up; if the origin is still down after that, the error says plainly that
79
+ Korea's law service did not respond and to try again — never a bare
80
+ Cloudflare status code or its "error code: 5xx" body text.
81
+
82
+ ## Quick Start
83
+
84
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "kr-law": {
90
+ "url": "https://gateway.pipeworx.io/kr-law/mcp"
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ ### What this endpoint actually serves
97
+
98
+ `tools/list` at `https://gateway.pipeworx.io/kr-law/mcp` returns the tools in the table
99
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
100
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
101
+ gateway-wide set. So the tool count you see is larger than this table: a
102
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
103
+ pack's own. The connection's `initialize` response states its exact scope, and
104
+ is the authoritative answer for a given day.
105
+
106
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
107
+ scoped connection answer a question this pack does not cover — via
108
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
109
+ second MCP server. There is currently no way to mount a pack endpoint without
110
+ them; if the extra schemas cost you more context than the routing is worth,
111
+ connect to the full gateway once rather than to several pack endpoints.
112
+
113
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
114
+ directly, instead of just this one's:
115
+
116
+ ```json
117
+ {
118
+ "mcpServers": {
119
+ "pipeworx": {
120
+ "url": "https://gateway.pipeworx.io/mcp"
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ Both URLs reach the same gateway and the same 1815+ data sources. The
127
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
128
+ reaches all of them from either one.
129
+
130
+ ## No MCP client? Call it over HTTP
131
+
132
+ This pack takes your own API key (`_apiKey`) — we don't front one for it, so there's no curl here that would run without it. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/kr_law_search`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
133
+
134
+ ## Standalone (no gateway account)
135
+
136
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
137
+ gateway round-trip:
138
+
139
+ ```json
140
+ {
141
+ "mcpServers": {
142
+ "kr-law": {
143
+ "command": "npx",
144
+ "args": ["-y", "@pipeworx/mcp-kr-law"]
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ Or run it directly to confirm it starts:
151
+
152
+ ```bash
153
+ npx -y @pipeworx/mcp-kr-law
154
+ ```
155
+
156
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
157
+ for **only** this pack's tools — none of the shared meta-tools the gateway
158
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
159
+
160
+ ## Using with ask_pipeworx
161
+
162
+ Instead of calling tools directly, you can ask questions in plain English —
163
+ this works on the pack endpoint above as well as on the full gateway:
164
+
165
+ ```
166
+ ask_pipeworx({ question: "your question about Kr Law data" })
167
+ ```
168
+
169
+ The gateway picks the right tool and fills the arguments automatically.
170
+
171
+ ## More
172
+
173
+ - [Docs and guides](https://pipeworx.io/docs)
174
+ - [pipeworx.io](https://pipeworx.io)
175
+
176
+ ## License
177
+
178
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "@pipeworx/mcp-kr-law",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Korea Law MCP — South Korean national statutes via the Ministry of Government Legislation's (법제처) National Law Information Center Open API (open.law.go.kr).",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-kr-law": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "kr-law"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-kr-law.git"
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.9.3",
26
+ "@cloudflare/workers-types": "^4.20260405.1"
27
+ },
28
+ "pipeworx": {
29
+ "sourceHash": "v1-d2544724a20c392d39680491969b4bbc123dacae1d3bfe7fd85a9ede38a230cb",
30
+ "sourceCommit": "fe38188882d0fe91e5a45d82b7b989b4aae1e8b6"
31
+ }
32
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/kr-law",
4
+ "title": "Kr Law",
5
+ "description": "Korea Law MCP — South Korean national statutes via the Ministry of Government Legislation's (법제처)…",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/kr-law",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-kr-law",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/kr-law/mcp"
16
+ }
17
+ ]
18
+ }