MCP server for Danish law.
Connect your AI agent to LovAPI and let it search laws, statutory orders and guidance from Retsinformation. The agent gets whole sections together with the amendments that affect them, so it can cite what its answer rests on.
Start for free. See plans and limits.
claude mcp add --transport http lovapi \
https://api.lovapi.dk/v1/mcp \
--header "Authorization: Bearer $LOVAPI_KEY"
{
"mcpServers": {
"lovapi": {
"url": "https://api.lovapi.dk/v1/mcp",
"headers": {
"Authorization": "Bearer ${env:LOVAPI_KEY}"
}
}
}
}
{
"inputs": [
{
"type": "promptString",
"id": "lovapi-key",
"description": "LovAPI key",
"password": true
}
],
"servers": {
"lovapi": {
"type": "http",
"url": "https://api.lovapi.dk/v1/mcp",
"headers": {
"Authorization": "Bearer ${input:lovapi-key}"
}
}
}
}
[mcp_servers.lovapi]
url = "https://api.lovapi.dk/v1/mcp"
bearer_token_env_var = "LOVAPI_KEY"
mcp_servers:
lovapi:
url: "https://api.lovapi.dk/v1/mcp"
headers:
Authorization: "Bearer ${LOVAPI_KEY}"
{
"mcp": {
"servers": {
"lovapi": {
"url": "https://api.lovapi.dk/v1/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer ${LOVAPI_KEY}"
}
}
}
}
}
~/.cursor/mcp.json. VS Code: .vscode/mcp.json, which asks for the key the first time. Codex: ~/.codex/config.toml. Hermes: ~/.hermes/config.yaml. OpenClaw: ~/.openclaw/openclaw.json.Getting started
export LOVAPI_KEY="your-key"Create a key on the account page and store it as an environment variable.https://api.lovapi.dk/v1/mcpAdd the server in your client with the setup above.What does section 11 of the Danish Rent Act say?Ask a question about Danish law. The agent picks the tool itself.
The tools
Four tools that only read. They are built on the same endpoints as the REST API.
-
Search
Search the text of current documents, those not marked historical.
search_law_semanticQuestions in plain language, e.g. "how fast may you drive on the motorway?"search_law_lexicalExact lookups in Danish, e.g. "lejeloven paragraf 11" -
Documents
Find documents by name and look up their status and relations. Historical documents and amending acts too.
find_legal_documentsFrom a name to an accession numberget_legal_document_metadataStatus and relations of one document -
REST API only
Whole documents and the daily change feed are too large for an agent's context window. You fetch them with the same key.
GET /documents/{accession_number}/markdownGET /documents/changes/{date}
What the agent gets
A language model knows the law as it stood when the model was trained. With LovAPI the agent searches today's text, and an amendment comes with the section it changes.
{
"accession_number": "A20220034130",
"popular_title": "Lejeloven",
"short_title": "LOV nr 341 af 22/03/2022",
"location": {
"chapter": {"name": "Kapitel 2", "title": null},
"heading": "Lejeaftalens udformning og indhold",
"paragraph": "11"
},
"url": "https://www.retsinformation.dk/eli/accn/A20220034130#P11",
"content": [
"En lejeaftale og andre aftaler om det lejede skal udfærdiges skriftligt, når en af parterne kræver det.\n Stk. 2. En lejeaftale anses for indgået på lovens vilkår, … Stk. 5. …"
],
"change_annotations": [
{
"short_title": "LOV nr 1790 af 28/12/2023",
"location": {"paragraph": "4"},
"publication_date": "2023-12-28",
"text": "… 1. I § 11 indsættes som stk. 6:\nStk. 6. For lejeaftaler om ustøttede private ungdomsboliger, …"
}
],
"score": 13.84522
}
-
Whole units
Each result is one whole section, one named part or one appendix, never an excerpt.
-
Amendments at the text
Amendments are never merged into the text. They come as annotations, and the agent is told to read them before it answers.
-
Ready to cite
Each result has the document's citation, the section number and a link to Retsinformation.
-
Fits the context
A search response is at most 48,000 characters. If a result does not fit, its text is left out rather than cut, and the agent is told where to read it.
FAQ
Which clients work?
MCP clients that can connect to a remote server over Streamable HTTP and send an Authorization header. The server uses API keys, not OAuth. Clients running in a browser cannot be used, because the key would then sit in the page.
What counts as a request?
Each tool call is one request on your account, just like a call to the REST API. An agent often makes several calls to answer one question, so the free plan's per-minute limit is reached quickly. When the limit is reached, the agent is told. See the plans.
Can I trust the agent's answer?
An agent can be wrong, even with the right text in front of it. Each result links to Retsinformation, the official source, so the answer can be checked. LovAPI does not give legal advice.