Skip to main content
Glama

mcp-ssb

MCP-server for Statistisk sentralbyrå — 3 898 statistikktabeller indeksert lokalt, tallene hentet live. Ingen autentisering.

Dette er de faktiske norske tallene: prisvekst, boligpriser, lønn, befolkning, arbeidsledighet. Til forskjell fra mcp-datanorge, som bare forteller hvilke datasett som finnes.

Hvorfor lokal indeks

SSBs eget fritekstsøk er ubrukelig. Målt 2. september 2026 mot data.ssb.no/api/pxwebapi/v2-beta/tables?query=:

Søk

SSBs søk

Denne serveren

konsumpris

1 treff — feil tabell

16 treff, Konsumprisindeks øverst

boligprisindeks

0 treff

2 treff, Prisindeks for brukte boliger

arbeidsledighet

11 treff

befolkning

318 treff, FoU-personale øverst

18 treff, befolkningstabeller

Søket er delstreng uten stemming eller rangering. Men hele katalogen kommer i ett kall — 3 898 tabeller, 6 MB — så den indekseres lokalt med FTS5 i stedet.

Related MCP server: SCB MCP Server

Søket er bygget for norsk

Tre ting skiller det fra et vanlig fulltekstsøk:

  • Dagligtale oversettes til SSBs termer. «Boligprisindeks» finnes ikke i noen tabelltittel; SSB kaller den «Prisindeks for brukte boliger». Broen er en kuratert liste i src/synonyms.js, ikke en ordbok — hver oppføring er verifisert mot katalogen.

  • Søket trapper opp. Eksakte ord → prefiks → stammet prefiks → delvise treff. Norsk er et sammensetningsspråk, så «konsumpris» finnes ikke som eget ord i «Konsumprisindeks», og «arbeidsledighet» ikke i «Arbeidsledige». Feltet strategi sier hvilket trinn som slo til.

  • variableNames er indeksert. En tabell er ofte lettest å finne på dimensjonene den har enn på tittelen.

Verktøy

Verktøy

Hva det gjør

search

Finn tabellen. Lokalt, millisekunder.

table

Dimensjonene i en tabell med gyldige koder. Bruk før data.

data

Tall med eksplisitt utvalg per dimensjon.

latest

Siste N perioder uten dimensjonsarbeid — «hva er tallet nå».

status / sync

Indeksens alder; oppfrisking.

Kommandolinje

ssb sok boligpriser                    # oversettes til «brukte boliger prisindeks»
ssb tabell 03013                       # dimensjoner og koder
ssb siste 03013 --perioder 3           # 138.7 · 138.9 · 139.1
ssb data 03013 --velg ContentsCode=Tolvmanedersendring --velg Konsumgrp=TOTAL --perioder 4
ssb status

--json gir rå JSON. ssb hjelp viser alt.

Installasjon

npm install
npm run sync          # bygger indeksen, ~2 s
claude mcp add --scope user ssb -- node ~/Work/mcp-ssb/src/index.js
ln -sf ~/Work/mcp-ssb/src/cli.js ~/.local/bin/ssb

Indeksen havner i ~/.local/share/mcp-ssb/ssb.db. Overstyr med SSB_DB eller XDG_DATA_HOME.

API-ene

To generasjoner brukes med vilje:

  • v2-beta (/api/pxwebapi/v2-beta/tables?pageSize=5000) — hele katalogen i ett kall

  • v0 (/api/v0/no/table/{id}) — metadata med GET, tall med POST og json-stat2

json-stat2 er tett: én flat verdiliste pluss dimensjoner med indeks, der siste dimensjon varierer raskest. Flatingen til rader ligger i flattenJsonStat() og har egne enhetstester på et innbakt eksempel — ingen nettverk.

Dimensjoner merket elimination kan utelates, og da summerer SSB over dem. Det er slik latest får totaltall uten å måtte velge en verdi i hver dimensjon.

Utvikling

npm test              # 14 tester; de mot indeksen hopper over hvis den mangler
npm start             # kjør serveren på stdio

Lisens

MIT for koden. Tallene er SSBs, gjenbrukbare etter deres vilkår.

Available Tools

6 tools
dataHent tall fra en tabellA

Henter tall med et eksplisitt utvalg per dimensjon. Kjør table først for å se gyldige koder.

selections er et objekt med dimensjonskode som nøkkel og en liste koder som verdi. ["*"] betyr alle verdier i den dimensjonen. Dimensjoner du utelater blir summert dersom de kan utelates — ellers avviser SSB spørringen. latestPeriods er en snarvei for de siste N periodene.

