LexAPI MCP Server
EU and national law for AI: EUR-Lex legislation and case law, citation graph, semantic search.
LexAPI scores 68 (Good), licensed MIT and written in TypeScript. It can be reached as a remote MCP endpoint. It declares 27 tools. Filed under Search. GitHub shows 3 stars. Package registries report about 549 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
68 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade A
94/100 for listing completeness. Lost points: 1 of 27 tools barely described, short summary.
How quality is graded
Where the 68 comes from
22 + 20 + 2 + 10 + 4 + 10 = 68. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 2 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Remote auth: API key required. Get a key or token from the provider first, then add it as a header in your client config. How remote auth works
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "lex-api-lexapi-mcp": { "command": "npx", "args": [ "-y", "@lexapi/mcp@0.5.1" ], "env": { "LEXAPI_API_KEY": "YOUR_LEXAPI_API_KEY", "LEXAPI_BASE_URL": "", "LEXAPI_MCP_READ_ONLY": "", "LEXAPI_TIMEOUT_MS": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
LEXAPI_API_KEYSecret | Required | LexAPI API key. Get one at https://lex-api.com/dashboard (FREE plan available; see https://lex-api.com/pricing). |
LEXAPI_BASE_URL | Optional | Override the LexAPI base URL. Defaults to https://lex-api.com/api/v1. |
LEXAPI_MCP_READ_ONLY | Optional | Set to true to hide every non-read-only tool (webhook create/update/delete/test, citation extraction). |
LEXAPI_TIMEOUT_MS | Optional | Deadline per tool call in milliseconds, retries included (default 55000). Raise only together with the MCP client timeout. |
Tools27Tool docs quality grade D
All capabilitieslex_act_historytoolThe acts that amend, correct or repeal an EU act, with its in-force status today.
Look a citation up: whether the document exists, its title and link, an article, and whether the act is in force today.
Both directions in one call.
Shortest citation chain between two documents.
Citation graph totals and most-cited documents.
lex_counterpartstoolA national act's counterparts in other live countries (BUSINESS+).
LexAPI's observed version history of a document: fetch snapshots, not the law in force on a date.
lex_exporttoolCorpus rows by type, author, collection, language or date (BUSINESS+).
Add a document's outbound citations to the graph.
lex_get_documenttoolA document by CELEX: an outline for large acts, then an article or selected parts.
A document from a pasted EUR-Lex URL.
One observed snapshot, by version number or the one held at the end of a date.
About
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/v1
Then 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_..."
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/mcp
Cursor, 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 |
|---|---|---|
lex_check_citation | 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) |
lex_act_history | 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) |
lex_research | 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 |
lex_semantic_legislation | Find legislation articles by meaning; asOf gives each hit the version listed for a date. | 5 (+ up to 5 per version fetch with asOf) |
lex_semantic_case_law | Find judgments, orders and AG opinions by meaning. | 5 (15 with hyde) |
lex_search | Structured EUR-Lex search: text, dates, type, author, procedure, collection. | 3 per page |
lex_recent_documents | What was published in the last N days. | 3 per 10 results (default 20 → 6); unfiltered usually 3 |
lex_resolve | URL / ELI / ECLI → CELEX. | 1 |
lex_get_document | A document by CELEX: an outline for large acts, then an article or selected parts. | 1 corpus · 4 Cellar · 5 live |
lex_get_documents_batch | Up to 50 documents at once (plan-capped). | per document, as above |
lex_get_metadata | Metadata only. | 1 · 4 · 5 |
lex_get_document_by_url | A document from a pasted EUR-Lex URL. | 1 · 4 · 5 |
lex_legislation_as_of | 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) |
lex_document_versions | LexAPI's observed version history of a document: fetch snapshots, not the law in force on a date. | 1 |
lex_get_document_version | One observed snapshot, by version number or the one held at the end of a date. | 1 |
lex_cited_by · lex_cites | Inbound / outbound citations, with each edge's type and provenance. | 1 |
lex_citation_network | Both directions in one call. | 20 |
lex_citation_path | Shortest citation chain between two documents. | 20 |
lex_related | Documents citing the same acts. | 20 |
lex_citation_stats | Citation graph totals and most-cited documents. | 20 |
lex_extract_citations | Add a document's outbound citations to the graph. | 5 (1 if already done) |
lex_transposition | Measures member states notified to the Commission for an EU act, by country. | 5 |
lex_counterparts | A national act's counterparts in other live countries (BUSINESS+). | 20 |
lex_export | Corpus rows by type, author, collection, language or date (BUSINESS+). | 1 per row, at least 1 per call |
lex_national_coverage | Which countries' national law is live, with sources and licences. | free |
lex_list_national_documents | Browse a country's national legislation and case law. | 3 |
lex_get_national_document | A national document by id. | 1 |
lex_national_semantic_case_law · lex_national_semantic_legislation | Semantic search over one country's case law / legislation. On legislation, asOf labels whether today's wording already applied on a date; it never returns earlier wording. | 5 |
lex_info | Your plan, credit balance and limits. | free |
lex_list_webhooks · lex_get_webhook | Your webhooks and their deliveries. | free |
lex_create_webhook · lex_update_webhook · lex_delete_webhook · lex_test_webhook | 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 |
|---|---|---|
LEXAPI_API_KEY | (required) | Your API key from lex-api.com/dashboard. |
LEXAPI_BASE_URL | https://lex-api.com/api/v1 | API base URL. |
LEXAPI_MCP_READ_ONLY | off | true hides every tool that is not read-only (webhook writes, lex_extract_citations). |
LEXAPI_TIMEOUT_MS | 55000 | 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 lint
tests/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
Frequently asked questions
What is LexAPI MCP Server?
EU and national law for AI: EUR-Lex legislation and case law, citation graph, semantic search.
How do I install LexAPI MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. LexAPI MCP Server runs locally from the npm package @lexapi/mcp with the command npx -y @lexapi/mcp@0.5.1.
Is LexAPI MCP Server free and open source?
Yes. LexAPI MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does LexAPI MCP Server support remote (HTTP) connections?
Yes. LexAPI MCP Server offers a hosted endpoint over Streamable HTTP, so HTTP-capable clients can connect to it without running anything locally.
What tools does LexAPI MCP Server provide?
LexAPI MCP Server provides 27 tools, including lex_act_history, lex_check_citation, lex_citation_network, and lex_citation_path. See the full tool list for descriptions and parameters.
How is LexAPI MCP Server's trust score calculated?
LexAPI MCP Server scores 68 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.