EU-law MCP server ships then trims its own SPARQL layer

lucianschw-dev added a self-contained MCP server for EU-law lookup under `backend/mcp-servers/eu-law/`, backed by EUR-Lex and CELLAR. Three commits later the SPARQL search tools were gone - dropped because the CELLAR SPARQL endpoint proved unreliable in practice.

searchintegration

The v0.1 commit (47b76931) landed about 5,800 lines: a SPARQL client, a REST client, CELEX/ECLI/ELI helpers, rate limiting, an LRU cache, an MCP server entrypoint, and seven tools - three keyword-search tools plus three by-identifier fetchers and verifyCitation. The test suite ships alongside with fixture HTML and JSON.

A small Windows/Node 24 portability pass (8fa02bb2) followed. It adjusts the build script to run TypeScript with --max-old-space-size=6144, decodes percent-encoded URLs in a test assertion, and extends the ELI regex to accept two-digit pre-2000 years (e.g. /eli/dir/95/46 for Directive 95/46/EC). None of those changes touch the tool surface.

The substantive revision is f513b61a. The author concluded that CELLAR SPARQL is not reliable enough to ship against, so sparql.ts and all three SPARQL-backed search tools were deleted (-844 lines). What remains in v0.1.1: getDocumentByCelex, getDocumentByEcli, getDocumentByEli, and a verifyCitation that does pure regex validation with no network call. End-to-end verification used Schrems II (CELEX 62018CJ0311). The test describe block was also renamed from "CELLAR REST fetcher" to "EUR-Lex REST fetcher," and the fallback-language test was tightened to match EUR-Lex's actual "not found" HTML rather than an empty body.

The tradeoff is real. Free-text search is gone; callers must already know a CELEX, ECLI, or ELI identifier. The REST fetches hit eur-lex.europa.eu/legal-content/ HTML pages via cheerio scraping, so any EUR-Lex layout change would break retrieval. The module ships its own package-lock.json targeting Node 24 and lives entirely under backend/mcp-servers/eu-law/, so it doesn't touch upstream paths.

So what Worth a look if you need EU-law document retrieval by known identifier in an MCP context and can live with the lookup-only constraint. Skip if your use case needs free-text search across legislation or case law - that capability was removed and would have to be rebuilt, likely by routing queries through an LLM first. The HTML-scraping dependency on EUR-Lex layout is a maintenance risk to price in before adopting.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

3 commits from lucianschw-dev/eumike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
47b76931 Add eu-law MCP server (v0.1) Lucian.schw 2026-05-16 ↗ GitHub
8fa02bb2 Fix v0.1 build and tests on Windows/Node 24 Lucian.schw 2026-05-16 ↗ GitHub
f513b61a v0.1.1: cut SPARQL search tools, use EUR-Lex REST only Lucian.schw 2026-05-16 ↗ GitHub
commit body
CELLAR SPARQL endpoint proved unreliable in practice. Search tools
(eu_search_legislation, eu_search_case_law, eu_search_treaties)
removed; document fetchers now use eur-lex.europa.eu/legal-content/
which is the canonical user-facing URL and works reliably.

Tools remaining (4):
  - eu_get_document_by_celex
  - eu_get_document_by_ecli
  - eu_get_document_by_eli
  - eu_verify_citation (now pure regex, no network)

Verified end-to-end against Schrems II (CELEX 62018CJ0311).

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-466.md from inside the repo you want the changes in.

⬇ Download capture-thread-466.md