Skip to main content
Glama
synjan

mcp-datanorge

by synjan

mcp-datanorge

MCP-server for data.norge.no — Felles datakatalog, Norges nasjonale oversikt over offentlige datasett, API-er, begreper, informasjonsmodeller, tjenester og hendelser.

Serveren gir en agent seks verktøy: fra spørsmål i naturlig språk, via presist søk og SPARQL, til nedlasting av de faktiske dataene hos utgiveren.

Alle API-ene er åpne og krever ingen autentisering.

Verktøy

Verktøy

Hva det gjør

ask

KI-søk. Spørsmål på norsk inn, rangerte ressurser ut, hver med begrunnelse. Start her.

search

Fulltekstsøk med filtre, paginering og aggregeringer over utgiver, tema, format og lisens.

get_resource

Full metadata for én ressurs, inkludert distribusjonene som peker på dataene. Også som RDF.

sparql

SPARQL 1.1 mot hele DCAT-grafen. For tellinger, gruppering og kryssoppslag.

fetch_data

Laster ned en distribusjon. Tolker CSV og JSON, eller lagrer til fil.

find_organization

Slår opp orgPath for en utgiver, på navn eller organisasjonsnummer. Det er filterverdien search trenger.

Katalogen inneholder metadata. Selve dataene ligger hos utgiverne, bak downloadURL og accessURL i distribusjonene — det er der fetch_data kommer inn.

Related MCP server: CKAN MCP Server

Typisk arbeidsflyt

ask "nedbør og temperatur målt av værstasjoner"
  → get_resource id=<treff> type=datasets
  → fetch_data url=<downloadURL>

Kommandolinje

De samme kildene finnes som kommandoen datanorge, som importerer modulene direkte uten JSON-RPC-omvei.

datanorge sporr "hvor er det målestasjoner for vannkvalitet"   # KI-søk, ~4 s
datanorge sok luftkvalitet --apen --format "MEDIA_TYPE text/csv"
datanorge vis ad993b20-3998-3ac6-8077-d6c4d2494b4c             # metadata + distribusjoner
datanorge org 971040238                                        # navn eller orgnr
datanorge hent https://data.mattilsynet.no/vannverk/vannforsyningssystem.csv --rader 3
datanorge sparql 'PREFIX dcat: <http://www.w3.org/ns/dcat#> SELECT (COUNT(?d) AS ?n) WHERE { ?d a dcat:Dataset }'
datanorge status

--json gir rå JSON på stdout. datanorge hjelp viser alt.

Merk hastighetsgrensen. Strupingen i http.js gjelder innenfor én kjøring, og hver kommando starter med blanke ark. En løkke over mange sporr- eller sok-kall i shellet kan derfor gå på en HTTP 429 der MCP-serveren ville køet. Bruk --limit og paginering i stedet for mange kall.

Installer wrapperen:

ln -sf ~/Work/mcp-datanorge/src/cli.js ~/.local/bin/datanorge

Installasjon

npm install

Registrer serveren i Claude Code:

claude mcp add --scope user datanorge -- node ~/Work/mcp-datanorge/src/index.js

Serveren snakker stdio og har ingen konfigurasjon utover én valgfri miljøvariabel:

  • DATANORGE_ENV=demo peker alt mot Digdirs demomiljø i stedet for produksjon.

Endepunkter

Tjeneste

Produksjon

Grense

Søk

search.api.fellesdatakatalog.digdir.no

10/min

KI-søk

aisearch.api.fellesdatakatalog.digdir.no

10/min

SPARQL

sparql.fellesdatakatalog.digdir.no

Ressurstjeneste

resource.api.fellesdatakatalog.digdir.no

5/s

Organisasjoner

organization-catalog.fellesdatakatalog.digdir.no

Serveren struper seg selv litt under Digdirs oppgitte grenser og køer kall i stedet for å gå på en HTTP 429. Et treigt svar fra search eller ask kan altså bety at den venter på kvote. Ved 429 eller 5xx prøver den én gang til.

Digdir merker søk- og KI-søk-API-ene som interne, og forbeholder seg retten til å endre dem. SPARQL og ressurstjenesten er de stabile inngangene.

Sikkerhet

