Skip to main content
Glama

mcp-eu-sparql

Installation (one command)

Published on npm + the MCP Registry (io.github.matematicsolutions/mcp-eu-sparql). Run without cloning:

npx -y @matematicsolutions/mcp-eu-sparql

MCP client configuration (stdio):

{ "mcpServers": { "mcp-eu-sparql": { "command": "npx", "args": ["-y", "@matematicsolutions/mcp-eu-sparql"] } } }

(Building from source - below.)

MCP License: MIT Node

MCP server for EU law and CJEU case law via the Publications Office SPARQL endpoint (Cellar / EUR-Lex), plus national data-protection authority decisions via GDPRhub.

CJEU corpus in Cellar (SPARQL COUNT, 2026-07-08): 34,261 judgments (JUDG), 8,362 orders (ORDER), 14,480 Advocate-General opinions (OPIN_AG) - 57,103 judgments and opinions in total, each with CELEX + ECLI.

Related MCP server: cellar-wrapper

Tools

  • search_by_celex(celex, lang?) - act or judgment by CELEX number (e.g. 32016R0679 = GDPR, 62018CJ0311 = Schrems II).

  • search_by_date_range(date_from, date_to, document_type?, lang?, limit?)

    • acts within a date range, optionally narrowed to a type (REG / DIR / DEC / RECO / OPIN).

  • search_cjeu(query?, date_from?, date_to?, document_type?, lang?, limit?) - judgments (JUDG), orders (ORDER) and Advocate-General opinions (OPIN_AG) of the Court of Justice of the EU; optional keyword in the title (parties to the case, case number, keywords of the judgment).

  • search_cjeu_by_ecli(ecli, lang?) - CJEU judgment by ECLI identifier (e.g. ECLI:EU:C:2020:559 = Schrems II).

  • search_gdprhub(query, limit?) - full-text search in GDPRhub (the noyb project wiki): decisions of national data-protection authorities across the EU + commentary on GDPR articles. Content license: CC BY-NC-SA 4.0 - flagged in the license field of every citation.

Every response includes structuredContent.citations with the fields title, url, celex?, ecli?, publication_date?, document_type?, snippet?, license? - Patron reads this field and renders it in the UI panel as the "EU legal acts (EUR-Lex / CJEU)" section.

Stack

  • Node 18+

  • @modelcontextprotocol/sdk

  • Stdio transport (like mcp-saos)

  • Backend: HTTP POST to https://publications.europa.eu/webapi/rdf/sparql with format=application/sparql-results+json; GET to https://gdprhub.eu/api.php (MediaWiki API)

Build + run

npm install
npm run build
node dist/index.js   # starts the server on stdio

Wiring into Patron

In patron/backend/mcp-servers.json:

[
  {
    "name": "saos",
    "transport": "stdio",
    "command": "node",
    "args": ["C:/Users/<YOUR-USER>/mcp-saos/dist/index.js"]
  },
  {
    "name": "eu-sparql",
    "transport": "stdio",
    "command": "node",
    "args": ["C:/Users/<YOUR-USER>/mcp-eu-sparql/dist/index.js"]
  }
]

Tests

npm run drift          # offline: INSTRUCTIONS consistent with TOOLS and ErrorCode
npm run test:offline   # offline: query builders + parsers on fixtures (no network)
npm run smoke          # live: all 5 tools against Cellar + GDPRhub

License

MIT.

This server is one of five MCP connectors covering Polish jurisdiction + EU law, used by Patron (AGPL-3.0) and any other MCP-aware legal AI agent.

  • mcp-eu-sparql (this repo) - EU law + CJEU (EUR-Lex / Cellar)

  • mcp-saos - common courts, SN, TK, KIO

  • mcp-nsa - NSA + 16 WSA administrative courts

  • mcp-isap - Polish legislation (Dz.U. + M.P.)

  • mcp-krs - Polish company registry (KRS)

All five MCP servers share the same structuredContent.citations contract: each tool returns an array of {title, url, snippet?, ...metadata} that legal agents can render directly in their citation panel.

See matematicsolutions/.github for the full org profile.

Available Tools

3 tools
search_by_celexA
Read-onlyIdempotent

