# eur-lex-mcp-server

eur-lex-mcp-server — an MCP server that pulls EU legislation, CJEU case law, and treaties into your agent. Use it when a legal basis or court ruling needs to sit next to your code or analysis.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13 repo stars
- Author: cyanheads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyanheads/eur-lex-mcp-server
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/eur-lex-mcp-server

## What it does

The server connects an agent to EUR-Lex and CELLAR. It searches acts by type, date, EuroVoc concept, author institution and in-force status, and fetches the full text as HTML, Markdown or Formex4 XML. Citations resolve too: CELEX numbers, ELI URIs, ECLI and Official Journal references.

A relations tool walks the CELLAR graph — amendments, repeals, consolidations, legal bases, interpreting rulings, citations, transpositions. Raw read-only SPARQL SELECT is available against the CELLAR endpoint, and a EuroVoc browser resolves thesaurus terms to concept URIs. The package ships 7 tools, 2 resources and one prompt for comparative EU/US legal analysis.

The limits are real. Paging stops at row 10,000, content is capped at 100,000 characters per call, and a keyword with letters but no digit, like `R(01)`, scans every CELEX and takes tens of seconds. Search covers English titles only; document bodies are not searched. To point at your own SPARQL endpoint, set `CELLAR_SPARQL_ENDPOINT` as an environment variable.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://eur-lex.caseyjhand.com/mcp`
- Environment variables: `CELLAR_SPARQL_ENDPOINT`, `EURLEX_CONTENT_BASE_URL`, `SPARQL_QUERY_TIMEOUT_MS`, `MAX_SPARQL_RESULTS`, `MCP_LOG_LEVEL`, `MCP_TRANSPORT_TYPE`, `MCP_HTTP_HOST`, `MCP_HTTP_PORT`, `MCP_HTTP_ENDPOINT_PATH`, `MCP_PUBLIC_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http eur-lex-mcp-server https://eur-lex.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env CELLAR_SPARQL_ENDPOINT=<CELLAR_SPARQL_ENDPOINT> --env EURLEX_CONTENT_BASE_URL=<EURLEX_CONTENT_BASE_URL> --env SPARQL_QUERY_TIMEOUT_MS=<SPARQL_QUERY_TIMEOUT_MS> --env MAX_SPARQL_RESULTS=<MAX_SPARQL_RESULTS> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --transport stdio eur-lex-mcp-server -- npx -y @cyanheads/eur-lex-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add eur-lex-mcp-server --url https://eur-lex.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add eur-lex-mcp-server --env CELLAR_SPARQL_ENDPOINT=<CELLAR_SPARQL_ENDPOINT> --env EURLEX_CONTENT_BASE_URL=<EURLEX_CONTENT_BASE_URL> --env SPARQL_QUERY_TIMEOUT_MS=<SPARQL_QUERY_TIMEOUT_MS> --env MAX_SPARQL_RESULTS=<MAX_SPARQL_RESULTS> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -- npx -y @cyanheads/eur-lex-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "eur-lex-mcp-server": {
            "url": "https://eur-lex.caseyjhand.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "eur-lex-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/eur-lex-mcp-server"
            ],
            "env": {
                "CELLAR_SPARQL_ENDPOINT": "<CELLAR_SPARQL_ENDPOINT>",
                "EURLEX_CONTENT_BASE_URL": "<EURLEX_CONTENT_BASE_URL>",
                "SPARQL_QUERY_TIMEOUT_MS": "<SPARQL_QUERY_TIMEOUT_MS>",
                "MAX_SPARQL_RESULTS": "<MAX_SPARQL_RESULTS>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "eur-lex-mcp-server": {
            "type": "http",
            "url": "https://eur-lex.caseyjhand.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "eur-lex-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/eur-lex-mcp-server"
            ],
            "env": {
                "CELLAR_SPARQL_ENDPOINT": "<CELLAR_SPARQL_ENDPOINT>",
                "EURLEX_CONTENT_BASE_URL": "<EURLEX_CONTENT_BASE_URL>",
                "SPARQL_QUERY_TIMEOUT_MS": "<SPARQL_QUERY_TIMEOUT_MS>",
                "MAX_SPARQL_RESULTS": "<MAX_SPARQL_RESULTS>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http eur-lex-mcp-server https://eur-lex.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e CELLAR_SPARQL_ENDPOINT=<CELLAR_SPARQL_ENDPOINT> -e EURLEX_CONTENT_BASE_URL=<EURLEX_CONTENT_BASE_URL> -e SPARQL_QUERY_TIMEOUT_MS=<SPARQL_QUERY_TIMEOUT_MS> -e MAX_SPARQL_RESULTS=<MAX_SPARQL_RESULTS> -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> eur-lex-mcp-server npx -y @cyanheads/eur-lex-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

## When to use it
- find an in-force EU act by type and date
- pull a regulation's full text as Markdown
- trace which acts amend or repeal a directive
- resolve a CELEX number from a citation
- look up a EuroVoc term for search filters

## Example prompts
- Find in-force directives about personal data protection
- Fetch `32016R0679` as Markdown, only articles 1 and 5
- Which acts cite `Regulation (EU) 2016/679` as their legal basis?

## Similar
- [Lex — Temporal Luxembourg and EU Law](https://affpapa.org/en/nevibecode/mcp/lex-temporal-luxembourg-and-eu-law.md) — MCP server · ★ 9 repo stars
- [conformi-search](https://affpapa.org/en/nevibecode/mcp/conformi-search.md) — MCP server · 294 installs
- [AsterPay — EUR Settlement for AI Agents](https://affpapa.org/en/nevibecode/mcp/asterpay-eur-settlement-for-ai-agents.md) — MCP server · ★ 1 repo stars
- [Lex](https://affpapa.org/en/nevibecode/mcp/lex.md) — MCP server
- [wikidata-mcp-server](https://affpapa.org/en/nevibecode/mcp/wikidata-mcp-server.md) — MCP server · 399 installs
- [Fedlex Connector](https://affpapa.org/en/nevibecode/mcp/fedlex-connector.md) — MCP server · ★ 8 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