Distribusjons-URL-er kommer fra tredjeparter som har fått katalogen sin høstet. fetch_data tillater derfor bare http/https mot offentlige adresser, og avviser loopback, private nett, link-local og CGNAT. Et høstet datasett skal ikke kunne brukes til å nå tjenester på maskinen eller i det lokale nettet.

Utvikling

npm test            # enhetstester, ingen nettverk
npm start           # kjør serveren på stdio

test/harness.js starter serveren som subprosess og kobler til med MCP-klienten, for manuell utprøving mot de ekte API-ene.

Dokumentasjon hos Digdir

Lisens

MIT

Available Tools

6 tools
askKI-søk i katalogenA

Still et spørsmål i naturlig språk og få rangerte ressurser tilbake, hver med en begrunnelse for hvorfor den passer. Start her når du ikke vet hva datasettet heter. Krever ingen fagtermer. Spørringen må være på 3–255 tegn, helst norsk. Bruker rundt 4 sekunder. Søker i datasett med mindre du setter type.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNoRessurstype å søke i. ALL søker på tvers av alle typer.datasets
queryYesSpørsmål på norsk, f.eks. "Hvilke områder i Norge er vernet?"

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It discloses expected latency ('Bruker rundt 4 sekunder'), default scope ('Søker i datasett med mindre du setter type'), query constraints, and the ranked-with-justification return style. This is substantial context beyond raw functionality.

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 tight sentences, each earning its place: function, use case, constraints, latency, and default scope. Front-loaded with the core action and outcome. No filler or redundancy.

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 tool with no output schema, the description covers inputs, defaults, behavior, latency, and intended scenario. It could mention result-count or error behavior, but nothing critical is missing for an agent to invoke it correctly.

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%, so the schema already documents both parameters well. The description's mention of '3–255 tegn' and 'helst norsk' largely restates schema constraints and query description. It adds the default-scope clarification, but baseline 3 is appropriate because the schema does the heavy lifting.

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 ('Still et spørsmål i naturlig språk') and a concrete outcome ('få rangerte ressurser tilbake, hver med en begrunnelse'), clearly distinguishing it from a generic search. It also offers an explicit use case ('Start her når du ikke vet hva datasettet heter') that separates it from sibling tools like get_resource or search.

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 tells the agent when to use this tool ('når du ikke vet hva datasettet heter') and why it fits over technical alternatives ('Krever ingen fagtermer'). It does not enumerate alternatives or say 'don't use when X', but the guidance is concrete enough to route a call correctly.

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

fetch_dataHent selve dataene fra en distribusjonA

Last ned en distribusjons-URL fra et datasett (downloadURL eller accessURL) og se på innholdet. CSV blir tolket til kolonner og eksempelrader, JSON blir oppsummert som struktur pluss et utdrag, annen tekst vises som den er. Sett save_path for å strømme innholdet til fil i stedet — bruk det for store eller binære filer, og analyser fila etterpå med vanlige verktøy. Bare offentlige http/https-adresser er tillatt.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesDistribusjons-URL fra get_resource.
max_rowsNoAntall CSV-rader i utdraget.
max_bytesNoHvor mye som leses ved forhåndsvisning.
save_pathNoAbsolutt filsti å lagre innholdet til.

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does so well: it explains that CSV is parsed into columns and sample rows, JSON is summarized as structure plus excerpt, other text is shown as-is, and save_path streams content to a file. It also discloses the public http/https restriction, which is important operational context.

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 and well-structured: first the core action, then the content-format behaviors, then the save_path streaming guidance and URL restriction. Each sentence adds distinct value with no repetition or filler.

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 tool with no output schema and no annotations, the description explains the main behavior, the supported content types, how to avoid previewing large/binary files, and URL restrictions. Minor gaps remain, such as possible file overwrite behavior with save_path and handling of download errors, but the essential usage context is present.

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%, so the baseline is 3, but the description adds meaningful semantics beyond the schema: it explains the purpose of save_path for large/binary files and adds the restriction that only public http/https URLs are allowed. This helps the agent choose and set parameters more correctly.

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 the tool downloads a distribution URL (downloadURL or accessURL) and inspects its content, with distinct handling for CSV, JSON, and other text. It is specific about the resource and action, though it does not explicitly differentiate from siblings like get_resource in the prose.

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

Usage Guidelines3/5

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

The description gives practical usage guidance for save_path, recommending it for large or binary files and subsequent analysis with normal tools. However, it does not explicitly say when to choose this tool over sibling tools like get_resource, search, or ask, leaving the comparison mostly implicit.

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