ParametersJSON Schema
NameRequiredDescriptionDefault
maxRowsNo
tableIdYes
selectionsNoF.eks. {"ContentsCode":["KpiIndMnd"],"Konsumgrp":["TOTAL"]}
latestPeriodsNoSiste N perioder i stedet for å velge Tid selv.

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description must carry behavioral disclosure. It reveals that omitted dimensions are summed when possible and otherwise cause SSB to reject the query, and that `latestPeriods` is a shortcut. However, it does not describe the output format, error handling, or potential side effects, leaving gaps.

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

Conciseness4/5

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

The description is three sentences: purpose, prerequisite with selection semantics, and a parameter shortcut. Each sentence earns its place and is front-loaded with the main purpose, though it is slightly dense.

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?

The tool has a nested object and 4 parameters; the description explains the complex `selections` and `latestPeriods` well, but omits any mention of the return format or error behavior. With no output schema, this is a notable gap for a data-fetch tool.

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?

The schema covers 50% of parameters; the description compensates by explaining the `selections` object structure, the wildcard `["*"]`, and the omission behavior, plus the meaning of `latestPeriods`. `maxRows` and `tableId` are self-explanatory from schema constraints, so the added value is solid.

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 the tool fetches numbers from a table with explicit per-dimension selections, which is a specific verb and resource. It also references running `table` first to get valid codes, implying a clear distinction from the metadata sibling.

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?

It explicitly instructs to run `table` first to see valid codes, and explains how to use `selections` and `latestPeriods` with concrete semantics. It does not mention alternatives for data fetching beyond `latestPeriods`, but the prerequisite and parameter usage guidance is strong.

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

latestSiste tall fra en tabellA

Snarvei for «hva er tallet nå». Velger første statistikkvariabel, de siste N periodene, og lar SSB summere over dimensjoner som kan utelates. Dimensjoner som må settes får sin første verdi — de listes i svaret som fastsatteDimensjoner, så du ser hva som faktisk ble målt. Trenger du noe annet, bruk table og data.

ParametersJSON Schema
NameRequiredDescriptionDefault
periodsNo
tableIdYes
contentsNoKode for statistikkvariabel, hvis ikke den første.

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are present, so the description carries the burden. It discloses that omitted dimensions are summed, required dimensions get their first value, and the returned `fastsatteDimensjoner` field reveals what was measured. This is substantive, though it does not address errors, limits, or response structure.

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?

Four concise sentences, front-loaded with the shortcut purpose, then behavior, then routing. No redundant or filler wording; every sentence earns its place.

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?

The description is enough to select and invoke the tool: it identifies the table context, parameters, behavior, and the response signal. It lacks a concrete example or output shape, but for a simple shortcut with no output schema this is a minor gap.

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?

With schema coverage at 33%, the description compensates by explaining `periods` as the last N periods and `contents` as the first statistical variable unless another code is given. `tableId` remains implicit but is inferable from the title and the required field's purpose.

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 states a clear purpose: a shortcut for the current number from a table, selecting the first statistical variable and the latest N periods. It explicitly contrasts with the table and data siblings, making the tool's scope identifiable.

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?

It gives explicit usage context: use this when you want the current figure, and if you need anything else, use `table` and `data`. This directly names alternatives and conditions, leaving little to inference.

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

statusStatus for den lokale indeksenA

Når tabellkatalogen sist ble hentet, og hvor mange tabeller den inneholder.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It does reveal the core output: catalog freshness and table count. However, it does not state whether calling status has side effects, whether it can trigger a refresh (especially relevant given the 'sync' sibling), or what format the timestamp/count will take.

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 a single concise sentence that directly states the two key pieces of information the tool returns. There is no filler, repetition, or unnecessary context; every word earns its place.

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 parameterless status tool, the description is nearly complete: it specifies the two outputs an agent would care about. It could add a brief note that it merely reports status and does not invoke a sync, but the title and sibling context make this mostly inferable.

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?

The tool has zero parameters, and the schema confirms this with an empty properties object. No parameter documentation is needed, so the description does not need to compensate for any schema gaps. Baseline 4 is appropriate for a parameterless tool.

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

Purpose4/5

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

The description clearly states what information the tool reports: when the table catalog was last fetched and how many tables it contains. This goes beyond the generic title 'status' and distinguishes it from data/search/sync siblings by indicating it is a status/inspection tool. It lacks an explicit verb, but the reporting function is unambiguous.

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

Usage Guidelines2/5

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

No guidance is given about when to choose this tool over its siblings such as 'sync', 'latest', or 'data'. The description only says what information is shown, not when it should be used or when an alternative would be more appropriate.

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

syncHent tabellkatalogen på nyttA

