Skip to main content
Glama

noark5-tg-mcp

Model Context Protocol (MCP) server for interacting with a Noark 5 tjenestegrensesnitt API instance. Tested on the Nikita Noark 5 Core implementation.

Overview

This MCP server provides tools for browsing, searching, and managing archive entities through the Noark 5 REST API. It supports:

  • Authentication via Basic auth (RFC 7617) or OIDC/OAuth2 password grant with auto-renewal

  • HATEOAS navigation - discovers endpoints by walking _links in JSON responses

  • CRUD operations on all major entity types

  • OData search/filter across collections

Related MCP server: Nettskjema MCP Server

Available Tools

Run noark5-tg-mcp --list-tools to see all available tools with descriptions. The list is auto-discovered from the module, so it stays up to date as tools are added or removed.

Quick Examples

# Authenticate and list top-level archives
noark5_set_credentials("http://localhost:8092/noark5v5/", "admin", "password")
noark5_list_arkiv()

# Search for an entity by title
noark5_search_entities("My Archive")

# Navigate HATEOAS links on an entity
noark5_entity_links("https://...entity-url...")

# Filter entities using OData
noark5_filter_entities("https://...collection-url...", "contains(tittel, 'Report')")

# Download a document file (list objekter first, then pick one)
noark5_list_dokumentobjekter("https://...dokumentbeskrivelse-url...")
noark5_download_dokumentobjekt("https://...dokumentobjekt-url...", "/tmp/doc.epub")

See --help for full usage information.

Installation

From source

git clone <repo-url> && cd noark5-tg-mcp
pip install -e .

Debian package

dpkg-buildpackage -us -uc
sudo dpkg -i ../python3-noark5-tg-mcp_0.1.0-1_all.deb

Configuration

Set via environment variables or the noark5_set_credentials tool:

Variable

Default

Description

NOARK5_BASE_URL

http://localhost:8092/noark5v5/

API base URL

NOARK5_AUTH_METHOD

auto

Auth method: basic, oidc, or auto

NOARK5_USERNAME

(empty)

Auth username

NOARK5_PASSWORD

(empty)

Auth password

NOARK5_CLIENT_ID

(empty)

OIDC client_id (optional)

NOARK5_ACCESS_TOKEN

(empty)

Pre-existing Bearer token; skips login flow

Claude Desktop

{
  "mcpServers": {
    "noark5": {
      "command": "noark5-tg-mcp",
      "env": {
        "NOARK5_BASE_URL": "http://localhost:8092/noark5v5/",
        "NOARK5_USERNAME": "your-username",
        "NOARK5_PASSWORD": "your-password"
      }
    }
  }
}

opencode

Add to ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "noark5": {
      "type": "local",
      "command": ["noark5-tg-mcp"],
      "environment": {
        "NOARK5_BASE_URL": "http://localhost:8092/noark5v5/",
        "NOARK5_USERNAME": "your-username",
        "NOARK5_PASSWORD": "your-password"
      },
      "enabled": true
    }
  }
}

Alternatively, skip environment variables and use the noark5_set_credentials tool after connecting.

Testing

python3 -m pytest --cov=noark5_tg_mcp --cov-report=term-missing

License

GPL-2.0-or-later

References

Available Tools

25 tools
noark5_create_arkivA

Create a new top-level archive (fonds).

Args: tittel: The title of the new fonds. attributes: Optional JSON object with additional fields. All optional: beskrivelse, arkivstatus, dokumentmedium, oppbevaringssted, avsluttetDato, avsluttetAv, referanseAvsluttetAv.

Returns details of the created fonds including its URL.

Inputs: tittel (required), attributes. Returns: result

noark5_create_arkivdelA

Create a new arkivdel (series/partition) under a fonds.

Args: arkiv_url: The self-href URL of the parent fonds. tittel: The title of the new arkivdel. attributes: Optional JSON object with additional fields. All optional: beskrivelse, arkivdelstatus, dokumentmedium, oppbevaringssted, avsluttetDato, avsluttetAv, referanseAvsluttetAv, arkivperiodeStartDato, arkivperiodeSluttDato, referanseForloeper, referanseArvtaker.