find_organizationSlå opp utgiverA

Finn organisasjonsnummer og orgPath for en utgiver, ut fra navn eller organisasjonsnummer. orgPath er verdien du trenger for å filtrere søk på utgiver, f.eks. "/KOMMUNE/964965226" for én kommune eller "/KOMMUNE" for alle kommuner. Går også andre veien: gi et orgnr fra en orgPath du så i en aggregering, og få vite hvem det er.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesNavn eller del av navn ("Kartverket"), eller et niffret organisasjonsnummer.
limitNo

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It discloses the bidirectional lookup behavior and explains the hierarchical meaning of orgPath with concrete examples. It does not describe result multiplicity or limit behavior, but the core lookup behavior is transparent.

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 three compact, front-loaded sentences: core purpose first, then a concrete orgPath example, then the reverse lookup case. Every sentence earns its place with useful, non-redundant information.

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?

Given no output schema and no annotations, the description still covers the essential inputs, the returned orgPath concept, and both lookup directions with an example. It lacks explicit response shape and limit details, but it is actionable enough for an agent to invoke correctly in most cases.

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?

The schema describes `name` but not `limit`, so schema coverage is 50%. The description adds useful meaning to `name` by showing it can be a full/partial name or an organization number and by linking it to orgPath, but it does not explain the `limit` parameter or behavior when multiple organizations match.

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 opens with a specific verb and resource: 'Finn organisasjonsnummer og orgPath for en utgiver'. It clearly distinguishes this from generic siblings like search or get_resource by focusing on publisher identifier lookup and the orgPath filter value.

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 gives explicit contexts: use it to obtain the orgPath needed for publisher-filtered searches, and use it in reverse to resolve organization numbers found in aggregations. It does not name alternatives or explicitly state when not to use it, so it falls just short of a 5.

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

get_resourceHent full metadata for én ressursA

Hent alt katalogen vet om én ressurs, gitt FDK-id fra et søketreff, eller RDF-URI. For datasett er det viktigste distributions: der ligger downloadURL og accessURL som peker på de faktiske dataene — mat dem videre til fetch_data. Sett format til turtle, jsonld eller rdfxml for å få RDF-grafen i stedet.

ParametersJSON Schema
NameRequiredDescriptionDefault
idNoFDK-id fra et søketreff. Krever at type er satt.
uriNoRDF-URI, f.eks. https://data.norge.no/node/3098.
fullNoReturner rå, komplett JSON i stedet for det oppsummerte utdraget.
typeNoRessurstype. Påkrevd ved oppslag på id, valgfri ved oppslag på uri.
formatNojson

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of explaining behavior. It discloses that the tool returns catalog metadata, that datasets expose distributions with downloadURL/accessURL, and that setting format to turtle/jsonld/rdfxml changes the response to an RDF graph. This goes beyond the schema by revealing output structure and interpretation.

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 focused sentences, each earning its place: the first defines scope and lookup keys, the second explains the most important output field and the downstream action, and the third describes the format switch. The most important operational detail is front-loaded.

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 tool with five parameters, no output schema, and no annotations, the description provides a strong practical context: where the id comes from, what the key dataset field contains, how to continue to fetch_data, and how to request alternate formats. The main gap is that the `full` flag and the type-required constraint are left for the schema rather than integrated into the usage narrative.

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 high (80%), so the baseline is 3, but the description adds meaningful semantics beyond property names: it explains the id/uri distinction, highlights distributions as the key dataset field, and explains the functional effect of the format parameter. It does not cover the `full` parameter explicitly, but that is already described 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 uses a specific retrieval verb ('Hent') and names the exact resource scope: everything the catalog knows about one resource, addressed by FDK-id or RDF-URI. It clearly differentiates from sibling tools by positioning itself as the metadata lookup step between search and fetch_data.

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 gives concrete guidance on when to use the tool: after a search hit, with an FDK-id, or directly with an RDF-URI. It also explains the downstream workflow—extract downloadURL/accessURL from distributions and pass them to fetch_data—and when to switch format for an RDF graph. It does not explicitly list when not to use it relative to find_organization or sparql, but the intended flow is clear.

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

sparqlSPARQL mot katalog-grafenA

