§Likuma Palīgs
MCP · Streamable HTTP

Latvian law as a grounded MCP endpoint

One remote MCP server. Nine read-only tools. Every answer linked to the law in force. Free while we grow.

mcp-quickstart.sh
# 1 · open the session (initialize)
curl -sS https://likumapaligs.lv/api/mcp \
-H "Authorization: Bearer lk_YOUR_API_KEY" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize",
"params":{"protocolVersion":"2025-11-25"}}'
 
# 2 · call a tool → verbatim, cited provisions
curl -sS https://likumapaligs.lv/api/mcp \
-H "Authorization: Bearer lk_YOUR_API_KEY" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call",
"params":{"name":"search_law","arguments":
{"query":"darba līguma uzteikums","k":3}}}'
Tools

The nine tools

searchsearch_law
Hybrid semantic + full-text search over in-force statutes — verbatim provisions, deep links, chunk ids. No AI.
lookupget_provision
One provision, verbatim, by act numeric id + anchor, with its in-force flag.
answerask_latvian_law
The full anti-hallucination harness: a verified, citation-backed answer — or an honest refusal.
structureget_act_structure
An act's table of contents — anchors and deep links, no full text.
coveragelist_coverage
Which acts Likums covers, with per-act answer-readiness and freshness.
feedrecent_changes
A feed of recent corpus changes: new, updated and retired acts.
verifyresolve_citation
Re-verify any Likums citation: chunk id → verbatim snapshot + live in-force status.
searchsearch
Canonical search (for ChatGPT): result objects with id, title and url.
fetchfetch
Canonical fetch (for ChatGPT): the full verbatim text of a result by id.
Response shape

Every citation, verifiable

{
"actTitle": "Darba likums",
"anchor": "p101",
"quote": "Darba devējam ir tiesības uzteikt darba līgumu …",
"inForce": true,
"deepLinkUrl": "https://likumi.lv/ta/id/26019#p101",
"effectiveFrom": "2002-06-06",
"supersededByChunkId": null,
}

Example resolve_citation result. Every quoting tool carries the same contract: act title, provision anchor, verbatim quote, a live in-force flag, and a likumi.lv deep link.

Authentication

A Bearer token on the Authorization header — either a personal lk_ key from your account or an OAuth token from the connector. Every token is read-only and scoped (likums:search / likums:ask); revoke it anytime in Profile → API keys.

Rate limits

The verified-answer tool (ask_latvian_law) is burst-limited per client — a short run of calls, then a brief cooldown returning rate_limited. Search and lookup tools aren't metered today; durable per-plan quotas arrive with billing.

Refusals

When no in-force provision supports an answer, ask_latvian_law returns status: "refused" — never a fabricated citation. Bad input, a missing scope, or an unknown id come back as machine-readable errors, not guesses.

Editors & agents · with an API key
Go to Profile → API keys

Pick your tool. Each block has the exact file or command with the real production URL, and a way to confirm it works.

Claude CodeCommand
claude mcp add --transport http likums https://likumapaligs.lv/api/mcp \
  --header "Authorization: Bearer lk_YOUR_API_KEY"
CursorFile: .cursor/mcp.json
{
  "mcpServers": {
    "likums": {
      "url": "https://likumapaligs.lv/api/mcp",
      "headers": { "Authorization": "Bearer lk_YOUR_API_KEY" }
    }
  }
}
WindsurfFile: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "likums": {
      "serverUrl": "https://likumapaligs.lv/api/mcp",
      "headers": { "Authorization": "Bearer lk_YOUR_API_KEY" }
    }
  }
}
VS CodeFile: .vscode/mcp.json

VS Code prompts once for the key and stores it in your OS secret store; MCP tools need Agent mode.

{
  "inputs": [
    { "type": "promptString", "id": "likums-key", "password": true }
  ],
  "servers": {
    "likums": {
      "type": "http",
      "url": "https://likumapaligs.lv/api/mcp",
      "headers": { "Authorization": "Bearer ${input:likums-key}" }
    }
  }
}
ClineFile: cline_mcp_settings.json

The transport must be spelled exactly "streamableHttp" (camelCase), or Cline falls back to the old SSE transport and fails.

{
  "mcpServers": {
    "likums": {
      "type": "streamableHttp",
      "url": "https://likumapaligs.lv/api/mcp",
      "headers": { "Authorization": "Bearer lk_YOUR_API_KEY" },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Claude and ChatGPT connect over OAuth — no key to paste.

Open the Connect guide

Discovery: https://likumapaligs.lv/.well-known/oauth-protected-resource/api/mcp

Usage

Free — 50 a month. Then €9.99/mo, unlimited.

The MCP connector is part of every plan — no per-answer pricing, ever.

See plans

Legal information with verified sources, not legal advice.