Skip to main content
Glama
belgium-open-data

belgium-open-data

by vecture-be
README.md
# Belgium Data Desk

Belgian public data, answered from the official sources.

Belgium Data Desk is a catalogue of about 23,000 Belgian open-data records (data.gov.be plus directly harvested federal, regional and city portals), a website to search it, and an [MCP](https://modelcontextprotocol.io) server that lets AI assistants search it and answer common questions from the authoritative publisher: Statbel figures, IRCEL-CELINE air quality, VMM flood maps and the Flemish subsurface database (DOV).

Hosted instance: **https://data.vecture.be** · MCP endpoint: `https://data.vecture.be/mcp` (no account, read-only)

Listed in the official [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.vecture-be%2Fbelgium-data-desk/versions/latest) as `io.github.vecture-be/belgium-data-desk`, so registry-aware clients and directories can find it by name.

```bash
claude mcp add --transport http belgium-open-data https://data.vecture.be/mcp
```

The public service combines a searchable catalogue, browser-based analysis and read-only MCP tools. No account is required, and the website does not use tracking scripts.

## What the MCP server offers

| Tool | Answers from |
| --- | --- |
| `search_datasets`, `get_dataset`, `catalogue_overview` | The catalogue: metadata, licence, contact, link checks. For 21 common needs the official source is pinned first with guidance (`public/dataset-authority-v1.mjs`). |
| `preview_dataset` | The first 64 KiB of a catalogued CSV/TSV, fetched from the publisher |
| `belgian_statistics` | Statbel: population, income, inflation, unemployment by municipality, province, region |
| `air_quality` | IRCEL-CELINE: now, forecast, annual means against WHO and EU limits |
| `flood_risk` | VMM's official flood-prone maps (Flanders) |
| `heritage_at_location` | Onroerend Erfgoed via Mercator: whether an address in Flanders is protected or listed heritage (monument, town view, landscape, archaeological site, UNESCO, fixed inventories, archaeology zones), with what each designation means for permits |
| `zoning_at_location` | Departement Omgeving via Mercator: the land-use zone that applies at an address in Flanders (most detailed plan in force: RUP, BPA, APA or gewestplan), overlays, building-line and expropriation plans, regulations, plans in procedure and Omgevingsloket permit applications since 2017 |
| `river_levels` | waterinfo.be (VMM, HIC): live river, canal and tide levels against watch and alarm levels, and the publishers' 48-60 hour level and tide forecasts (Flanders) |
| `weather` | KMI/IRM: measured weather now, last 24 hours and 7 days, ALARO forecast for 48 hours, KMI's official weather warnings (via MeteoAlarm) |
| `train_punctuality` | Infrabel: punctuality between two stations, of a station, a train yesterday, an IC line or the network, with causes, major incidents, cancellations and today so far |
| `electricity_grid` | Elia: Belgium's electricity now (consumption, solar, wind, border flows, imbalance price), today and tomorrow, a past day since 2015 (with generation mix and CO2) or forecasts up to 10 days |
| `subsurface_at_location`, `search_subsurface`, `get_subsurface_record` | Databank Ondergrond Vlaanderen: soil, geology, boreholes, groundwater |
| `search`, `fetch` | Same catalogue, in the shape ChatGPT deep research expects |

Answers start with `key_facts` built only from data in the same answer, and carry a `provenance` block. Catalogue results are metadata and link-check evidence, not claims that the data is correct.

## Observed dataset changes

The weekly full-file monitor already compares file hashes, distinct rows, schemas, and time coverage. The public `data-changes` branch adds cautious change-type labels to those observations. We do not invent publisher release numbers or serialize dependency diagrams into every card. Production checks ensure full-file baselines exist and generated cards match their MCP search records.

## Run it locally

Requires Node 22+.

```bash
npm ci
npm test                 # offline unit tests, about 5 seconds
npm run snapshot         # download the current catalogue from data.vecture.be (about 25 MB)
npm run build:index      # build the MCP search shards and the static SEO pages
npm run dev              # http://localhost:8787 and http://localhost:8787/mcp
```

`npm run harvest` rebuilds the catalogue from the source portals instead of the snapshot. It takes a few minutes. Catalogue listings get three tries; a portal that still does not answer keeps its previous records, and such a harvest is not cached for the week, so the next deploy tries again.

Check a running server (yours or the hosted one):

```bash
npm run eval                                         # search relevance against eval-relevance/queries.json
node scripts/smoke-mcp.mjs http://localhost:8787     # every MCP tool once
node scripts/verify-live.mjs http://localhost:8787   # catalogue, relay, MCP and page integrity
```

## Architecture

[Logical architecture and editable diagrams](docs/ARCHITECTURE.md) describe the public interfaces, the indexed catalogue pipeline, live-source answer tools, shared evidence controls, and the release process.

The catalogue path harvests and checks source metadata before publishing search artifacts. Live answer tools query authoritative services with validated inputs, bounded upstream access, and source attribution. Both paths share consistent identifiers and provenance.

| Where | What |
| --- | --- |
| `scripts/harvest.mjs`, `scripts/national-dcat.mjs` | Source adapters: CKAN, OpenDataSoft, OGC API, CSW and the national DCAT feed |
| `scripts/harvest-fetch.mjs`, `scripts/harvest-dov.mjs` | Retries for catalogue listings; DOV's ~3,900 3D-model layers folded into one record per model version |
| `scripts/curate.mjs`, `public/dataset-*.mjs` | Curation: kinds, topics, licences, publishers, authoritative sources, synonyms |
| `mcp-server.mjs` | MCP protocol, tool definitions, search ranking |
| `statbel.mjs`, `air.mjs`, `flood.mjs`, `dov.mjs`, `dov-search.mjs`, `place.mjs` | Live answer tools |
| `eval-relevance/queries.json` | Real questions with the answer an expert would expect |
| `scripts/test-*.mjs` | Offline tests (`npm test`) |
| `docs/reference/` | Design notes: relay security model, SQL Lab, DOV details, catalogue audit |

## Contributing

You do not need to write code to help. The most useful contributions are a wrong answer you noticed, a better official source, a correction to a publisher or licence, or a real question the search gets wrong. See [CONTRIBUTING.md](CONTRIBUTING.md).

## Hosting your own

Deployment configuration lives in `wrangler.jsonc`. For your own installation, configure `PUBLIC_ORIGIN` and the bindings for your account, then run `npx wrangler deploy`. Keep credentials in deployment secrets, not source control.

## Licence

Code: MIT. Catalogue metadata and answers come from the publishers named in each record and keep their licences; every answer cites its source.