Returns details of the created arkivdel including its URL.

Inputs: tittel (required), arkiv_url (required), attributes. Returns: result

noark5_create_arkivnotatA

Create a new arkivnotat (record note) under a saksmappe.

Args: saksmappe_url: The self-href URL of the parent saksmappe. tittel: The title of the record note. attributes: Optional JSON object with additional fields. All optional: dokumentetsDato, mottattDato, sendtDato, forfallsdato, offentlighetsvurdertDato, antallVedlegg, utlaantDato, utlaantTil, referanseUtlaantTil. Also inherits from Registrering: arkivertDato, arkivertAv, referanseArkivertAv, registreringsID, offentligTittel, beskrivelse, noekkelord, forfatter, dokumentmedium, oppbevaringssted.

Returns details of the created arkivnotat including its URL.

Inputs: tittel (required), saksmappe_url (required), attributes. Returns: result

noark5_create_arkivskaperA

Create a new arkivskaper (archive creator).

Args: arkivskaper_id: The unique identifier for the archive creator. navn: The name of the archive creator. attributes: Optional JSON object with additional fields. All optional: beskrivelse.

Returns details of the created arkivskaper including its URL.

Inputs: navn (required), arkivskaper_id (required), attributes. Returns: result

noark5_create_dokumentbeskrivelseA

Create a new dokumentbeskrivelse (document description) under a registrering.

Args: registrering_url: The self-href URL of the parent registrering. tittel: The title of the document description. attributes: Optional JSON object with additional fields. All optional: dokumenttype, dokumentstatus, beskrivelse, forfatter, dokumentmedium, oppbevaringssted, tilknyttetRegistreringSom, dokumentnummer, tilknyttetDato, tilknyttetAv, referanseTilknyttetAv, eksternReferanse.

Returns details of the created dokumentbeskrivelse including its URL.

Inputs: tittel (required), registrering_url (required), attributes. Returns: result

noark5_create_journalpostA

Create a new journalpost (registry entry) under a saksmappe.

Args: saksmappe_url: The self-href URL of the parent saksmappe. tittel: The title of the registry entry. attributes: Optional JSON object with additional fields. All optional: journalaar, journalsekvensnummer, journalpostnummer, journalposttype, journalstatus, journaldato, dokumentetsDato, mottattDato, sendtDato, forfallsdato, offentlighetsvurdertDato, antallVedlegg, utlaantDato, utlaantTil, referanseUtlaantTil, journalenhet. Also inherits from Registrering: arkivertDato, arkivertAv, referanseArkivertAv, registreringsID, offentligTittel, beskrivelse, noekkelord, forfatter, dokumentmedium, oppbevaringssted.

Returns details of the created journalpost including its URL.

Inputs: tittel (required), saksmappe_url (required), attributes. Returns: result

noark5_create_klasseA

Create a new klasse (class) under a klassifikasjonssystem or another klasse.

Args: parent_url: The self-href URL of the parent (klassifikasjonssystem or klasse). tittel: The title of the class. attributes: Optional JSON object with additional fields. All optional: klasseID, beskrivelse, noekkelord, avsluttetDato, avsluttetAv, referanseAvsluttetAv.

Returns details of the created klasse including its URL.

Inputs: tittel (required), parent_url (required), attributes. Returns: result

noark5_create_klassifikasjonssystemA

Create a new klassifikasjonssystem (classification system) under an arkivdel.

Args: arkivdel_url: The self-href URL of the parent arkivdel. tittel: The title of the classification system. attributes: Optional JSON object with additional fields. All optional: klassifikasjonstype, beskrivelse, avsluttetDato, avsluttetAv, referanseAvsluttetAv.

Returns details of the created klassifikasjonssystem including its URL.

Inputs: tittel (required), arkivdel_url (required), attributes. Returns: result

noark5_create_mappeA

Create a new mappe (file) under a parent entity.

