LexAPI MCP
OfficialYou can use this MCP server to research and retrieve EU legal documents, inspect their metadata/content, and explore citation and semantic-search relationships.
Search EUR-Lex with structured filters such as text, dates, document type, author, language, and pagination.
Fetch full parsed EU documents by CELEX number or EUR-Lex URL, including articles, sections, tables, and annexes.
Get metadata-only lookups for quick document identification.
List recently published Official Journal documents over a configurable date window.
Explore citation graphs: inbound citations, outbound citations, and a combined citation network with edge types.
Run embedding-based semantic search over EU case law and EU legislation at article granularity; these semantic tools require a paid LexAPI plan and return 403 on FREE tier.
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., "@LexAPI MCP summarize Article 17 of the GDPR"
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.
LexAPI MCP
Model Context Protocol server for LexAPI — EU and national law for AI assistants: EUR-Lex legislation parsed to article level, CJEU case law, member-state legislation and case law (in the countries that are live), the typed citation graph, and semantic search (including the version of an act listed for a date). Works with Claude, Cursor, VS Code and any other MCP client.
Ask your assistant "what does Article 17 GDPR require?", "which acts amended REACH?" or "what were the own-funds requirements for banks in June 2019?" — the model calls LexAPI and answers from the source text, with CELEX citations.
You need a LexAPI account. With the hosted server you sign in with LexAPI from your MCP client; with the npm package, use an API key from lex-api.com/dashboard. There is a FREE plan, no card required; see lex-api.com/pricing.
Connect to the hosted server (sign in with LexAPI)
The server is hosted at https://mcp.lex-api.com/v1 (Streamable HTTP). Add that URL to your client and sign in with your LexAPI account when it asks. Calls are billed to your plan like your own API key; you can disconnect at any time under Dashboard → Connected apps.
claude.ai and Claude Desktop
Customize → Connectors → Add custom connector, name it LexAPI, URL https://mcp.lex-api.com/v1, then Connect and sign in. Connectors added on claude.ai are also available in Claude Desktop (same account).
Claude Code
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1Then run /mcp in Claude Code and choose Authenticate for lexapi; your browser opens the LexAPI sign-in.
Other MCP clients
Any client that supports MCP authorization (OAuth 2.1) connects the same way: point it at https://mcp.lex-api.com/v1.
Scopes
Signing in to the hosted server grants the lex scope, which covers every tool. API keys are not subject to scopes.
With an API key instead
Clients without OAuth support send a key from the dashboard as Authorization: Bearer lex_...:
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1 --header "Authorization: Bearer lex_..."Related MCP server: eurlex-mcp-server
Run it locally (npm, API key)
Claude Desktop (local)
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"lexapi": {
"command": "npx",
"args": ["-y", "@lexapi/mcp"],
"env": { "LEXAPI_API_KEY": "lex_..." }
}
}
}Restart Claude Desktop.
Claude Code (local)
claude mcp add lexapi --env LEXAPI_API_KEY=lex_... -- npx -y @lexapi/mcpCursor, VS Code and other stdio clients
Run npx -y @lexapi/mcp with LEXAPI_API_KEY in the environment (Cursor: ~/.cursor/mcp.json; VS Code: .vscode/mcp.json; same command / args / env shape as above).
The npm package needs Node.js 20 or newer.
Tools
Every call is billed from your LexAPI credit pool like the REST endpoint it wraps; each tool's description states its cost.
Five tools write (lex_extract_citations, which adds to LexAPI's shared citation graph, and the webhook create / update / delete / test tools); LEXAPI_MCP_READ_ONLY=true hides them on the local server. The hosted server has no read-only switch for its users.
Tool | What it does | Credits |
| Look a citation up: whether the document exists, its title and link, an article, and whether the act is in force today. | 0–6 (+ a second read, 1–5, when an article is not matched; at most 11) |
| The acts that amend, correct or repeal an EU act, with its in-force status today. | 2–6 (+ 1–5 per date read, up to 10 dates) |
| One query over EU legislation, EU case law and the national law of chosen live countries. | 5 per search: 10 by default, at most 80 |
| Find legislation articles by meaning; | 5 (+ up to 5 per version fetch with |
| Find judgments, orders and AG opinions by meaning. | 5 (15 with |
| Structured EUR-Lex search: text, dates, type, author, procedure, collection. | 3 per page |
| What was published in the last N days. | 3 per 10 results (default 20 → 6); unfiltered usually 3 |
| URL / ELI / ECLI → CELEX. | 1 |
| A document by CELEX: an outline for large acts, then an article or selected parts. | 1 corpus · 4 Cellar · 5 live |
| Up to 50 documents at once (plan-capped). | per document, as above |
| Metadata only. | 1 · 4 · 5 |
| A document from a pasted EUR-Lex URL. | 1 · 4 · 5 |
| The version of an EU act listed for a date and, optionally, one article, annex or recital of it. | 1 (4 · 5 when the text is fetched) |
| LexAPI's observed version history of a document: fetch snapshots, not the law in force on a date. | 1 |
| One observed snapshot, by version number or the one held at the end of a date. | 1 |
| Inbound / outbound citations, with each edge's type and provenance. | 1 |
| Both directions in one call. | 20 |
| Shortest citation chain between two documents. | 20 |
| Documents citing the same acts. | 20 |
| Citation graph totals and most-cited documents. | 20 |
| Add a document's outbound citations to the graph. | 5 (1 if already done) |
| Measures member states notified to the Commission for an EU act, by country. | 5 |
| A national act's counterparts in other live countries (BUSINESS+). | 20 |
| Corpus rows by type, author, collection, language or date (BUSINESS+). | 1 per row, at least 1 per call |
| Which countries' national law is live, with sources and licences. | free |
| Browse a country's national legislation and case law. | 3 |
| A national document by id. | 1 |
| Semantic search over one country's case law / legislation. On legislation, | 5 |
| Your plan, credit balance and limits. | free |
| Your webhooks and their deliveries. | free |
| Webhooks for new documents and changes to watched acts (paid plans). | free |
The first three tools are made of the calls the others make: a value the API did not return is reported as unknown, and a part that could not be fetched is named with the reason. Two values are computed by the tools from what the API returned: onDate.status (a date compared with the returned dates) and celexYear (the year in a CELEX number). The citation-graph tools accept national document ids and an includeNational option (BUSINESS+). Every national result carries attribution (the official source and its licence); LexAPI's Terms require it to be kept with republished content. Consolidated texts are labelled as not authentic; cite the act as published in the Official Journal.
On lex_semantic_legislation, for today's version pass today's date (UTC) as asOf and use only hits with asOfResolved: true. Without asOf, acts no longer in force are marked inForce: false where their status is known; since-amended or repealed provisions are not marked.
lex_legislation_as_of with { "document": "32016R0679", "asOf": "2019-06-01", "provision": "art_17" } returns the version listed for 1 June 2019 (02016R0679-20160504) and Article 17 in it.
The version and text are established only when asOfResolved is true; otherwise asOfReason says why and no text is returned.
Configuration
Env var | Default | Purpose |
| (required) | Your API key from lex-api.com/dashboard. |
|
| API base URL. |
| off |
|
|
| Deadline per tool call, retries included. Raise it only together with your MCP client's tool timeout. |
npm run start:http (or the Dockerfile) runs the Streamable HTTP transport (POST /v1, GET /health, PORT default 3000). With LEXAPI_MCP_OPENAI_CHALLENGE set, it also serves that value as plain text at /.well-known/openai-apps-challenge (OpenAI domain verification); unset, the path is not served. A self-hosted copy accepts API keys only; sign in with LexAPI is a feature of the hosted server.
Error messages state what to do (a 402 gives the credits needed and the reset date, a 429 how long to wait). Full API reference: lex-api.com/docs.
Privacy and support
With each API request the server sends an
X-LexAPI-Clientheader naming itself and its version, how it runs (hostedorstdio), the tool being called and, in stdio mode, the MCP client's name and version.The server sends credentials only to the configured API origin (
LEXAPI_BASE_URL) and does not follow redirects to other hosts. A redirect from the API is followed only on that same origin (scheme, host and port; a different port is a different origin, also whenLEXAPI_BASE_URLnames a non-default port), or fromhttptohttpson the same host when both use their default port.Privacy notice: lex-api.com/privacy
Support: support@lex-api.com · lex-api.com/support
Training data
Using LexAPI content to train, fine-tune or evaluate models needs a separate licence (Terms §6). Arieta Data, a sister product from Arieta Labs, licenses datasets drawn from the same corpus for training, retrieval and evaluation.
Development
npm install
npm test # build + tests (mocked API, no network)
npm run typecheck && npm run linttests/fixtures/operation-weights.json holds the API's credit weights, which a test compares with the costs in the tool descriptions and this README. The maintainers refresh it when a weight changes in the API.
License
MIT
Available Tools
10 toolslex_citation_networkAInspect
Fetch both inbound and outbound citations for a CELEX in one call, with per-edge-type counts. Use when the user wants a holistic view of how a document sits in the citation graph.
Inputs: celexNumber (required).
lex_cited_byAInspect
Find documents that cite this CELEX (inbound edges). Returns source documents grouped with their edge type (reference, amendment, repeal, implementation, legal-basis, proposal). Use to see who depends on or modifies a given act.
Inputs: celexNumber (required), citationType, limit, offset.
lex_citesAInspect
Find documents this CELEX cites (outbound edges). Returns target documents grouped with their edge type. Use to see what an act relies on, amends, or implements.
Inputs: celexNumber (required), citationType, limit, offset.
lex_get_documentAInspect
Fetch the full parsed content of a single EU document by CELEX number. Returns metadata (title, type, dates, author, ECLI/ELI, keywords) plus structured body (articles, sections, tables, annexes). Articles are individually addressable with id, number, title, and content. Use this when the user has a specific CELEX or wants the body of a known document.
Inputs: celexNumber (required), bypassCorpus.
lex_get_document_by_urlAInspect
Fetch a parsed document from any EUR-Lex URL — useful when the user pastes a link from their browser. Extracts the CELEX from the URL and returns the same shape as lex_get_document plus sourceUrl and extractedCelex echoes.
Inputs: url (required).
lex_get_metadataAInspect
Fetch metadata only for a CELEX (title, dates, type, author, ECLI/ELI, keywords, subjects) — significantly faster than lex_get_document because it skips body parsing. Use this for quick "what is this document" lookups or before deciding whether to fetch the body.
Inputs: celexNumber (required).
lex_recent_documentsAInspect
List documents published to the Official Journal recently. Default window is 7 days. Filterable by document type, author, and language. Use this when the user asks "what was published this week" or wants a delta over a date window.
Inputs: days, documentType, author, language, +1 more.
lex_searchAInspect
Search EUR-Lex with structured filters (free text, date range, document type, author, language). Returns a paginated list of matching documents with CELEX numbers, titles, and dates. Use this when the user wants to find documents matching a topic or filter; use lex_get_document afterwards to fetch full content of a specific result.
Inputs: query, textScope, dateFrom, dateTo, +5 more.
lex_semantic_case_lawAInspect
Embedding-based search over EU case law — finds cases by meaning, not exact keywords. Returns relevance-scored matches with ECLI, court, case name/number, and (where available) full text. Requires a paid LexAPI plan; returns 403 on FREE tier.
Inputs: query (required), limit, min_score, filters.
lex_semantic_legislationAInspect
Embedding-based search over EU legislation at article granularity. Returns relevance-scored article hits with parent CELEX, article reference, and law title. Requires a paid LexAPI plan; returns 403 on FREE tier.
Inputs: query (required), limit, min_score, filters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have distinct purposes, but the citation tools (lex_citation_network, lex_cited_by, lex_cites) overlap in scope. However, descriptions clearly differentiate holistic vs directional usage, preventing major confusion.
All tools share the 'lex_' prefix, but naming patterns vary: verb_noun (lex_get_document), noun_verb (lex_citation_network), adjective_noun (lex_semantic_case_law), and plain verb (lex_search). This inconsistency may require extra attention.
With 10 tools, the set is well-scoped for a legal document API. Each tool covers a distinct aspect of retrieval and search without feeling bloated or sparse.
The tool set covers all essential operations for a read-only EU legal API: search, recent publications, metadata, full document retrieval, citation network (holistic and directional), and semantic search for both case law and legislation. No obvious gaps in core functionality.
Maintenance
Related MCP Connectors
Search and monitor live EU legislation, regulations, and directives directly from EUR-Lex.
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
Temporal search and comparison for official Luxembourg and reviewed EU law, with provenance.
Eurlex MCP client: Access EU law & Official Journal. https://www.lexsocket.ai/
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables querying and analyzing Slovak legislation via natural language, including full-text search, provision retrieval, and EU law integration.53 npm2Apache 2.0
- 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.12363 npm8MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables searching and quoting EU legislation with verifiable EUR-Lex citations, including GDPR, NIS2, DORA, and the EU AI Act.98 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables querying and retrieving legal texts and decisions from French public APIs Légifrance and JudiLibre for legal research.MIT