South Dakota Code

io.github.pipeworx-iov0.1.0更新于 Oct 8, 2026

South Dakota Codified Laws — state statutes by citation and by topic.

已验证Streamable HTTP可网页运行Web Search & ScrapingKnowledge & Memory

概览

AI 生成的概览

让助手按引文查询南达科他州法典条文,并按主题或关键词检索州法规。

功能
通过南达科他州官方法规数据提供两个工具:sd_statute 按引文返回某一 SDCL 条文的当前全文,包括官方标题、章与编的背景信息,以及制定或修订历史行;sd_search 在全部 71 编的官方条文与章标题(catchline)中做主题和关键词检索。检索只覆盖标题行,不覆盖法规正文,因为南达科他州不提供全文检索。已废止或已移转的条文会返回处置说明和废止标记。
适用场景
适合助手需要引用或核对南达科他州现行法规原文、解析引文,或查找房东法、隐蔽持枪许可等主题条文时使用。不适合查询某条文修订前的历史版本,因为官方只发布当前在线版本。
运行要求
以远程 streamable HTTP 端点形式运行在提供方的网关上;未声明需要账户、API 密钥或环境变量,上游法规 API 也无需密钥。说明中还提供本地 stdio 方式,用 npx 启动,需要 Node.js。需要能访问该网关以及州议会的法规 API。
安装前请注意
该集成是独立且非官方的,与上游提供方无隶属或背书关系。远程端点除本包的两个工具外还会暴露网关共享的元工具,因此列出的工具数量会多于预期;initialize 响应会说明确切范围。检索结果仅为标题行匹配,可能不反映自索引上次生成以来被重新编号或废止的条文。

安装

在 SourceWeft 中

  1. 打开 控制台中的 South Dakota Code,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "south-dakota-code": {
      "type": "http",
      "url": "https://gateway.pipeworx.io/south-dakota-code/mcp"
    }
  }
}

README

@pipeworx/south-dakota-code

South Dakota Codified Laws (South Dakota state statutes) — full section text by citation, and topic/keyword search over official catchlines.

Part of Pipeworx — an MCP gateway connecting AI agents to 1721+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.

Tools

  • sd_statute(citation) — full current text of one SDCL section (e.g. "22-16-4", murder in the first degree), with the official catchline, chapter/title context, and — when the section carries one — the "Source:" line listing every session law that enacted or amended it, split out into history.
  • sd_search(query, limit?) — topic/keyword search over the Legislature's own official section and chapter catchlines across all 71 titles (e.g. "landlord", "concealed pistol permit"). Not full-text search — South Dakota does not publish one.

Auth

Keyless.

Data sources

  • https://sdlegislature.gov/api/Statutes/Statute/{citation} — one section's (or chapter's, or title's) current text, as JSON with an Html field. sd_statute calls this live, per request, for a section-shaped citation.
  • https://sdlegislature.gov/api/Statutes/Title — the list of all 71 titles. Used only by scripts/bake-index.mjs to drive the per-title fetch below.

Capabilities — three available, one is not

South Dakota's own publication covers:

  • Citation lookup — sd_statute.
  • Topic/keyword search — sd_search, over catchlines only (see below).
  • Amendments/enactment history — PARTIALLY AVAILABLE. An in-force section's text ends with a "Source: SDC 1939, § 13.2007 (1); SL 1979, ch 160, § 2; ..." line listing every session law that created or amended it (verified live on 22-16-4). sd_statute splits this into history rather than leaving it only embedded in text. A repealed/transferred section's one-line disposition (e.g. "22-16-9. Repealed by SL 2005, ch 120, § 158, eff. July 1, 2006.") comes back as disposition_text, with repealed: true read from the API's own flag.
  • Historical version (the text as it read before an amendment) — NOT AVAILABLE. sdlegislature.gov publishes only the CURRENT online edition: no per-year archive, no "view as of" date picker, and no endpoint returning a prior version's text (checked the site's own JS bundle for one — none exists). The Source: line says WHEN and by WHICH session law a section was amended; it does not return what the text read before that.

Source and shape — read this before touching the parser