Args: parent_url: The self-href URL of the parent (arkivdel, klasse, or mappe). tittel: The title of the new file. beskrivelse: Optional description for the file. attributes: Optional JSON object with additional fields. All optional: mappeID, offentligTittel, noekkelord, dokumentmedium, oppbevaringssted, avsluttetDato, avsluttetAv, referanseAvsluttetAv.

Returns details of the created mappe including its URL.

Inputs: tittel (required), parent_url (required), attributes, beskrivelse. Returns: result

noark5_create_registreringA

Create a new registrering (registration) under a mappe.

Args: mappe_url: The self-href URL of the parent mappe. tittel: The title of the new registration. attributes: Optional JSON object with additional fields. All optional: arkivertDato, arkivertAv, referanseArkivertAv, registreringsID, offentligTittel, beskrivelse, noekkelord, forfatter, dokumentmedium, oppbevaringssted.

Returns details of the created registrering including its URL.

Inputs: tittel (required), mappe_url (required), attributes. Returns: result

noark5_create_saksmappeA

Create a new saksmappe (case file) under an arkivdel.

Args: parent_url: The self-href URL of the parent arkivdel. tittel: The title of the case file. saksaar: Optional case year. Set to 0 or omit to let the server auto-assign. attributes: Optional JSON object with additional fields. All optional: sakssekvensnummer, saksdato, administrativEnhet, referanseAdministrativEnhet, saksansvarlig, referanseSaksansvarlig, journalenhet, saksstatus, utlaantDato, utlaantTil, referanseUtlaantTil. Also inherits from Mappe: mappeID, offentligTittel, beskrivelse, noekkelord, dokumentmedium, oppbevaringssted, avsluttetDato, avsluttetAv, referanseAvsluttetAv.

Returns details of the created saksmappe including its URL.

Inputs: tittel (required), parent_url (required), saksaar, attributes. Returns: result

noark5_create_secondary_entityA

Create a secondary [0..]/[1..] entity under a parent (e.g., forfatter, noekkelord).

In N5TG, fields with [0..] or [1..] cardinality are modelled as separate entities. Use this instead of noark5_update_entity to add them.

Common types and their field names: - forfatter: {'forfatter': 'Author Name'} - noekkelord: {'noekkelord': 'keyword'} - merknad: {'tekst': 'note text'} - kryssreferanse: {'kryssreferanse': 'reference'}

Args: parent_url: The self-href URL of the parent entity (e.g., dokumentbeskrivelse). entity_type: The type ('forfatter', 'noekkelord', 'merknad', etc.). field_name: The field name within the secondary entity. field_value: The value for that field.

Returns details of the created secondary entity.

Inputs: field_name (required), parent_url (required), entity_type (required), field_value (required). Returns: result

noark5_delete_entityB

Delete an entity.

Args: entity_url: The self-href URL of the entity to delete.

Returns confirmation or error message.

Inputs: entity_url (required). Returns: result

noark5_download_dokumentobjektA

Download file content from a dokumentobjekt.

Resolves the referanseFil HATEOAS link on the given dokumentobjekt and downloads the binary content to disk (per N5TG chapter 6). Use noark5_list_dokumentobjekter first to find the desired objekt URL.

Args: dokobj_url: The self-href URL of the dokumentobjekt to download. output_path: Optional file path to save the downloaded content. If empty, a temporary file in /tmp/ is created with a random name. Note: Temporary files are NOT removed automatically. It is the user's responsibility to clean them up when no longer needed.

Returns saved file path and metadata.

Inputs: dokobj_url (required), output_path. Returns: result

noark5_filter_entitiesA

List or filter entities from a specific collection URL using OData $filter.

Operates on one collection at a time with full OData expression support. Use this when you have a known collection URL from noark5_entity_links or noark5_list_children and need precise field-level filtering.

Contrast with noark5_search_entities, which searches globally across all entity types using $search (title/text matching) — optionally combined with $filter for additional constraints.

