
Datafordeler Dar Mcp
io.github.aneal99v0.1.1更新于 Oct 2, 2026
Danish addresses from Datafordeleren's DAR register, the replacement for DAWA.
概览
查询 Datafordeleren 官方 DAR 登记中的丹麦地址、街道、邮编和入口地址,并返回 WGS84 坐标。
- 功能
- 通过十个工具访问 Datafordeleren 上的丹麦地址登记(DAR),即已停用的 DAWA 服务的替代方案。七个查询工具无需密钥:连通性状态、按 UUID 查询单元地址或入口地址、某个入口地址下的单元、按市镇与道路代码或邮编或地籍地块枚举、按 UUID 或代码查询道路、按四位代码查询邮编。另外三个工具需要 API 密钥:街道名与地址的前缀搜索、对 DAR/v2 的原始 GraphQL 透传,以及获取 GraphQL schema。结果包含署名信息、带英文标签的 DAR 状态码,以及 EPSG:25832 与 WGS84 两种坐标。
- 适用场景
- 当助手需要当前的丹麦地址数据时使用,例如把邮编解析为 UUID、列出某条街上的入口,或查找某个地址下的单元。它也是依赖已关闭的 DAWA 接口的工具的替代路径。该项目为 v0.1 探测版,没有缓存且只有单一数据源,宜视为轻量封装而非生产级数据平台。
- 运行要求
- 通过 npx 以 stdio 在本地运行,需要 Node.js 20 或更高版本。环境变量 DATAFORDELER_API_KEY 在 2027 年 1 月 15 日之前对七个查询工具是可选的,但文本搜索和 GraphQL 工具必须提供;密钥来自 datafordeler.dk 的免费账户,新密钥最长需 15 分钟生效。可选的 DATAFORDELER_USERNAME 与 DATAFORDELER_PASSWORD 若设置会传给旧版 REST 服务。需要能访问 Datafordeleren 服务的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Datafordeler Dar Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
datafordeler-dar-mcp
MCP server for Danish addresses from Danmarks Adresseregister (DAR) on Datafordeleren, the official national data distributor.
DAWA (dawa.aws.dk, api.dataforsyningen.dk) closed on 1 October 2026
and now returns HTTP 410. Every address tool that was built on it is dead.
Klimadatastyrelsen's replacement is Datafordeleren, which is keyed, bitemporal
and GraphQL-first. This server gives AI agents (Claude, Cursor, VS Code, any
MCP client) the DAR data through ten small, documented tools, with the
coordinates converted to WGS84 and the DAR UUIDs that DAWA also used.
Status: v0.1, a probe. It exists to find out whether anyone wants a maintained MCP layer over Danish public data. Stars, npm downloads and issues are the signal. It is deliberately thin: no caching, no metering, one source.
What it does
Every result carries attribution (CC BY 4.0, Klimadatastyrelsen), DAR
status codes with English labels, and points in both EPSG:25832 and WGS84.
Errors are typed (config, bad_request, auth, not_found,
rate_limited, upstream, timeout, network) and say what to do next.
Install
Requires Node.js 20 or newer.
Claude Code:
Claude Desktop, Cursor, VS Code and other clients (mcp.json /
claude_desktop_config.json):
Getting an API key, and why you will need one
Anonymous access to the legacy REST service works today, which is why the seven lookup tools need no key. Klimadatastyrelsen has announced that after 15 January 2027 Datafordeleren only serves authenticated requests (API key or OAuth). Text search already needs a key because it runs on the GraphQL service.
- Create a free account at https://datafordeler.dk (Datafordeler Administration). An e-mail user is enough; MitID Erhverv is optional.
- Create an IT-system and add an API key to it.
- Set
DATAFORDELER_API_KEY.
No approval step is needed for DAR. A new key takes up to 15 minutes to
activate; until then the service answers 401 "Unrecognized Authentication
key". Rate limits are not published; the server surfaces HTTP 429 as
rate_limited.
Optional legacy credentials (DATAFORDELER_USERNAME, DATAFORDELER_PASSWORD)
are passed through to the REST service if set.
Examples an agent can chain
With a key:
What the GraphQL service actually does
Verified against the live service on 2026-10-01. Several points differ from Datafordeleren's published transition guide (v2.3, January 2025):
- DAR is served at
/DAR/v2./DAR/v1, which the guide documents, returns 404. - Every entity query must carry
virkningstidand/orregistreringstid, or filter onid_lokalId. Pass both set to now for the current state; withvirkningstidalone you also get superseded registrations. startsWithexists only onadgangsadressebetegnelse,adressebetegnelse,vejnavn,postnrandnavn, and is case-sensitive. Everything else takeseqandin. There is no fuzzy, substring or ranked search, and no autocomplete.- References are ids. A
DAR_Husnummerholds the UUIDs of its street, postcode and access point; coordinates live onDAR_Adressepunkt. - Field names transliterate æ/ø/å as ae/oe/aa (
doerbetegnelse). - Paging is forward-only:
first(max 1000) andafter. - Responses are fast: 30 to 150 ms per query in testing.
dar_search_addresses handles the time arguments, the status filter and
the first letter's case for you. dar_graphql passes queries through
untouched and returns the service's errors verbatim.
Data, licence and attribution
Source: Danmarks Adresseregister via Datafordeleren, Klimadatastyrelsen.
Licence: CC BY 4.0 per
Datafordeleren's terms of use. You must credit Klimadatastyrelsen "på et
passende sted"; the attribution field in every response is there to be
passed on. Addresses are not personal data. The server stores nothing and
logs nothing.
Known limits of the legacy REST service this version leans on: no text search, no reverse geocoding, no autocomplete, pagination by page number only, and a scheduled shutdown on 15 January 2027. The replacement for all of those is the GraphQL service behind the three keyed tools.
Development
With DATAFORDELER_API_KEY set, test:live also exercises the three
GraphQL tools; without it those tests are skipped.
Layout: src/client.ts (REST and GraphQL fetch, typed errors),
src/normalise.ts (flattening, status labels, UTM32 to WGS84),
src/server.ts (tool registrations), src/index.ts (stdio entry point).
Tests use fixtures captured from the live service on 2026-10-01.
Feedback
If this is useful to you, or missing something you need (other registers, reverse geocoding, a hosted endpoint), please open an issue. Issues and stars are how this project decides what to build next.
Licence
MIT. See LICENSE.
来源:README.md,提交 d606bbd
工具
0版本历史
1- v0.1.1最新Oct 2, 2026


