Skip to main content
Glama
Norway Legislation MCP Server

Norway Legislation MCP Server

by cyanheads

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework


Overview

Search Norwegian laws and regulations by title or body text, resolve citations to specific published records, read provisions, and follow the source evidence for regulations and amendments. The server builds a local SQLite mirror of Lovdata’s public bulk data. It needs no Lovdata account or API key.

Tools

Tool

Description

norlaw_lookup_citation

Resolve up to 25 citations to records and verify provision addresses where possible

norlaw_get_document

Read document metadata and an outline, or select a provision, chapter, or sibling range

norlaw_get_provision

Read up to 10 provisions from one record, with source links, change notes, and available variants

norlaw_search_documents

Find documents by title and metadata filters

norlaw_search_text

Search indexed body text and get ranked excerpts with source locators

norlaw_find_regulations

Find regulations based on an Act, directly or through one delegation decision

norlaw_list_amendments

Trace amending acts using provision notes and structured gazette evidence

norlaw_list_reference

Look up document kinds, vocabulary, addresses, status rules, coverage, freshness, and attribution

Related MCP server: @pipeworx/norway-law

Capability reference

  • Resolve and read. Start with norlaw_lookup_citation for a Lovdata URL, identifier, journal number, short title, or Norwegian legal citation. It usually prefers the consolidated edition, while an announcement identifier selects its gazette record. Explicit edition or language requests keep that scope. Use the returned recordId and the full locator to read the exact source node. A sentence address without explicit source markup can be returned as unverified.

  • Browse an instrument. norlaw_get_document defaults to the outline. A selected part or same-group sibling range returns complete Markdown up to 64 KiB. Larger selections return an outline with exact locators. Use norlaw_get_provision with the returned recordId and full locator for an oversized node. If a source build changes, retrieve a fresh outline or hit before reusing its locator.

  • Search titles or text. norlaw_search_documents ANDs normalized title terms across titles, short titles, and abbreviations. It excludes amending acts by default and sorts by document date, newest first. norlaw_search_text accepts words, quoted phrases, suffix *, grouping, and uppercase AND, OR, and binary NOT. Hits are paged globally by rank and grouped by document in the response. Both searches default to consolidated records with status current (in force or partly pending). Searching only local_regulation defaults to promulgated records. Promulgated searches default to any status.

  • Follow authority and amendments. norlaw_find_regulations defaults to current consolidated results and can include local announcements with includeLocal: true. Paths cite the records that supplied each link. norlaw_list_amendments includes pending acts by default and excludes withdrawn acts by default. Section filters use source evidence. Gazette history starts in 2001, and the availability of structured amendment targets varies by act.

  • Page and check coverage. The four list/search tools that take limit and offset default to 25 results at offset 0. Full-text search applies up to 200 hits per page. Document search, regulations, and amendments apply up to 500 results per page. Each page reports its total, requested and applied limits, and any nextOffset. Use norlaw_list_reference with topic: "coverage" or "freshness" to see which package builds the server can query.

Features

  • Two editions. Consolidated records are Lovdata’s editorial text at the indexed build. Promulgated records are Norsk Lovtidend announcements, including published corrections and withdrawals where available. Gazette commencement evidence describes the announcement. Use the consolidated edition for current applicability, and check the reported source date and status basis.

  • Local reads. After import, tool calls query SQLite without contacting Lovdata. Coverage includes consolidated laws and central regulations, plus Gazette department I and II announcements from 2001. Source languages are preserved.

  • Built on @cyanheads/mcp-ts-core for MCP transport, validation, and observability.

Getting started

Use Node.js 24 or later for npm and Claude Desktop. Source builds require Bun 1.4.4 or later.

MCP client configuration

Use this entry for clients that accept an mcpServers map, or use the Cursor or VS Code install link above.

{
  "mcpServers": {
    "norway-legislation-mcp-server": {
      "command": "npx",
      "args": ["-y", "@cyanheads/norway-legislation-mcp-server"]
    }
  }
}

Claude Desktop

Download and open the Desktop extension. The extension’s Mirror directory setting is optional.

First sync

The server starts accepting MCP connections while a background worker downloads and indexes the packages. First import transfers about 125 MB compressed and parses about 1.3 GB of markup. A December 2026 build containing 67,919 source records used 10.7 GB for SQLite and its full-text index. Allow additional space for downloads, the write-ahead log, and overlapping generations during a refresh.

