Statfin Mcp

io.github.3121nPublished by GitHub account 3121nv0.1.0Updated Oct 24, 2026

Statistics Finland (StatFin/PxWeb): search tables, read metadata, fetch JSON-stat2 data.

VerifiedSTDIODesktop onlyWeb Search & ScrapingData & Analytics

Overview

AI-generated overview

Lets an assistant search Statistics Finland's StatFin tables, read their metadata, and fetch official statistics as JSON-stat2.

What you can do
Wraps the StatFin PxWeb API for Finnish official statistics. Tools search over 3000 tables by keyword using a locally bundled index, return a table's title and dimensions with valid value codes, fetch filtered values as JSON-stat2, and list roughly 140 subject areas. All tools accept an optional language parameter (English default, Finnish, Swedish); variable codes stay language-independent.
When to use it
Useful when an assistant needs Finnish official statistics: population, economy, or other StatFin subjects, with filtering by region, year, and variable. Also handy for exploring which tables and dimension codes exist before querying.
Requirements
Runs locally as a stdio process, typically started with npx from the npm package @nor-data/statfin-mcp, so Node.js and network access to the StatFin PxWeb API are needed. No API key or account is required.
Before you install
Queries go to Statistics Finland's public PxWeb API, which rate-limits to 30 calls per 10 seconds and rejects selections over roughly 100,000 cells. A few subjects return HTTP 400 server-side and are skipped when the bundled search index is built. Data is licensed CC BY 4.0 by Statistics Finland.

Installation

In SourceWeft

  1. Open Statfin Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@nor-data/statfin-mcp

MCP server for official statistics from Statistics Finland (Tilastokeskus) — the StatFin database, exposed through the PxWeb API. Search 3000+ tables, inspect their dimensions, and pull data as JSON-stat2. No API key required.

Part of the nor-data family of Nordic open-data MCP servers. Built on the same pattern as the SSB (Norway) server — StatFin and SSB both speak PxWeb, so the tools mirror each other.

Tools

ToolWhat it does
sok_tabellKeyword search across all StatFin tables. PxWeb has no server-side search, so this matches a bundled index (built from the full table tree) locally and returns the most relevant tables with their tabell_id.
hent_tabellMetadata for a table: title + dimensions (variables) with their valid value codes and labels. Read this first to learn which filter codes exist.
hent_dataFetch actual values as JSON-stat2, filtered by a flat {variabelkode: [verdier]} map. Supports special selections like {filter:'top', values:['1']} for the latest period.
list_emnerList the ~140 StatFin subject areas (e.g. vaerak = Population structure). Scope a search or browse when a keyword misses.

All tools accept an optional lang (en default, fi, sv). Variable codes are language-independent; only titles/labels are localised.

Example agent flow

  1. sok_tabell({ query: "population by region" }) → tabell_id: "vaerak/statfin_vaerak_pxt_11ra.px"
  2. hent_tabell({ tabell_id }) → sees variables Alue (area), Vuosi (year), Tiedot (info)
  3. hent_data({ tabell_id, filtre: { Alue: ["SSS"], Vuosi: { filter: "top", values: ["1"] } } }) → latest national figures as JSON-stat2

Install

jsonc
// Claude Desktop / Claude Code MCP config{  "mcpServers": {    "statfin": {      "command": "npx",      "args": ["-y", "@nor-data/statfin-mcp"]    }  }}

Develop

bash
npm installnpm run build-index   # crawl the StatFin tree → data/tables-index.json (~1–2 min)npm run dev           # run from source via tsxnpm run build         # compile to dist/

The search index is bundled in the package (data/tables-index.json). Re-run npm run build-index to refresh it (nightly is plenty — StatFin updates tables, not the tree, frequently).

Notes & limits

  • PxWeb allows 30 calls / 10 s and rejects queries over ~100 000 cells (HTTP 403) — keep hent_data selections small (few regions × few years).
  • A few subjects (vtp, kivih, sekn, akay) return HTTP 400 server-side and are skipped during indexing; this is a StatFin quirk, not a bug here. The index records them under skipped.
  • Data licensed under CC BY 4.0 by Statistics Finland.

License

MIT

Source: README.md at commit 4dbfb9d

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.