@pipeworx/mcp-ca-debtwatch 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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "staged_at": "2026-09-23T19:06:15.123Z",
3
+ "publisher_blob": "da6994091dc9dcc6a7433084251ca4bbd58b4bed",
4
+ "publisher_commit": "1c417b2cfcdac06e2d9210e869265722ef013f20",
5
+ "note": "Written by scripts/publish-pack.sh as its LAST step. Its presence is the ONLY thing that lets stage-unpublished-packs.sh skip this pack. Deleting this dir is the correct way to force a rebuild."
6
+ }
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 ADDED
@@ -0,0 +1,176 @@
1
+ # @pipeworx/ca-debtwatch
2
+
3
+ California municipal bond issuance — every state and local government bond, note, certificate of
4
+ participation and Mello-Roos special-tax deal reported to the California Debt and Investment
5
+ Advisory Commission (CDIAC) since 1984, at issue level: principal, sale date, debt type, purpose,
6
+ ratings, interest cost, issuance fees and the underwriter, municipal advisor and bond counsel on
7
+ the deal.
8
+
9
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1663+ live data sources.
10
+
11
+ This is **primary-market issuance**, not the secondary trade tape. It carries no MSRB/EMMA content
12
+ and no CUSIP dependency — CDIAC publishes it as California public data.
13
+
14
+ ## Tools
15
+
16
+ - `ca_debt_search_issues(...)` — search 76,000+ California issues by issuer, county, debt type,
17
+ purpose, tax status, ESG label, sale date and principal amount. The workhorse.
18
+ - `ca_debt_issue(cdiac_number)` — full detail for one issue, including issuance costs broken out by
19
+ participant (underwriter takedown, advisor fee, bond and disclosure counsel fees, trustee fee,
20
+ rating agency fee) and any Annual Debt Transparency Report rows filed against it in later years.
21
+ - `ca_debt_issuer_profile(issuer)` — one issuer's borrowing history: total principal, issue count,
22
+ date range, breakdown by debt type and purpose, largest and most recent issues.
23
+ - `ca_debt_statewide_totals()` — the state treasurer's headline totals (debt issued YTD, local debt
24
+ issued YTD, proposed but unsold, recent long-term volume).
25
+ - `ca_debt_filter_options(field?)` — the exact wording CDIAC uses for each enumerated filter.
26
+ - `ca_debt_resolve_issuer(name)` — partial name → the exact issuer names CDIAC uses.
27
+
28
+ ## Auth
29
+
30
+ Keyless. No registration, no key, no quota published.
31
+
32
+ ## Data sources
33
+
34
+ - <https://debtwatch.treasurer.ca.gov/env.json> — the API base the SPA itself reads. Resolved once
35
+ per isolate rather than hardcoded, with a fallback to the current value.
36
+ - `PUT /api/dataset/issues/search` — issuance search. **PUT, not GET or POST.**
37
+ - `GET /api/dataset/issues` — column metadata, including the accepted values for every enumerated
38
+ filter.
39
+ - `GET /api/dataset/issues/element/Issuer/search?q=&pageNumber=N` — issuer typeahead (7,600+
40
+ issuers). **Paginates at ten and ignores every page-size parameter** (`pageSize`, `take`, `limit`
41
+ all no-op) while reporting the true count in `totalValues`; only `pageNumber` works. Reading page
42
+ one alone makes "san diego" look like 10 issuers when it is 47, and makes an exact name that
43
+ sorts onto a later page (San Diego Unified Port District) come back as ambiguous with candidates
44
+ that do not contain it. This pack pages, bounded, and reports when it stopped early.
45
+ - `GET /api/report/issuance-detail-with-history/{cdiacNumber}` — single-issue detail plus later ADTR
46
+ filings.
47
+ - `GET /api/fast-stat` — headline statewide totals.
48
+
49
+ ### Things worth knowing before you touch this
50
+
51
+ - **A malformed filter is an empty HTTP 500, not a 400.** No body, no validation message. Filters
52
+ are keyed by column id with a `type` discriminator, decoded from the SPA bundle:
53
+ `StringOneOf` / `StringContainsOneOf` (`options: []`), `DateBetween` / `DateOnOrAfter` /
54
+ `DateOnOrBefore` / `DateEqualTo` (`minimum` / `maximum` / `exactly`), `NumberBetween` /
55
+ `NumberGreaterThanOrEqualTo` / `NumberLessThanOrEqualTo`, `BooleanEqualTo` (`exactly`). Anything
56
+ else is a 500.
57
+ - **`IssuerCounty` is the multi-value column** and needs `StringContainsOneOf`; sending
58
+ `StringOneOf` against it matches nothing without erroring.
59
+ - **Text filters are exact-match on CDIAC's spelling**, and a near-miss returns a clean zero-row
60
+ 200 rather than an error — `Los Angeles` is a different issuer from
61
+ `Los Angeles Unified School District`. Every enum argument in this pack is resolved against the
62
+ upstream's own option list first, and every issuer argument through the typeahead endpoint, so a
63
+ caller naming things the way a person would still gets rows. An argument that cannot be resolved
64
+ is answered with candidates rather than dropped.
65
+ - **There is no `values` endpoint per filter.** The option lists live inline in
66
+ `GET /api/dataset/issues`, under `columns[].filter.values.all`, for columns whose strategy is
67
+ `AllAtOnce`. High-cardinality columns are `ByAsyncSearchOnly` and only reachable through the
68
+ `element/{col}/search` typeahead.
69
+ - `SaleDate` carries future dates for proposed issues, so a descending sort surfaces deals that
70
+ have not happened yet. `sold_status` separates them.
71
+ - Scope is California only. There is no national equivalent on a free path — MSRB/EMMA's terms bar
72
+ building a redistributable database from it.
73
+
74
+ ## Quick Start
75
+
76
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "ca-debtwatch": {
82
+ "url": "https://gateway.pipeworx.io/ca-debtwatch/mcp"
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### What this endpoint actually serves
89
+
90
+ `tools/list` at `https://gateway.pipeworx.io/ca-debtwatch/mcp` returns the tools in the table
91
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
92
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
93
+ gateway-wide set. So the tool count you see is larger than this table: a
94
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
95
+ pack's own. The connection's `initialize` response states its exact scope, and
96
+ is the authoritative answer for a given day.
97
+
98
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
99
+ scoped connection answer a question this pack does not cover — via
100
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
101
+ second MCP server. There is currently no way to mount a pack endpoint without
102
+ them; if the extra schemas cost you more context than the routing is worth,
103
+ connect to the full gateway once rather than to several pack endpoints.
104
+
105
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
106
+ directly, instead of just this one's:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "pipeworx": {
112
+ "url": "https://gateway.pipeworx.io/mcp"
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ Both URLs reach the same gateway and the same 1663+ data sources. The
119
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
120
+ reaches all of them from either one.
121
+
122
+ ## No MCP client? Call it over HTTP
123
+
124
+ ```bash
125
+ curl -X POST https://gateway.pipeworx.io/v1/tools/ca_debt_search_issues \
126
+ -H 'Content-Type: application/json' \
127
+ -d '{"issuer":"Los Angeles Unified School District","limit":5}'
128
+ ```
129
+
130
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/ca_debt_search_issues`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
131
+
132
+ ## Standalone (no gateway account)
133
+
134
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
135
+ gateway round-trip:
136
+
137
+ ```json
138
+ {
139
+ "mcpServers": {
140
+ "ca-debtwatch": {
141
+ "command": "npx",
142
+ "args": ["-y", "@pipeworx/mcp-ca-debtwatch"]
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ Or run it directly to confirm it starts:
149
+
150
+ ```bash
151
+ npx -y @pipeworx/mcp-ca-debtwatch
152
+ ```
153
+
154
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
155
+ for **only** this pack's tools — none of the shared meta-tools the gateway
156
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
157
+
158
+ ## Using with ask_pipeworx
159
+
160
+ Instead of calling tools directly, you can ask questions in plain English —
161
+ this works on the pack endpoint above as well as on the full gateway:
162
+
163
+ ```
164
+ ask_pipeworx({ question: "your question about Ca Debtwatch data" })
165
+ ```
166
+
167
+ The gateway picks the right tool and fills the arguments automatically.
168
+
169
+ ## More
170
+
171
+ - [Docs and guides](https://pipeworx.io/docs)
172
+ - [pipeworx.io](https://pipeworx.io)
173
+
174
+ ## License
175
+
176
+ 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 ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@pipeworx/mcp-ca-debtwatch",
3
+ "version": "0.1.0",
4
+ "description": "ca-debtwatch — California municipal bond issuance (CDIAC / DebtWatch)",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-ca-debtwatch": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "ca-debtwatch"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-ca-debtwatch.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
+ }
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/ca-debtwatch",
4
+ "title": "Ca Debtwatch",
5
+ "description": "ca-debtwatch — California municipal bond issuance (CDIAC / DebtWatch)",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/ca-debtwatch",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-ca-debtwatch",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/ca-debtwatch/mcp"
16
+ }
17
+ ]
18
+ }