Common filter examples:

  • Filter by MIME type: 'mimetype eq ''application/epub+zip'''

  • Filter by title substring: 'contains(tittel, ''MyArchive'')'

  • Multiple conditions: 'mimetype eq ''application/pdf'' and contains(filnavn, ''report'')'

Args: collection_url: The base URL of the collection endpoint (without {?$filter}). E.g., from noark5_entity_links query template "base" URLs. filter_str: Optional OData $filter expression. Leave empty to list all entities.

Returns formatted list with systemID, title, and URL for each matching entity.

Inputs: collection_url (required), filter_str. Returns: result

noark5_get_entityA

Get full details of an entity by its URL.

Args: entity_url: The self-href URL of the entity to fetch.

Returns the formatted entity with all fields and links.

Inputs: entity_url (required). Returns: result

noark5_list_childrenA

List all children of an entity using HATEOAS discovery.

Without parent_url, lists top-level entities (arkiv/fonds and arkivskaper). With parent_url, automatically discovers available child collections from the entity's links and fetches each type. Mirrors noark5_navigate_up for upward traversal.

Args: parent_url: The self-href URL of the parent entity (omit for top-level listing). filter_str: Optional OData $filter expression applied to each collection.

Returns formatted grouped list of children by type, or error message.

Inputs: filter_str, parent_url. Returns: result

noark5_list_metadataA

List or search metadata posts (katalogpost) within a specific catalog.

Use catalog_name to select the target katalog (e.g., "dokumentmedium", "format"). Omit filter_str to list all entries in small catalogs, or provide an OData filter to narrow down results in large ones (postal codes, countries, etc.).

Common filter examples:

  • Exact code match: 'kode eq ''E'''

  • Title substring: 'contains(kodenavn, ''EPUB'')'

  • Multiple conditions: 'kode eq ''U'' and contains(kodenavn, ''UNKNOWN'')'

Args: catalog_name: Name of the metadata katalog to search in (e.g., "dokumentmedium", "format"). Leave empty to list all available catalogs. filter_str: Optional OData $filter expression applied within the catalog.

Returns formatted list of matching metadata entries with kode and kodenavn.

Inputs: filter_str, catalog_name. Returns: result

noark5_list_parentsA

List all parent entities of an entity using HATEOAS discovery.

Uses N5TG-compliant link detection (per chapter 6 "Identifisere entitetstype" and "Rekursive entitetshierarkier") to find parent links via the entity's relation key and over{xx} relations for recursive hierarchies.

Some entities can have multiple parents simultaneously (e.g., dokumentbeskrivelse linked to several registreringer). Others have only one parent at a time but can be under different parent types (e.g., mappe under arkivdel, klasse, or another mappe). This tool finds all current parents and returns details about each.

Args: entity_url: The self-href URL of the entity to list parents for.

Returns formatted list of parent entities with their titles, types, and URLs.

Inputs: entity_url (required). Returns: result

noark5_search_entitiesA

Global search across all entity types using $search (title match) with optional $filter.

Searches all collections found under arkivstruktur and sakarkiv for entities whose title matches the query. An optional OData $filter expression is ANDed with the $search term to further narrow results.

Use noark5_search_entities when you want to find entities globally by keyword, optionally constrained by a condition (e.g., date range, field value).

Use noark5_filter_entities instead when you need precise filtering on a known collection URL discovered via noark5_entity_links or noark5_list_children. Filter operates on one collection at a time with full OData expression support.

Args: query: The search term to match against entity titles (full-text, case-insensitive). filter_str: Optional OData $filter expression applied in addition to the search term (e.g., 'opprettetDato ge 2026-01-01T00:00:00Z').

Returns list of matching entities with their URLs, titles, and types.

Inputs: query (required), filter_str. Returns: result

noark5_set_credentialsA

Set authentication credentials for the Noark 5 API.

Supports two authentication methods:

  • Basic auth (RFC 7617): username/password encoded as Base64

  • OIDC / OAuth2 password grant: auto-discovers token endpoint via login/oidc/, with automatic token renewal via refresh_token