Laster ned hele SSBs tabellkatalog og bygger indeksen om. Tar noen sekunder. En systemd-timer gjør dette ukentlig.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the full-catalog download, index rebuild, approximate duration, and the weekly automatic trigger. It does not mention potential side effects such as index availability during rebuild, but it is far more transparent than a minimal one-word description.

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 two concise sentences, with the core action front-loaded and the additional timing/automation context placed after. No word is wasted.

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?

For a zero-parameter operation with no output schema, this description is complete enough: it says what happens, how long it takes, and that it is normally handled automatically. An agent can decide to invoke it based on this information.

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?

The tool has zero parameters, so the description does not need to explain parameter meaning. Per the baseline for an empty parameter set, a score of 4 is appropriate.

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 states a specific action ('Laster ned hele SSBs tabellkatalog og bygger indeksen om') with a clear resource and scope. It is distinct from sibling tools like search, table, data, latest, and status, leaving no ambiguity about what sync does.

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?

It implicitly communicates when manual use is needed by noting that a systemd timer runs the same task weekly. This gives useful context about the tool's role, though it does not explicitly name alternatives or say 'use this only when you need immediate freshness'.

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

tableVis dimensjonene i en tabellA

Hvilke dimensjoner en tabell har, og hvilke koder hver av dem godtar. Bruk dette før data — hver tabell har sitt eget kodeverk, og uten å se det blir spørringen gjetning.

Dimensjoner merket kanUtelates summeres av SSB hvis du hopper over dem; det er slik man får totaltall i stedet for en oppdeling.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableIdYesTabellnummer fra et søketreff, f.eks. 03013.
maxValuesNoHvor mange verdier som vises per dimensjon.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden. It adds non-obvious domain behavior: dimensions marked `kanUtelates` are summed by SSB if omitted, giving totals instead of a breakdown, and it warns that code sets differ per table. These are useful behavioral hints beyond the schema. It does not explicitly address side effects, but the tool is clearly ametadata lookup, so the gap is minor.

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?

Three compact, purposeful sentences. The purpose is front-loaded, followed by explicit usage guidance and then a key domain caveat. Every sentence contributes value; there is no fluff or repetition of schema content.

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 two-parameter metadata retrieval tool with no output schema and no annotations, the description adequately covers purpose, when to use it, and a subtle behavioral detail about totals. It doesn't explicitly describe the exact response format, but the statement of what it returns ('dimensions... and codes') is sufficiently clear for correct invocation.

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%, with meaningful descriptions for both `tableId` and `maxValues`. The tool description does not add new parameter-level meaning beyond the schema, so the baseline of 3 applies. The mention of 'koder' loosely ties to `tableId` but does not enrich it further.

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 what the tool does: it shows which dimensions a table has and which codes each dimension accepts. The title 'Vis dimensjonene i en tabell' reinforces the action, and the content distinguishes it from the `data` sibling by framing it as a pre-query inspection step.

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?

The description explicitly instructs 'Bruk dette før `data`', giving a clear when-to-use rule supported by the rationale that each table has its own code set, without which the query becomes guesswork. This points directly to the relevant sibling and explains why the tool is needed first.

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

TDQS

A4.1/5.0
Disambiguation5/5

The six tools map to distinct stages in the workflow: discovery (search), schema lookup (table), explicit queries (data), quick latest values (latest), and catalog maintenance/status (status/sync). Even though data and latest both return numbers, latest is clearly framed as a convenience shortcut, so an agent should not confuse them.

Naming Consistency4/5

All names are lowercase single words, so the style is uniform and there is no case or convention mixing. The semantic pattern is less regular, however: some are verbs (search, sync), some are nouns (table, data, status), and latest is an adjective, and none follow a verb_noun shape.

Tool Count5/5

Six tools is appropriate for a read-only statistics API: discovery, metadata, query, convenience access, and catalog health/maintenance are each represented without redundancy. The count feels well-scoped for the server's purpose.

Completeness4/5

The core workflow is complete: search finds a table, table exposes dimensions and codes, data fetches specific selections, and latest covers a common shortcut; status and sync handle catalog freshness. The only minor gap is a lack of any browse/list-all-tables capability, but search is clearly designed to cover discovery.

Maintenance

ActivityMaintained
ResponsivenessNo issues

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
    Enables natural language access to Denmark's Statistics API (Danmarks Statistik), allowing users to query and analyze Danish statistical data without coding knowledge through AI-powered interactions.
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables LLMs to search, access, and retrieve official Swedish statistics from Statistics Sweden (SCB), providing access to 1,200+ tables covering demographics, economy, environment, labor market, and education with 75+ years of historical data.
    7
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to query Norges Bank's open data API for exchange rates, policy rates, government securities, money market data, bank liquidity, and regional network survey data.
    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/synjan/mcp-ssb'

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