Skip to main content
Glama
denmark-legislation-mcp-server

denmark-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

Danish legislation, administrative decisions, Folketing documents, and Ombudsman opinions from Retsinformation. Search in Danish, resolve citations to European Legislation Identifiers (ELIs), read the source text, and follow published changes. Runs over stdio or Streamable HTTP and uses public Retsinformation endpoints without an API key.

Tools

Tool

Description

dklaw_search_documents

Find documents by Danish terms, exact popular title, ministry, type, CELEX, or date

dklaw_get_provisions

Read provisions, chapters, annexes, or document text

dklaw_get_document

Get document metadata, links, and an outline with text selectors

dklaw_list_versions

Trace a law's consolidations or an executive order's amendments

dklaw_get_relations

Follow amendment, implementation, decision, and other source links

dklaw_lookup_citation

Resolve citations, ELIs, accession numbers, and exact popular titles

dklaw_track_changes

List publications or source-reported changes over a date window

dklaw_list_reference

Look up filters, accepted syntax, and source coverage

Related MCP server: dk-eli-mcp

Capability reference

dklaw_search_documents tool

  • Combine optional query, popular_title, ministry, document_types, classification, celex, year_from, year_to, and published_from filters. status: "current" is the default. Use "all" to include historical records. Sort by "relevance" (default) or "newest".

  • Pages start at page: 0 and return total, applied_filters, and next_page. The default limit is 25, capped at 100. Narrow broad queries by filters or dates to stay within the upstream 10,000-row search window.

  • When a search misses, try Danish terms, relax filters, or pass a known citation to dklaw_lookup_citation.


dklaw_get_provisions tool

  • Requires document. Defaults to version: "current" to follow verified consolidation links. Use "as_given" for the cited revision.

  • Send provisions such as ["§ 4, stk. 2, nr. 1", "Bilag 1"] to read the first 10 addresses. Resubmit remaining_provisions with the same document and version. Large or ambiguous matches return kind: "outline" with selectors. Legacy HTML can return kind: "legacy_text" for the body when exact addressing is unavailable.

  • Omit provisions to read a selector or start at "body". The default limit is 12,000 Unicode code points and callers can request a larger positive limit. Continue with the returned selector, canonical ELI, version: "as_given", and page.next_offset as offset. On selector_changed, refresh the outline or restart at the first body page.


dklaw_get_document tool

  • Requires document and defaults to version: "as_given". Use "current" to follow verified consolidation links. Set include: ["bill_history"] for available parliamentary history and the publisher's historical cause.

  • Returns metadata, source format links, pending amendments, and an outline with selectors for provisions, sections, annexes, commencement blocks, and the body. If source metadata is available but the outline is unavailable, follow its guidance or open a source link.


dklaw_list_versions tool

  • Requires document. Lists a law's source timeline newest first or an executive order's direct amendments. An amending act can return unsupported_document_type with targets whose timelines can be requested.

  • Continue with next_offset (default limit 25, capped at 100). Read coverage for timeline gaps or partial ELI coverage. If fallback discovery is in progress, repeat the call with the same document.


dklaw_get_relations tool

  • Requires document and follows links from that revision. Omit relation for all groups, or select a group such as changed_by, consolidates, subordinate, or commenced_by. status: "all" includes historical subordinate rules and available unclassified basis_for links.

  • Returns source-backed relations with coverage and next_offset (default limit 25, capped at 100). Use relation: "basis_for" with status: "all" when the source lacks a more specific group.


dklaw_lookup_citation tool

  • Send a nonempty citations array of Retsinformation ELI paths or URLs, accessions, exact popular titles, or dated citations such as lov nr. 502 af 23. maj 2018 § 1. Resolves the first 25 in order. Resubmit remaining_citations to continue.

  • Each row resolves the cited revision, with a separately identified current_consolidation and a normalized provision when available. Per-item misses report reason and guidance. An ambiguous title also returns candidates.


dklaw_track_changes tool

  • Requires inclusive Copenhagen dates from and to in YYYY-MM-DD. Both modes accept medium and use next_offset (default limit 25, capped at 100). Default kind: "published" uses publication dates and accepts document_types. If counts drift and the tool returns window_changed, restart at offset zero.

  • kind: "changed" reports the latest event per document in the rolling Atom feed and accepts reasons. By default it includes content changes, combined metadata and content changes, and removals. Daily harvest fallback can provide partial coverage and reports coverage.date_basis: "harvest_window_end".

  • Read coverage before interpreting total. Use "published" for older publication windows beyond the change feed. Publication paging narrows the upstream 10,000-row window by date and surfaces the source limit if a single day's rows still exceed it.


dklaw_list_reference tool

  • Requires one topic from document_types, ministries, media, identifiers, provisions, status, change_reasons, or coverage. Runs offline.

  • Returns entries and a source link. Use it for accepted filter values, citation or address syntax, historical status codes, and corpus and feed coverage. Danish court case law is covered separately by Domsdatabasen.

Features

Built on @cyanheads/mcp-ts-core with stdio and Streamable HTTP, configurable HTTP auth, structured logging, and optional OpenTelemetry.

  • current_text reflects the publisher's current or historical flag. Read the separate in_force metadata where available, and check commencement clauses and pending_amendments to assess applicability.

  • LexDania XML provides structured text and selectors. Earlier records can be available as legacy HTML, with source links preserved.

  • Source URLs, coverage notes, per-item guidance, and explicit continuation fields support citation, recovery, and paging.

Kilde: Retsinformation (Civilstyrelsen). This is an independent integration. Civilstyrelsen permits commercial and noncommercial reuse of open data, including copying and adaptation. Keep protected contributions such as photographs with the relevant regulation when reproducing them, and keep requests proportionate to the service. Civilstyrelsen open data terms

Getting started

Add it to Claude Code with Node.js 24 or later installed.

claude mcp add denmark-legislation-mcp-server -- npx -y @cyanheads/denmark-legislation-mcp-server

For other clients, add this to your MCP configuration file.

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

Configuration

Variable

Default

Description

MCP_TRANSPORT_TYPE

stdio

Set to http for Streamable HTTP

MCP_HTTP_HOST

127.0.0.1

HTTP bind address

MCP_HTTP_PORT

3010

HTTP port

MCP_HTTP_ENDPOINT_PATH

/mcp

HTTP MCP endpoint

MCP_SESSION_MODE

stateless

HTTP session mode

MCP_AUTH_MODE

none

HTTP authentication mode (none, jwt, or oauth)

MCP_LOG_LEVEL

info

Minimum log level

MCP_USAGE_REPORTING

false

Opt in to daily and shutdown tool-call summaries

See .env.example for additional framework settings.

Running the server

Start a local Streamable HTTP endpoint at http://127.0.0.1:3010/mcp.

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

Run the container with the MCP port published to loopback.

docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/denmark-legislation-mcp-server:0.1.1

Peer containers on the same Docker network can reach the server's HTTP port.

Build from source with Bun 1.4.4 or later and Node.js 24 or later.

git clone https://github.com/cyanheads/denmark-legislation-mcp-server.git
cd denmark-legislation-mcp-server
bun install
bun run build
bun run start:stdio

Project structure

Path

Purpose

src/index.ts

Server entry point and tool registration

src/mcp-server/tools/definitions/

Tool schemas and handlers

src/services/

Retsinformation clients, document parsing, version graphs, and reference tables

tests/

Tool and source-adapter tests

Development guide

See CLAUDE.md for server conventions and docs/tree.md for the complete layout. Run bun run devcheck and bun run test to verify changes.

Contributing

Report bugs and request features through GitHub Issues.

License

Apache-2.0

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