sdlegislature.gov is a Vue single-page app. The August state-law survey (docs/state-law-probe.md) correctly flagged the HTML shell as carrying no statute — it just stopped one layer too early. The SPA itself is fed by a keyless, public JSON API under /api/Statutes/ (found by grepping the site's own JS bundle for /api/Statutes — no documentation page exists for it): GET /api/Statutes/Statute/{citation} accepts a section citation ("22-16-4"), a chapter citation ("22-16") or a title number ("22"), and returns one JSON envelope whose Html field is that level's content — full section text for a section, or a plain table-of-contents listing (chapter header + every section's citation and catchline, with NO body text) for a chapter or title. No auth, no key, no rate limit observed.

sd_statute only ever calls the section-shaped form, live, per request — never baked.

sd_search needs a structural index (every citation + its official catchline) to search over, and there is no search endpoint and no single "whole code" listing page the way North Dakota publishes one. The only way to assemble one is to call the TITLE-level form for each of the 71 titles and parse its table-of-contents Html blob. scripts/bake-index.mjs does this once, offline, into src/sd-index-data.ts — never at request time.

Why the parser works off flattened TEXT, not HTML anchors. Each title's Html blob is a concatenation of chapters that were authored and HTML-exported independently over decades, so anchor markup is NOT uniform: some chapters link a citation as a modern anchor (sdlegislature.gov/Statutes?Statute=X), others use a legacy DisplayStatute.aspx?Type=Statute&Statute=X anchor form, and repealed-section entries repeat their own citation as a text label immediately before the real catchline. Rather than chase every anchor shape, the bake script strips ALL tags (dropping style/script element CONTENTS too — the first cut of this script leaked raw CSS text into a catchline because that content sits between tags, not inside one) and then scans the flattened text for citation-SHAPED TOKENS beginning with the known title number. This is markup-agnostic: it only depends on the citation strings the site already prints as plain text, uniform across every era of document. See the script's own header comment for the full detail, including how duplicate-token artifacts and the rare genuinely-duplicated citation (observed on <5% of sections) are handled — never silently, always resolved toward the longer catchline, since this index drives search RANKING only and sd_statute always re-fetches the real text live.

Refresh path: node scripts/bake-index.mjs > src/sd-index-data.ts whenever South Dakota recodifies (new session laws are folded in after each legislative session). Nothing else in the pack needs to change.

Known gaps

  • sd_search matches official catchlines (section and chapter names), not full statutory prose — South Dakota does not publish full-text search, and this pack does not claim to either. It says so in both the tool description and every "no match" response.
  • A citation present in the baked index that the LIVE API 404s on (e.g. a section renumbered or repealed since the index was last baked) returns a loud reason: "index_live_mismatch", never a plain found: false with no explanation.

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

json
{  "mcpServers": {    "south-dakota-code": {      "url": "https://gateway.pipeworx.io/south-dakota-code/mcp"    }  }}

What this endpoint actually serves

tools/list at https://gateway.pipeworx.io/south-dakota-code/mcp returns the tools in the table above plus the shared Pipeworx meta-tools — ask_pipeworx, discover_tools, search_within, remember/recall and the rest of the gateway-wide set. So the tool count you see is larger than this table: a single-pack endpoint currently lists roughly 30 shared tools alongside the pack's own. The connection's initialize response states its exact scope, and is the authoritative answer for a given day.

This is deliberate, not multiplexing by accident. The meta-tools are what let a scoped connection answer a question this pack does not cover — via ask_pipeworx, which routes across the whole catalog — without you adding a second MCP server. There is currently no way to mount a pack endpoint without them; if the extra schemas cost you more context than the routing is worth, connect to the full gateway once rather than to several pack endpoints.

Or connect to the full Pipeworx gateway to get every pack's tools listed directly, instead of just this one's:

json
{  "mcpServers": {    "pipeworx": {      "url": "https://gateway.pipeworx.io/mcp"    }  }}

Both URLs reach the same gateway and the same 1721+ data sources. The only difference is which pack's tools are listed directly; ask_pipeworx reaches all of them from either one.

No MCP client? Call it over HTTP

bash
curl -X POST https://gateway.pipeworx.io/v1/tools/sd_statute \  -H 'Content-Type: application/json' \  -d '{"citation":"22-16-4"}'

No account needed for the first calls. Inspect any tool: GET https://gateway.pipeworx.io/v1/tools/sd_statute. Find one: POST https://gateway.pipeworx.io/v1/tools/search_packs with {"query":"..."}.

Standalone (no gateway account)

This package also runs as a local stdio MCP server — no Pipeworx account, no gateway round-trip:

json
{  "mcpServers": {    "south-dakota-code": {      "command": "npx",      "args": ["-y", "@pipeworx/mcp-south-dakota-code"]    }  }}

Or run it directly to confirm it starts:

bash
npx -y @pipeworx/mcp-south-dakota-code

It speaks MCP over stdin/stdout and answers initialize/tools/list/tools/call for only this pack's tools — none of the shared meta-tools the gateway connection above adds. Same source, same tools, no ask_pipeworx routing.

Using with ask_pipeworx

Instead of calling tools directly, you can ask questions in plain English — this works on the pack endpoint above as well as on the full gateway:

ask_pipeworx({ question: "your question about South Dakota Code data" })

The gateway picks the right tool and fills the arguments automatically.

More

License

MIT

来源:README.md,提交 a273227

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.0最新Oct 8, 2026