@cyanheads/eur-lex-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@cyanheads/eur-lex-mcp-serversearch for recent regulations on artificial intelligence"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://eur-lex.caseyjhand.com/mcp
Overview
EU legislation, CJEU case law, and treaties over the EU Publications Office's CELLAR semantic repository and the EUR-Lex content API. Search documents and case law, fetch full text, resolve citations, traverse the amendment and citation graph, and browse the EuroVoc thesaurus from any MCP client. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
Tool | Description |
| Search EU legislation, treaties, and preparatory acts by type, date, EuroVoc subject, author institution, and in-force status |
| Fetch metadata and full text (HTML, Markdown, or Formex4 XML) for an act by CELEX, ELI, or work URI |
| Resolve a CELEX number or ELI URI to its canonical CELLAR work |
| Search CJEU and General Court case law by case number, court, case type, and date range |
| Traverse the CELLAR relationship graph — amendments, repeals, consolidations, legal basis, citations, transpositions |
| Search the EuroVoc thesaurus to resolve terms to concept URIs |
| Run a raw, read-only SPARQL SELECT against the CELLAR endpoint |
Resources
Resource | Description |
| Metadata snapshot for a CELLAR work |
| One-hop relationship summary for a CELLAR work |
All resource data is also reachable via tools.
Prompts
Prompt | Description |
| Frame a comparative EU/US legal analysis for a policy domain |
Related MCP server: eurlex-mcp-server
Capability reference
eurlex_search_documents tool
Keyword matches English titles via the full-text index, or CELEX substrings — no full-text body search; at least one filter is required
document_type(REG,DIR,DEC,TREATY,JUDG,OPIN_AG,PROP,REC) expands to its full CELLAR authority family;include_consolidatedfolds in consolidated texts of that categoryDate range (
date_from/date_to), EuroVoc concept URI (fromeurlex_browse_subjects), author institution, and in-force-only filtersPagination via
offsetandlimit(max 100); each result flagsis_consolidatedTyped errors:
no_filters,invalid_date_range,no_results
eurlex_get_document tool
Accepts exactly one of
celex_number,eli_uri, orwork_uriBody as
html(default),markdown(server-side converted), orxml(Formex4); all 24 EUR-Lex language codes, case-insensitive, defaulting to and falling back to Englishcontent_mode"paged"(default, offset/limit window),"full"(first window from zero), or"metadata_only"; paged and full windows both cap at 100,000 characters, withcontent_chars_total/has_moreto page the restoutline: truereturns chapter/article/annex/recital headings with offsets;select(e.g.{ articles: "1,5,17" }) returns just those sectionsresolve: "current_consolidated"serves the newest consolidated version instead of the requested base act;is_superseded/current_consolidated_celex/consolidated_as_offlag a stale base act either wayTyped
content_challengeerror when EUR-Lex returns a WAF bot-challenge instead of text
eurlex_lookup_celex tool
Accepts a CELEX number or ELI URI;
identifier_typeauto-detects the format or can be set explicitlyReturns work URI, confirmed CELEX number, resource type, and date —
found: falsefor a well-formed identifier that matches no workambiguous_identifiererror when auto-detection can't classify the input
eurlex_get_cases tool
Filters:
case_number(C-131/12/T-131/12),court(CJEUorGC),case_type(judgment,order,ag_opinion), keyword, and date rangePrimary records only by default — judicial information notices, abstracts, summaries, and corrigenda excluded;
include_derivativeincludes themParty names, subject matter, and case reference are parsed from the raw CELLAR title into
display_title,parties,subject_matter,case_referencePagination via
offsetandlimit(max 100)
eurlex_get_relations tool
Accepts exactly one of
celex_numberorwork_urirelation_typesfilters to a subset ofcites,amends,amended_by,repeals,repealed_by,implicitly_repeals,implicitly_repealed_by,legal_basis,consolidated_version,national_transposition; omit for allOne-hop only, paginated per relation type and direction via
offset/limit(max 100, default 100)Each relation carries
relation_type,direction(outgoing/incoming),related_work_uri, andrelated_celex_numberwhen knownempty_relation_typesdistinguishes "no edges of this type" from "edges paged out of this window";no_relationsfires only when the first page is empty
eurlex_browse_subjects tool
Matches both preferred and alternative (non-preferred) EuroVoc labels, so a common synonym resolves to the concept it stands for
Returns concept URI, preferred label, code, broader (parent) label, and the alternative label that matched when one did
Supports all EU official languages via
language; defaults to EnglishPagination via
offsetandlimit(max 50)
eurlex_query_sparql tool
Read-only SELECT only — update forms and ASK/CONSTRUCT/DESCRIBE are rejected before execution
cdm:,skos:, andxsd:prefixes are auto-injected; results capped at 100 rowsOptional
timeout_hint(1000–55000 ms); the Virtuoso endpoint enforces a 60-second hard limitTyped errors:
not_read_only,sparql_error,sparql_timeout
eurlex://document/{celexNumber} resource
Metadata snapshot as
application/json— resource type, author institution(s), date, title, in-force flag, legal basis, EuroVoc subjectscelexNumbercomes fromeurlex_search_documents,eurlex_get_cases, oreurlex_lookup_celex
eurlex://document/{celexNumber}/relations resource
One-hop relationship summary — amendment chain, consolidations, national transposition, legal basis, citations — capped at 25 per relation type
truncatedplus acontinuationpointer toeurlex_get_relationswhen more relations exist
eurlex_comparative_analysis prompt
Arguments:
domainrequired;focusoptional, folded into its matching analysis axis or added as its own sectionReturns a research plan chaining
eurlex_browse_subjects→eurlex_search_documents→eurlex_get_document→eurlex_get_relationsfor the EU side andcourtlistener_search_opinionsfor the US side, plus a six-axis analysis framework
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
EUR-Lex-specific:
No API key required — CELLAR SPARQL and the EUR-Lex REST content endpoints are both publicly accessible
SPARQL is POSTed with CDM prefix declarations built in; server-side LIMIT enforcement (max 100) guards against Virtuoso timeouts
Act text is fetched via CELLAR content negotiation (
/resource/celex/{CELEX}); HTML and Formex4 XML pass through, Markdown is converted server-sideVirtuoso errors (HTTP 200 with a
Virtuoso 37000 Errorbody) are classified and re-raised asServiceUnavailableorInvalidParamsAutomatic English fallback when a requested translation is unavailable, with requested/effective language reported
Agent-friendly output:
EuroVoc prerequisite guidance in server-level instructions — agents are directed to
eurlex_browse_subjectsbefore concept-filtered searcheseurlex_lookup_celexconfirms CELEX/ELI existence upfront, preventing downstream errors in document or relation fetchescontent_status,content_unavailability_reason, and requested/effective language fields distinguish skipped, available, absent, upstream-failed, and incomplete content without string parsingTyped
reasoncodes on every tool's error contract let agents branch on outcomes programmatically
Getting started
Public Hosted Instance
A public instance is available at https://eur-lex.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"eur-lex-mcp-server": {
"type": "streamable-http",
"url": "https://eur-lex.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add the following to your MCP client configuration file. No API key is required.
{
"mcpServers": {
"eur-lex-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/eur-lex-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"eur-lex-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/eur-lex-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"eur-lex-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/eur-lex-mcp-server:latest"
]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
No API key needed — EUR-Lex and CELLAR are publicly accessible.
Installation
Clone the repository:
git clone https://github.com/cyanheads/eur-lex-mcp-server.gitNavigate into the directory:
cd eur-lex-mcp-serverInstall dependencies:
bun installConfigure environment (optional):
cp .env.example .env
# All server-specific vars have sensible defaults — no required varsConfiguration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts.
Variable | Description | Default |
| CELLAR SPARQL endpoint URL override (e.g., for a local Virtuoso mirror). |
|
| EU Publications Office CELLAR content resolver base URL override. |
|
| Client-side timeout for SPARQL requests in milliseconds. |
|
| Enforced ceiling on LIMIT in all generated SPARQL queries. |
|
| Transport: |
|
| Port for HTTP server. |
|
| Auth mode: |
|
| Session handling: |
|
| Log level (RFC 5424). |
|
| Directory for log files (Node.js only). |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t eur-lex-mcp-server .
docker run --rm -p 3010:3010 eur-lex-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/eur-lex-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| CELLAR SPARQL service — POST client, binding mapper, LIMIT enforcement, CDM PREFIX declarations. |
| CELLAR content service — content-negotiation GET client for |
| Tool definitions ( |
| Resource definitions ( |
| Prompt definitions ( |
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.
Temporal search and comparison for official Luxembourg and reviewed EU law, with provenance.
Resolve, search and verify legal citations against the official sources, with provenance.
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.1MIT
- AlicenseAqualityAmaintenanceEnables searching and retrieving EU legal documents (regulations, directives, court decisions) via the EUR-Lex Cellar API, supporting full-text search, metadata, citations, and consolidated versions without requiring an API key.1174 npm6MIT
- AlicenseNot gradedqualityFmaintenanceProvides structured access to EU treaties, regulations, directives, and CJEU case law via 14 tools for searching, retrieving, and analyzing legislation and court decisions.Apache 2.0
- AlicenseAqualityAmaintenanceMCP server for EU law via the EUR-Lex / Cellar SPARQL endpoint — legislation (ELI/CELEX) and CJEU case-law (ECLI) with verifiable citations.332 npm1MIT