Statfin MCP Server

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

Local serverstdio

What is the Statfin MCP server?

Statfin MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. Statistics Finland (StatFin/PxWeb): search tables, read metadata, fetch JSON-stat2 data.

What you get

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.

What the assistant can call

Once Statfin is connected, these are the calls the assistant has available:

  • sok_tabell — Keyword search across all StatFin tables. PxWeb has no server-side search, so this matches a bundled index (built from the full table tree)
  • hent_tabell — Metadata for a table: title + dimensions (variables) with their valid value codes and labels. Read this first to learn which filter codes exist
  • hent_data — Fetch actual values as JSON-stat2, filtered by a flat {variabelkode: [verdier]} map. Supports special selections like {filter:'top', values:['1']}
  • list_emner — List the ~140 StatFin subject areas (e.g. vaerak = Population structure). Scope a search or browse when a keyword misses

Setting it up

npm on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Statfin's toolset — sok_tabell, hent_tabell, hent_data and 1 more — is a fair guide to whether it matches your workflow. It is maintained by 3121n; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the statfin mcp server does with a few real requests.

Available 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.

How to install the Statfin MCP server

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

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use Statfin to sok tabell.
  • Use Statfin to hent tabell.
  • Use Statfin to hent data.

Frequently asked questions

It connects Statfin to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (sok_tabell, hent_tabell, hent_data, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Statfin directly.