Skip to main content
Glama
Neonswitched

uk-rates-thresholds

README.md
# UK Rates & Thresholds — open dataset

**133 current UK official figures** — Income Tax, National Insurance, benefits, wages, pensions, savings, energy and government fees — each **effective-dated** and linked to its **official source**. Built and kept fresh for **[rates.trycashpilot.com](https://rates.trycashpilot.com)**.

> Data, not advice. Verify with the linked official source before acting.

## What's here

- **`data/*.yaml`** — the 133 figures. Every entry is self-describing:
  ```yaml
  - id: income_tax_personal_allowance
    name: Income Tax Personal Allowance
    category: tax
    value: "£12,570"
    unit: per year
    valid_from: "2026-04-06"
    valid_to: "2027-04-05"
    source_url: https://www.gov.uk/income-tax-rates
    source_org: HMRC / gov.uk
    confidence: verified          # checked against the official page
    checked_at: "2026-08-11"
    notes: "..."
    history: ["£12,570 from 2021-04-06", "..."]
  ```
- **`mcp/server.py`** — a Model Context Protocol server so AI agents can query the figures directly (below).

## How to use it

- **Website** — https://rates.trycashpilot.com — one page per figure, answering "what is X right now?", each sourced and dated.
- **JSON API** — https://rates.trycashpilot.com/api/v1/all.json — every figure, machine-readable (`count` + `metrics[]`).
- **This repo** — clone the YAML and use it directly.

## MCP server (for AI agents)

`mcp/server.py` speaks the [Model Context Protocol](https://modelcontextprotocol.io) over stdio (JSON-RPC 2.0), with no dependencies beyond PyYAML. It gives an agent three tools:

- `list_metrics` — every figure (id, name, category, current value)
- `get_metric` — one figure by `id` (value, validity dates, official source URL, history)
- `search_metrics` — by keyword (e.g. `minimum wage`, `ISA`, `price cap`)

Run it:
```bash
pip install pyyaml
python3 mcp/server.py
```
Then register it in your MCP client (e.g. Claude Desktop `mcpServers`):
```json
{
  "mcpServers": {
    "uk-rates-thresholds": {
      "command": "python3",
      "args": ["/absolute/path/to/mcp/server.py"]
    }
  }
}
```

## Licence

- **Data** (`data/`) contains public sector information licensed under the **[Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)**. Figures are drawn from GOV.UK / HMRC / DWP / Ofgem / the Bank of England and other official sources; each entry links its own `source_url`. Attribution: *"Contains public sector information licensed under the Open Government Licence v3.0."*
- **Code** (`mcp/` and tooling) is **[MIT](LICENSE)**.

## Disclaimer

This is a data reference, **not tax, legal or financial advice**. Figures change; always confirm the current value with the linked official source before acting.