Znajdz akt prawny UE po numerze CELEX. Numer CELEX jest unikalny i identyfikuje akt niezaleznie od jezyka. Przyklady: 32016R0679 (RODO), 31995L0046 (uchylony dyrektywa o ochronie danych), 62022CJ0252 (orzeczenie CJEU). Zwraca tytul w wybranym jezyku + EUR-Lex URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
celexYesNumer CELEX, np. '32016R0679' (RODO).
langNoISO 639-3 jezyka tytulu (POL/ENG/FRA/DEU). Domyslnie POL.

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, idempotent, non-destructive operation. Description adds that it returns title and URL, but no further behavioral details like error handling or performance. Adequate given annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise with three short sentences, each adding value: purpose, uniqueness, examples. No unnecessary words. Front-loaded with main action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple lookup tool with comprehensive annotations and schema, the description covers purpose, parameters (via examples), return value (title + URL), and usage context. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are already described. Description adds CELEX examples and explains uniqueness, but does not significantly extend schema documentation. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool finds an EU legal act by CELEX number, with examples. It implicitly distinguishes from sibling tools (search_by_date_range, search_cjeu) by focusing on unique identifier lookup, but does not explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides examples and emphasizes uniqueness of CELEX, but does not specify when to use alternatives or what to do if CELEX is unknown. Implied usage but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_by_date_rangeA
Read-onlyIdempotent

Znajdz akty prawne UE z zakresu dat (po dacie dokumentu). Opcjonalnie filtruj po typie (REG=rozporzadzenie, DIR=dyrektywa, DEC=decyzja, RECO=zalecenie, OPIN=opinia). Maks. 50 wynikow na zapytanie. Uzyteczne do przegladu aktow z konkretnego okresu legislacyjnego.

ParametersJSON Schema
NameRequiredDescriptionDefault
date_fromYesData od (YYYY-MM-DD).
date_toYesData do (YYYY-MM-DD).
document_typeNoSkrot typu aktu: REG, DIR, DEC, RECO, OPIN. Pomin zeby objac wszystkie.
langNoISO 639-3 jezyka tytulow. Domyslnie POL.
limitNoMaks. liczba wynikow (1-50). Domyslnie 20.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description adds a useful behavioral constraint (max 50 results per query), which goes beyond annotations. It does not describe pagination or return format, but the annotations cover the core safety profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each adding value. Purpose is front-loaded, options and limits are stated concisely. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 5 parameters, 2 required, and no output schema. The description mentions max results and date range filtering, which is adequate. It does not explain ordering or error handling, but for a search tool with good annotations, this is nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 5 parameters are documented in the schema (100% coverage). The description adds minimal extra value: it expands the type abbreviations (e.g., REG=rozporzadzenie) and clarifies that omitting type covers all. The baseline of 3 is appropriate since schema descriptions are already complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finds EU legal acts within a date range, with optional type filtering. This distinguishes it from sibling tools 'search_by_celex' (by CELEX number) and 'search_cjeu' (Court of Justice documents).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear use case (reviewing acts from a specific legislative period) and mentions optional filters and a maximum result limit. However, it does not explicitly state when not to use this tool or directly compare with siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_cjeuA
Read-onlyIdempotent

Wyszukaj orzeczenia Trybunalu Sprawiedliwosci UE (CJEU) - wyroki (JUDG) i postanowienia (ORDER). Opcjonalnie zawez do zakresu dat. Zwraca CELEX (np. 62022CJ0252), date wydania, tytul (jezyk wg lang) i EUR-Lex URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
date_fromNoData od (YYYY-MM-DD). Opcjonalna.
date_toNoData do (YYYY-MM-DD). Opcjonalna.
langNoISO 639-3 jezyka tytulow. Domyslnie POL.
limitNoMaks. liczba wynikow (1-50). Domyslnie 20.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, not destructive. Description adds that it returns specific fields, but does not disclose pagination, sorting, or filtering by type. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with purpose, no wasted words. Highly concise and structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Describes return values (CELEX, date, title, URL) since no output schema. Covers all parameters with descriptions. Missing details on sorting or default behavior, but sufficient for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all parameters with descriptions (100% coverage). Description adds no extra meaning beyond what schema provides, so baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches CJEU judgments and orders, with optional date filtering, and lists returned fields. It distinguishes from sibling tools by being a general search, though it does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for general CJEU search with optional date range, but no guidance on when to use sibling tools (search_by_celex, search_by_date_range) or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.1.0
    • First observedsearch_by_celex
    • First observedsearch_by_date_range
    • First observedsearch_cjeu

TDQS

A3.8/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct search dimension: CELEX number, date range with type filter, and CJEU rulings. There is no overlap in functionality.

Naming Consistency4/5

Two tools follow 'search_by_<criterion>' pattern, while the third uses 'search_cjeu', which is slightly inconsistent but still clear and predictable.

Tool Count4/5

Three tools cover the core search needs for EU law (specific ID, date range, case law), though a keyword search tool could be added for completeness.

Completeness3/5

The set covers specific ID lookup, date-based filtering, and case law search, but lacks a general free-text keyword search, which is a notable gap for a legal research server.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A community-maintained MCP server that simplifies access to EU legal and legislative data from the CELLAR service, supporting lookups, metadata retrieval, relation checks, and monitoring.
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    MCP server for querying French legislation and case law via the Legifrance API, enabling search and retrieval of laws, codes, and court decisions with verifiable citations.
    8
    2
    Apache 2.0