@pipeworx/mcp-louisiana-code 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,210 @@
1
- # Temporary Holding Version
1
+ # @pipeworx/louisiana-code
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
+ Louisiana law by citation — Revised Statutes, Civil Code, Code of Civil
4
+ Procedure, Code of Criminal Procedure, Code of Evidence, Children's Code and
5
+ the Louisiana Constitution — with each section's enactment and amendment
6
+ history parsed out, plus full-text topic search across those code bodies and
7
+ a browse of every section in one Revised Statutes title. Keyless, sourced
8
+ live from the Louisiana State Legislature.
9
+
10
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1704+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.
11
+
12
+ ## Tools
13
+
14
+ - `louisiana_statute(citation | doc_id)` — full text of one section:
15
+ `"RS 14:20"`, `"La. R.S. 9:2800.1"`, `"14:20"`, `"CC 2315"`,
16
+ `"La. C.C. art. 2315"`, `"CCP 966"`, `"C.Cr.P. art. 701"`, `"CE 404"`,
17
+ `"CHC 603"`, `"Const. Art. I, §5"` / `"CONST 1:5"`, or the legis.la.gov
18
+ `doc_id` a search result carries. Returns `heading`, `hierarchy` (the
19
+ chapter/title lines above the section), `text`, the trailing `history`
20
+ line ("Added by Acts 1976, No. 655, §1. Amended by Acts 2014, No. 163,
21
+ §1.") parsed into `amendments` (`{year, act, session}`), and
22
+ `last_amended_year`.
23
+ - `louisiana_law_search(query, bodies?, limit?)` — full-text search by
24
+ topic/keyword ("vehicular homicide", "security deposit lessor",
25
+ "comparative fault"), optionally narrowed to code bodies (`RS`, `CC`,
26
+ `CCP`, `CCRP`, `CE`, `CHC`, `CONST`, `CA`, `HRULE`, `SRULE`, `JRULE`;
27
+ default all). Relevance-ranked rows with citation, heading, last-modified
28
+ date and `doc_id`, plus the source's `total`.
29
+ - `louisiana_title_contents(title, filter?, offset?, limit?)` — every
30
+ section of one Revised Statutes title with its heading and `doc_id`
31
+ (Title 14 has 729, Title 32 has 870), optionally filtered by a word in the
32
+ heading; repealed sections are flagged.
33
+
34
+ ## Auth
35
+
36
+ Keyless.
37
+
38
+ ## Data sources
39
+
40
+ - <https://legis.la.gov/Legis/Law.aspx?d=78338> — one section page (that id
41
+ is RS 14:20). Citation in `#ctl00_PageBody_LabelName`, text as `<P>`
42
+ paragraphs in `#ctl00_PageBody_LabelDocument`, last paragraph = history.
43
+ - <https://legis.la.gov/Legis/LawSearch.aspx> — the "View a Specific Law"
44
+ form and the text-search form.
45
+ - <https://legis.la.gov/Legis/LawSearchList.aspx> — where the search form
46
+ cross-page-posts; renders the result rows.
47
+ - <https://legis.la.gov/Legis/Laws_Toc.aspx?folder=75&level=Parent> — the
48
+ Revised Statutes table of contents (one LinkButton postback per title).
49
+
50
+ ### Shape of this source, because it is a WebForms site and not an API
51
+
52
+ Everything is reachable with plain HTTP — no cookie, no JavaScript, no
53
+ CAPTCHA, no Lexis hop — but three of the four routes are form POSTs:
54
+
55
+ 1. **Doc ids are not in citation order.** `d=78337` is RS 14:2, `d=78338`
56
+ is RS 14:20, `d=78339` is RS 14:201 (string-sorted). So a citation
57
+ cannot be computed into a URL; the "View a Specific Law" form does the
58
+ mapping. POST the form's hidden `__VIEWSTATE`/`__EVENTVALIDATION` fields
59
+ plus `ddlLawBodies`, `tbFirstNumber`, `tbSecondNumber` and
60
+ `btnViewLaw=View`; the server answers **302 to `Law.aspx?d=<id>`**. An
61
+ unknown citation re-renders the form with HTTP 200 and no redirect —
62
+ that is the not-found signal (there is no message).
63
+ 2. **Non-RS bodies need the dropdown's own postback first.** Selecting Civil
64
+ Code etc. is a `__doPostBack('...ddlLawBodies')` that switches the form
65
+ to a single "Article" box; posting the article number against the fresh
66
+ RS-state form is silently ignored. The pack runs that switch once per
67
+ body and caches the resulting hidden fields.
68
+ 3. **The viewstate is not session-bound.** One GET of the form supplies
69
+ fields that stay valid for repeated POSTs (verified: two different
70
+ citations resolved off the same fields, no cookie ever set). The pack
71
+ caches them per isolate for 30 minutes and refreshes once on a POST that
72
+ comes back without a redirect, so a warm citation lookup is one POST +
73
+ one GET.
74
+ 4. **Search posts to `LawSearchList.aspx`, not back to the form** (the
75
+ button's `WebForm_PostBackOptions` names it). The per-body checkboxes
76
+ are `cbLaws$0`..`cbLaws$10` (0 CHC, 1 CC, 2 CCP, 3 CCRP, 4 CE, 5 CA,
77
+ 6 CONST, 7 HRULE, 8 JRULE, 9 RS, 10 SRULE); **`cbLaws$11` "Select All"
78
+ is client-side JavaScript only** — the server ignores it, so "all
79
+ bodies" means ticking all ten. A single-hit search 302s straight to the
80
+ section page. The list renders the first 100 of N, relevance-sorted,
81
+ and states N ("There are 347 sections of law in this list").
82
+ 5. **A one-word query that matches too many sections is refused silently**:
83
+ `"tax"` against RS 302s back to the blank form, byte-identical to a fresh
84
+ GET. The pack reports that as `search_rejected` with a hint to add a
85
+ word. The engine ANDs every word; `a or b`, `a not b` and `""exact
86
+ phrase""` (doubled quotes) are its own syntax.
87
+ 6. **Pages hard-wrap paragraphs with raw newlines.** The history paragraph
88
+ of RS 14:30 spans nine source lines. Split on `<P>` tags, never on
89
+ newlines, or the history line fragments and only its first piece reads
90
+ as history.
91
+ 7. **Form field names contain `$`.** `URLSearchParams` encodes it as `%24`,
92
+ which is what IIS expects; a body that leaves `$` literal gets the form
93
+ re-rendered with HTTP 200 and nothing else.
94
+
95
+ ### The four capabilities, and the one the source cannot do
96
+
97
+ | Capability | Status | How |
98
+ |---|---|---|
99
+ | Topic search | yes | `louisiana_law_search` (the legislature's own full-text engine) |
100
+ | Section by citation | yes | `louisiana_statute` (form POST → 302 → section page) |
101
+ | Amendment / enactment history | yes | trailing history paragraph, parsed into `amendments` |
102
+ | Historical point-in-time version | **no** | legis.la.gov serves the current compiled text only; every section response says so in `historical_version` |
103
+
104
+ `laws_current_through` on every response is the legislature's own
105
+ "updated through the …" line (e.g. "2025 First Extraordinary Session"),
106
+ read from the search form.
107
+
108
+ ## Quick Start
109
+
110
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "louisiana-code": {
116
+ "url": "https://gateway.pipeworx.io/louisiana-code/mcp"
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### What this endpoint actually serves
123
+
124
+ `tools/list` at `https://gateway.pipeworx.io/louisiana-code/mcp` returns the tools in the table
125
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
126
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
127
+ gateway-wide set. So the tool count you see is larger than this table: a
128
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
129
+ pack's own. The connection's `initialize` response states its exact scope, and
130
+ is the authoritative answer for a given day.
131
+
132
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
133
+ scoped connection answer a question this pack does not cover — via
134
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
135
+ second MCP server. There is currently no way to mount a pack endpoint without
136
+ them; if the extra schemas cost you more context than the routing is worth,
137
+ connect to the full gateway once rather than to several pack endpoints.
138
+
139
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
140
+ directly, instead of just this one's:
141
+
142
+ ```json
143
+ {
144
+ "mcpServers": {
145
+ "pipeworx": {
146
+ "url": "https://gateway.pipeworx.io/mcp"
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ Both URLs reach the same gateway and the same 1704+ data sources. The
153
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
154
+ reaches all of them from either one.
155
+
156
+ ## No MCP client? Call it over HTTP
157
+
158
+ ```bash
159
+ curl -X POST https://gateway.pipeworx.io/v1/tools/louisiana_statute \
160
+ -H 'Content-Type: application/json' \
161
+ -d '{"citation":"RS 14:20"}'
162
+ ```
163
+
164
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/louisiana_statute`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
165
+
166
+ ## Standalone (no gateway account)
167
+
168
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
169
+ gateway round-trip:
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "louisiana-code": {
175
+ "command": "npx",
176
+ "args": ["-y", "@pipeworx/mcp-louisiana-code"]
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ Or run it directly to confirm it starts:
183
+
184
+ ```bash
185
+ npx -y @pipeworx/mcp-louisiana-code
186
+ ```
187
+
188
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
189
+ for **only** this pack's tools — none of the shared meta-tools the gateway
190
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
191
+
192
+ ## Using with ask_pipeworx
193
+
194
+ Instead of calling tools directly, you can ask questions in plain English —
195
+ this works on the pack endpoint above as well as on the full gateway:
196
+
197
+ ```
198
+ ask_pipeworx({ question: "your question about Louisiana Code data" })
199
+ ```
200
+
201
+ The gateway picks the right tool and fills the arguments automatically.
202
+
203
+ ## More
204
+
205
+ - [Docs and guides](https://pipeworx.io/docs)
206
+ - [pipeworx.io](https://pipeworx.io)
207
+
208
+ ## License
209
+
210
+ 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-louisiana-code",
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": "Louisiana Laws — Revised Statutes, Civil Code, Code of Civil Procedure,",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-louisiana-code": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "louisiana-code"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-louisiana-code.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-d40d442c77ce5e9f5b881916a1aefc02e9fc9f3224de70f07929bf45410bded8",
30
+ "sourceCommit": "eb436cf60f06c9b79701a15cd1670609580544a5"
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/louisiana-code",
4
+ "title": "Louisiana Code",
5
+ "description": "Louisiana Laws — Revised Statutes, Civil Code, Code of Civil Procedure,",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/louisiana-code",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-louisiana-code",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/louisiana-code/mcp"
16
+ }
17
+ ]
18
+ }