Skip to main content
Glama
3121n

@nor-data/statfin-mcp

by 3121n

@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

Tool

What it does

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) locally and returns the most relevant tables with their tabell_id.

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']} for the latest period.

list_emner

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

Related MCP server: pxweb-mcp

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

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

Develop

npm install
npm run build-index   # crawl the StatFin tree → data/tables-index.json (~1–2 min)
npm run dev           # run from source via tsx
npm 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

Available Tools

4 tools
hent_dataA

Fetch actual data values from a StatFin table as JSON-stat2. filtre is a flat object mapping each variable code (from hent_tabell) to a list of selected value codes, e.g. {Alue: ['SSS'], Vuosi: ['2024']}. Omit filtre for the table's default selection. Special selections: {filter:'top', values:['1']} for the latest value(s), {filter:'agg:...'} for groupings. Keep selections small — the API rejects queries over ~100 000 cells.

ParametersJSON Schema
NameRequiredDescriptionDefault
langNoLanguage for titles/labels: 'en' (default), 'fi' or 'sv'. Table codes are language-independent.
filtreNovariabelkode → verdiliste, eller variabelkode → {filter, values} for spesialfiltre som 'top'
tabell_idYesTable id from sok_tabell, e.g. 'vaerak/statfin_vaerak_pxt_11ra.px'

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses the API's size limit rejection behavior. It explains the structure of 'filtre' and special filters. Does not mention idempotency or side effects, but as a read operation, the critical behavioral trait (rejection at size limit) is covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise: four sentences that front-load the purpose, then detail the key parameter with examples, and end with a critical constraint. No wordiness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all parameters, special filter options, and a size constraint. Lacks an explicit description of the JSON-stat2 output structure, but given no output schema, the description is sufficiently complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters, but description adds significant meaning: example of 'filtre' mapping, explanation of 'lang' enum, and source of 'tabell_id'. The description enhances the schema with real usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with 'Fetch actual data values from a StatFin table as JSON-stat2', clearly stating the verb (fetch), resource (data values), and output format. It distinguishes from sibling tools like hent_tabell (metadata) and sok_tabell (search) by focusing on actual data retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance: 'Omit filtre for the table's default selection' and 'Keep selections small — the API rejects queries over ~100 000 cells'. Special selections for 'top' and 'agg' are described. Could explicitly contrast with hent_tabell for metadata-only needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

hent_tabellA

Get metadata for a StatFin table: title, dimensions (variables) and their valid value codes + labels. Use this before hent_data to learn which filter codes are available. Variable codes (e.g. 'Alue', 'Vuosi') are language-independent; pass them verbatim to hent_data.

ParametersJSON Schema
NameRequiredDescriptionDefault
langNoLanguage for titles/labels: 'en' (default), 'fi' or 'sv'. Table codes are language-independent.
tabell_idYesTable id from sok_tabell, e.g. 'vaerak/statfin_vaerak_pxt_11ra.px'

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but description transparently explains the tool's output (metadata, title, dimensions, codes/labels). It does not discuss error handling or rate limits, but for a simple read operation, this is acceptable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact (two sentences), front-loaded with the main purpose, and free of extraneous information. Every sentence contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With only 2 parameters and no output schema, the description covers all necessary aspects: what it returns, how to use it with sibling tools, and the language independence of codes. It is self-contained for a simple metadata retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds a minor contextual note about language-independence of variable codes but does not significantly enhance the schema's parameter explanations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves metadata for a StatFin table, listing specific elements (title, dimensions, value codes/labels). It distinguishes itself from sibling tools by advising use before hent_data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use the tool (before hent_data) and provides guidance on variable codes being language-independent and how to pass them to hent_data.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_emnerA

List the StatFin subject areas (~140 databases, e.g. 'vaerak' = Population structure). Use a subject id to scope sok_tabell, or to browse when a keyword search misses.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoOptional keyword to filter subject titles, e.g. 'population', 'price', 'transport'

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description carries full burden. It discloses approximate size and an example but does not specify return format, ordering, or pagination. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no redundant words. Front-loaded with main purpose. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with one optional parameter and no output schema, the description gives size, example, and usage hint. Missing return format, but overall complete enough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a good description. The tool description adds context about usage but no new parameter semantics beyond schema. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists StatFin subject areas, uses a specific verb 'List', and provides an example and size. It also differentiates from sibling tools by mentioning its use for scoping sok_tabell.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use: to get a subject id for sok_tabell or to browse when a keyword search misses. No explicit when-not-to, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sok_tabellA

Search the Statistics Finland (Tilastokeskus) StatFin database for statistical tables by keyword. PxWeb has no server-side search, so this matches a bundled index of all StatFin tables locally and returns the most relevant ones with their tabell_id (use it in hent_tabell / hent_data). Search English titles.

ParametersJSON Schema
NameRequiredDescriptionDefault
emneNoOptional: restrict to a subject id (from list_emner), e.g. 'vaerak'
limitNoMax hits (default 10)
queryYesSearch term, e.g. 'population', 'unemployment', 'consumer price index', 'building'

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavior. It states it uses a bundled index and returns 'most relevant' results with tabell_id. However, it does not specify what happens on no results, whether results are ranked, or any limitations beyond 'Search English titles.'

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences. The first sentence states the action and scope, the second explains the purpose and usage with sibling tools. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description should detail the return format beyond just tabell_id. It does not mention whether titles, scores, or other fields are returned, leaving the agent uncertain about how to select among results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all three parameters. The description adds context by linking 'emne' to list_emner and clarifying the query parameter's use, but much of the semantic information is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it searches the StatFin database by keyword, returns relevant tables with tabell_id for use in hent_tabell/hent_data. It distinguishes itself from siblings by explicitly naming them as consumers of the output.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the tool's unique local matching approach and that it is the only way to search (PxWeb has no server-side search). It names sibling tools, providing context for when to use this versus others, but lacks explicit 'when not to use' statements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a distinct purpose: listing subjects, searching tables, retrieving metadata, and fetching data. There is no overlap, and descriptions clearly differentiate their roles.

Naming Consistency4/5

Tool names use a Norwegian verb_noun pattern (hent_data, hent_tabell, list_emner, sok_tabell). While verbs vary, the pattern is predictable and descriptive; only minor inconsistency from mixing verbs.

Tool Count5/5

Four tools cover the essential workflow of browsing, searching, inspecting, and retrieving data from StatFin. The scope is focused and each tool has a clear purpose.

Completeness5/5

The set covers the full query lifecycle: discover subjects (list_emner), search tables (sok_tabell), inspect metadata (hent_tabell), and fetch data (hent_data). No obvious gaps for the intended use case.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that enables querying Latvian official statistics from data.stat.gov.lv via PxWeb tables, allowing retrieval of table definitions and data through natural language or direct tool calls.
    14
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Search Statistics Finland's StatFin database (3,000+ tables), inspect table variables, and query clean flattened statistics on population, economy, labour and regions.
    14
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/3121n/nor-data-statfin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server