Kjør en SPARQL 1.1-spørring mot hele den høstede DCAT-grafen. Bruk denne når søket ikke rekker til: tellinger, gruppering per utgiver, kryssoppslag mellom ressurstyper, eller egenskaper som ikke er indeksert i søket.

Ressurstyper i grafen: dcat:Dataset, dcat:DataService, skos:Concept, modelldcatno:InformationModel (https://data.norge.no/vocabulary/modelldcatno#), cpsv:PublicService, cpsvno:Service, cv:Event, cv:LifeEvent, cv:BusinessEvent. Vanlige prefikser: dcat: http://www.w3.org/ns/dcat#, dct: http://purl.org/dc/terms/, foaf: http://xmlns.com/foaf/0.1/, skos: http://www.w3.org/2004/02/skos/core#.

SELECT og ASK gir rader tilbake, CONSTRUCT og DESCRIBE gir Turtle. Grafen er stor — sett alltid LIMIT, og bruk COUNT når du bare skal telle.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesFullstendig SPARQL-spørring, prefikser inkludert.
maxRowsNoHvor mange rader som returneres.

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure, and it delivers: it states the query scope, lists graph resource types and common prefixes, and explains return formats for SELECT/ASK vs CONSTRUCT/DESCRIBE. It also warns that the graph is large and advises LIMIT and COUNT usage. The claim that ASK returns rows is inaccurate (ASK returns a boolean), which slightly undermines transparency.

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 longer than a minimal one, but every section earns its place: purpose, when to use, graph contents, prefixes, return types, and a size warning. It is front-loaded with the core purpose and then progressively adds supporting detail, with no filler.

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 SPARQL tool with no output schema and no annotations, this description covers the essential context: target graph, supported query forms, return serializations, and querying pitfalls. It could mention timeouts, read-only guarantees, or clarify ASK's boolean return, but overall an agent has enough information to use the tool correctly.

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 the baseline applies; the description adds little about the two parameters themselves. It does provide context that helps construct the query (prefixes, resource types), but it does not elaborate on maxRows behavior beyond what the schema already states.

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 opens with a specific verb and resource: "Kjør en SPARQL 1.1-spørring mot hele den høstede DCAT-grafen." It clearly defines the tool's scope and distinguishes it from the search sibling by stating when SPARQL is needed (counts, grouping, cross-references, unindexed properties). The resource types and prefixes further cement what the tool operates on.

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 explicitly says to use this tool when "søket ikke rekker til" (search is not enough) and gives concrete use cases: counts, grouping by publisher, cross-references, and unindexed properties. It does not mention alternatives such as ask or get_resource, so exclusions are not exhaustive, but the primary routing guidance is clear.

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

TDQS

A4.2/5.0
Disambiguation4/5

ask and search both retrieve resources but are clearly differentiated as natural-language discovery vs. precise filtered full-text search. get_resource, fetch_data, sparql, and find_organization each have a distinct purpose, with only minor overlap between ask and search for simple queries.

Naming Consistency3/5

Four tools use a readable action-oriented style, but the names are not fully consistent: get_resource, fetch_data, and find_organization follow verb_noun, while ask and search are bare verbs and sparql is a protocol name rather than an action. All names are lowercase and readable, but the pattern is mixed.

Tool Count5/5

Six tools is a well-scoped count for a data catalog client. Each tool covers a distinct part of the workflow: discovery, search, metadata retrieval, advanced querying, data download, and publisher lookup.

Completeness5/5

The toolset covers the full journey from finding a resource to retrieving metadata and fetching the underlying data, including SPARQL for advanced queries and organization lookup for filtering. Pagination, empty queries, RDF formats, and file streaming remove common dead ends.

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
    A
    quality
    C
    maintenance
    Enables querying and analyzing over 90,000 public datasets from the Spanish Government Open Data Portal (datos.gob.es) using natural language, with tools for search, filtering, metadata access, and SPARQL queries.
    10
    5
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI assistants to search, explore, and query any CKAN open data portal through natural language, making public datasets accessible without requiring knowledge of the portal's API.
    20
    414
    57
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Connects LLMs to over 2,850 datasets from 13 Catalan and Spanish open data portals, enabling natural language search and real-time queries of public data.
    8
    92
    21
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server to find and fetch Norwegian open government data from data.norge.no. Enables search, metadata retrieval, and data download.
    5
    3
    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-datanorge'

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