Args: username: The username for authentication. password: The password for authentication. base_url: Optional API base URL (default from env or http://localhost:8092/noark5v5/). auth_method: Authentication method — "auto" (default), "basic", or "oidc". With "auto", the server's root entity is queried to detect available login endpoints; OIDC is preferred over Basic. client_id: OIDC client identifier (optional, used with oidc method).

Returns confirmation and root entity links on success.

Inputs: password (required), username (required), base_url, client_id, +1 more. Returns: result

noark5_update_entityA

Update one or more fields on an entity using merge PATCH.

Accepts a JSON object mapping field names to new values. Multiple fields can be updated in a single call. Only the specified fields are sent; unchanged fields are preserved server-side (RFC 7396 merge semantics).

NOTE: This does NOT work for [0..] or [1..] sub-resources like 'forfatter' or 'noekkelord', which are modelled as separate entities by the API service. Use noark5_create_secondary_entity instead to add those.

Examples:

  • Update single field: '{"tittel": "New Title"}'

  • Update multiple fields: '{"tittel": "New", "beskrivelse": "Description"}'

  • Structured field: '{"dokumenttype": {"kode": "U"}}'

To move an entity to a new parent, include '_links' in changes. First find the parent link's rel key using noark5_list_parents or noark5_entity_links. Examples:

Args: entity_url: The self-href URL of the entity to update. changes: JSON object mapping field names to new values (e.g., '{"tittel": "New"}').

Returns details of the updated entity.

Inputs: entity_url (required), changes. Returns: result

noark5_upload_fileA

Upload a file to an entity that has a fil relation key.

Any entity whose _links contains the relation key https://rel.arkivverket.no/noark5/v5/api/arkivstruktur/fil/ supports upload. (Use noark5_entity_links or noark5_list_children to discover this.)

Resolves the href of the fil relation from the entity's _links, then POSTs raw binary content to that URL. The server returns JSON containing all created and updated instances — typically a dokumentobjekt with file metadata (filnavn, mimeType, checksum, etc), plus any other entities it created during the upload (e.g., an embedded dokumentbeskrivelse when uploading from a registrering).

Args: entity_url: The self-href URL of any entity with a fil relation key. file_path: Path to a local file to upload. mime_type: MIME type of the uploaded file (default: application/octet-stream).

Returns details of all created/updated entities from the server response.

Inputs: file_path (required), entity_url (required), mime_type. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools map cleanly to a distinct entity type or operation; the create_* family is split by Noark entity, and the search/filter tools are explicitly contrasted. Some overlap remains among the navigation/listing tools (noark5_list_children, noark5_entity_links, noark5_filter_entities, noark5_search_entities), so an agent needs to read descriptions carefully.

    Naming Consistency4/5

    All tools share the noark5_ prefix and snake_case, and the vast majority follow a clear verb_noun pattern (create_, get_, list_, delete_, update_, search_, filter_, upload_, download_). The main deviation is noark5_entity_links, which uses a noun phrase instead of a verb-first name.

    Tool Count3/5

    With 25 tools, the server sits at the upper edge of the borderline/heavy range. The Nooark domain is broad and the tools are individually meaningful, but many typed create operations plus multiple navigation/listing tools make the surface heavier than a typical lean MCP server.

    Completeness4/5

    The toolset covers the main hierarchy (arkiv, arkivdel, klasse, mappe, registrering, dokumentbeskrivelse), plus generic update/delete, search/filter, metadata lookup, and file upload/download. The main gap is that noark5_download_dokumentobjekt refrences a noark5_list_dokumentobjekter tool that is not actually exposed, although this can be worked around with list_children/entity_links.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables interaction with the Norwegian Business Registry (Brønnøysundregistrene) API to search and retrieve detailed information about Norwegian companies, subunits, roles, organization forms, municipalities, and NACE industry codes.
      18
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables direct access to Norwegian company data — lookup, search, roles, subunits, and live updates — through the free Brønnøysund Open Data API.
      5
      45 npm
      2
      MIT