Use norlaw_list_reference with topic: "freshness" to check progress. Queries return retryable mirror_not_ready when required builds are unavailable. Some searches can return partial results with the missing coverage called out. The worker checks Lovdata on startup and every four hours after a successful sync. If a refresh fails, it keeps the last successful build and reports stale coverage and freshness information.

Configuration

Variable

Default

Purpose

NORLAW_MIRROR_DIR

OS cache directory

Writable local directory for the SQLite mirror. Use an absolute path in client configuration.

MCP_TRANSPORT_TYPE

stdio

Set to http for Streamable HTTP.

MCP_HTTP_HOST

127.0.0.1

Listener address for HTTP. The Docker image listens on all container interfaces.

MCP_HTTP_PORT

3010

Listener port for HTTP.

MCP_HTTP_ENDPOINT_PATH

/mcp

Streamable HTTP endpoint path.

MCP_AUTH_MODE

none

HTTP authentication mode. See .env.example for additional settings.

MCP_LOG_LEVEL

info

Minimum log level.

MCP_USAGE_REPORTING

false

Opt in to anonymous framework usage reporting.

The default cache path is ~/Library/Caches/norway-legislation-mcp-server on macOS, %LOCALAPPDATA%/norway-legislation-mcp-server on Windows (under ~/AppData/Local if unset), and under XDG_CACHE_HOME or ~/.cache on Linux. Keep the database and its accompanying files on a local filesystem. Set NORLAW_MIRROR_DIR in a manual client’s env or use the plugin setting where available. The Codex plugin inherits the variable from the environment that launches Codex.

Running the server

npm

npx -y @cyanheads/norway-legislation-mcp-server
MCP_TRANSPORT_TYPE=http npx -y @cyanheads/norway-legislation-mcp-server

Streamable HTTP accepts MCP connections at http://127.0.0.1:3010/mcp. A successful /healthz response confirms the process is serving HTTP. For dataset readiness, use the freshness tool.

Source

git clone https://github.com/cyanheads/norway-legislation-mcp-server.git
cd norway-legislation-mcp-server
bun install
bun run build
bun run dist/index.js

Use node dist/index.js to run the compiled build with Node. Set MCP_TRANSPORT_TYPE=http before either invocation for Streamable HTTP.

Docker

docker run --rm -p 127.0.0.1:3010:3010 \
  -v norlaw-mirror:/usr/src/app/.mirror \
  ghcr.io/cyanheads/norway-legislation-mcp-server:latest

The image sets NORLAW_MIRROR_DIR=/usr/src/app/.mirror. Mount a volume there to retain the index when replacing the container. If mounting a host directory, give the container’s bun user write access.

Development guide

Run bun run devcheck and bun run test after changes. Tool definitions are in src/mcp-server/tools/definitions/, SQLite and synchronization are in src/mirror/, and source parsing and normalization are in src/domain/. See the project tree for the rest of the layout.

Contributing

File bugs and feature requests in GitHub Issues. See CONTRIBUTING.md for development and contribution guidelines.

License and data attribution

The server code is licensed under Apache-2.0.

Contains data under the Norwegian licence for Open Government data (NLOD) distributed by Lovdata. The data is licensed under NLOD 2.0. The server converts source markup to Markdown and derives status and amendment fields. Results carry source attribution and package coverage.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables fast local search and retrieval of Norwegian laws and central regulations, including full-text paragraph lookup, document metadata, and supplementary sources like ECHR case law, legislative preparatory works, and ombudsman statements.
      12
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables finding Norway's consolidated current acts by title, short title, abbreviation or law number, then reading a whole act or a single section complete with its position in the act, amendment history with in-force dates, and a ready-made citation. Answers come from a keyless stored copy of Lovdata's open-data release, carry the NLOD licence and attribution, and return explicit miss reasons instead of empty results.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables verbatim lookup and full-text search across current Norwegian laws and central regulations from Lovdata’s open data, with paragraph retrieval, cross-references, change history, upcoming amendments, and separately flagged local regulations.
      5
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables searching Brazilian federal norms and STF constitutional-review decisions, resolving citations to Senado IDs, reading published or consolidated texts and specific articles, and tracing amendments by act or provision. Runs over STDIO or Streamable HTTP with an optional local index mirror for cross-year search.
      Apache 2.0