Extracts every numeric table and the narrative text of the 2026-27 Victorian Budget Paper No. 5 (Statement of Finances, incorporating Quarterly Financial Report No. 3) into SQLite, and serves it as a public read-only MCP server on Cloudflare Workers + D1.
Live MCP endpoint: https://vic-budget-mcp.aicolab.workers.dev/mcp
(streamable HTTP; /sse also available for legacy clients)
Connect from Claude Code:
claude mcp add --transport http vic-budget https://vic-budget-mcp.aicolab.workers.dev/mcp| count | |
|---|---|
| Tables (Ch 1–6, Appendix A & B) | 199 |
| Table columns | 810 |
| Line items (with hierarchy + row types) | 4,148 |
| Facts (individual printed values) | 14,102 |
| Narrative text chunks (FTS-indexed) | 785 (~400k chars) |
| Charts (metadata; data points where printed) | 9 |
QA: every printed Total … row is recomputed from its component rows —
1,986 / 1,986 checks pass (100%), using rounding tolerance consistent with
the paper's "totals are based on unrounded figures" convention.
get_overview— schema, conventions, dataset counts (start here)run_sql— read-only SELECT/WITH against the full schemalist_tables— filter by chapter / entity / sector / keywordget_table— reconstruct any table by printed number ('4.2', 'B.1', '3.5.1')find_line_item— search line items by label across all tablessearch_text— FTS5 over the narrative corpusfiscal_aggregates— headline GG-sector aggregates across forward estimates
Tidy fact model, multi-year ready (keyed by editions):
editions ─┬─ source_tables ─┬─ table_columns (position, header_label, fy_label, kind)
│ └─ line_items (label, parent_id, level, row_type,
│ note_ref, note_marker, fy_hint)
│ └─ facts (value, value_millions, raw_text)
├─ text_chunks (+ text_search FTS5)
└─ charts ── chart_points
Conventions:
valueis as printed (parentheses → negative;..→ 0 per the paper's style conventions, withraw_textpreserving the printed form).value_millionsnormalises$thousand/$billiontables; NULL for per-cent rows.row_type:header(section rows),item(leaves),total,derived(Net result, Net lending etc.).- Appendix A tables A.5/A.6 print two budget years as bold/italic row pairs;
line_items.fy_hintcarries '2026-27' (bold) / '2025-26' (italic). source_tables.pages= source PDF pages for provenance.- Charts are captured as metadata only unless values are printed on the chart
(
charts.confidence).
python3.13 -m venv .venv && ./.venv/bin/pip install pymupdf pdfplumber
cd pipeline
../.venv/bin/python inventory.py # manifest of 199 tables from unit markers
../.venv/bin/python extract.py # word-coordinate table parser -> staging JSON
../.venv/bin/python qa.py # recompute all printed totals (must be 100%)
../.venv/bin/python textcorpus.py # narrative chunks
../.venv/bin/python charts.py # chart metadata
../.venv/bin/python build_db.py # -> data/budget.sqlite
../.venv/bin/python export_d1.py # -> data/d1_schema.sql + d1_data.sqlDeploy:
cd server && npm install
npx wrangler d1 execute vic-budget-2026-27 --remote --file=../data/d1_schema.sql -y
npx wrangler d1 execute vic-budget-2026-27 --remote --file=../data/d1_data.sql -y
npx wrangler deploy“2026-27 State Budget - Statement of Finances.pdf” (278 pages), Department of Treasury and Finance, State of Victoria, published May 2026, CC BY 4.0.