# Lex-API/lexapi-mcp [Health: Active]

**Category:** ⚖️ Legal  
**Repository:** https://github.com/Lex-API/lexapi-mcp  
**GitHub Stars:** 3  
**npm Downloads (last month):** 138  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/lex-api-lexapi-mcp

## Description
EU legal research over EUR-Lex — 10 tools for structured search, CELEX/URL document fetch, recent Official Journal publications, inbound/outbound citation graph, and semantic search over case law + legislation. FREE tier available; semantic tools require a paid plan. Install: npx -y @lexapi/mcp.

## Tools
Capabilities this server exposes over MCP:

- **lex_search** — Structured EUR-Lex search (text, dates, document type, author, language).
- **lex_get_document** — Full parsed document by CELEX — metadata + articles, sections, tables, annexes.
- **lex_get_metadata** — Metadata only (faster than full content).
- **lex_get_document_by_url** — Fetch by EUR-Lex URL (pasted from a browser).
- **lex_recent_documents** — Recent Official Journal publications (default 7 days).
- **lex_cited_by** — Documents citing this CELEX (inbound, typed edges).
- **lex_cites** — Documents this CELEX cites (outbound, typed edges).
- **lex_citation_network** — Both directions in one call.
- **lex_semantic_case_law** — Embedding search over EU case law (paid plans).
- **lex_semantic_legislation** — Embedding search over EU legislation (paid plans).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "lexapi-mcp": {
    "command": "npx",
    "args": ["-y","@lexapi/mcp"],
    "env": {
      "LEXAPI_API_KEY": "",
      "LEXAPI_BASE_URL": ""
    }
  }
}
```

**Requires environment variables:** `LEXAPI_API_KEY`, `LEXAPI_BASE_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Lex-API/lexapi-mcp MCP server does

The Lex-API/lexapi-mcp MCP server exposes LexAPI research functions through the Model Context Protocol. It is aimed at assistants that need to find and inspect EU legal materials rather than rely only on general web search. The service covers EUR-Lex documents, EU case law, EU legislation, Official Journal publications, and citation relationships.

The available operations support both targeted retrieval and broader discovery. An assistant can search using structured fields such as text, dates, document type, author, and language; retrieve a document by CELEX number or EUR-Lex URL; or request metadata without downloading the full parsed content. Citation tools identify documents that cite a given CELEX, documents cited by it, or both directions together.

## How it works

The Lex-API/lexapi-mcp MCP server runs as a stdio process and forwards tool requests to LexAPI. MCP-compatible clients start the package with `npx -y @lexapi/mcp`, while the API key is supplied through the process environment. The default API endpoint is LexAPI's versioned API URL, with an environment variable available for staging or self-hosted deployments.

Document retrieval returns parsed legal content where applicable, including metadata, articles, sections, tables, and annexes. The metadata-only operation is intended for cases where full text is unnecessary. Recent-document queries cover Official Journal publications and use a seven-day default window.

Semantic search is separate from the structured and graph operations. `lex_semantic_case_law` searches EU case law using embeddings, and `lex_semantic_legislation` does the same for EU legislation. These two tools require a paid plan; the free tier returns an authorization error for them.

## Setup and configuration

To run the Lex-API/lexapi-mcp MCP server, create a LexAPI API key and expose it as `LEXAPI_API_KEY`. The documented free tier provides 500 credits per month without requiring a card. In Claude Desktop, add the package as an MCP server with `npx` as the command and place the key in the `env` object. Claude Code can add the same process with its MCP command, and other clients can launch the stdio command directly.

`LEXAPI_BASE_URL` is optional. It overrides the default `https://lex-api.com/api/v1` endpoint and can point to a staging or self-hosted service. For local development, the repository can be cloned, installed with npm, built, and started with `node dist/index.js`.

## Tools and capabilities

- `lex_search`: structured EUR-Lex search by text, date, document type, author, or language.
- `lex_get_document`: retrieves a parsed document by CELEX, including its substantive sections and metadata.
- `lex_get_metadata`: returns document metadata without full content.
- `lex_get_document_by_url`: retrieves a document from a pasted EUR-Lex URL.
- `lex_recent_documents`: lists recent Official Journal publications, using seven days by default.
- `lex_cited_by`, `lex_cites`, and `lex_citation_network`: inspect inbound, outbound, or combined typed citation edges.
- `lex_semantic_case_law` and `lex_semantic_legislation`: perform embedding-based searches on paid plans.

## Limitations and notes

An API key is required, and invalid or revoked keys produce an authentication error. Requests are subject to daily quotas and per-minute rate limits; the server retries a rate-limit response once. Semantic tools are unavailable on the free tier and return a 403 response. The package is designed for MCP clients that can run standard stdio servers, including Claude Desktop, Claude Code, and Cursor.

_Full upstream README: https://allmcps.com/mcp/lex-api-lexapi-mcp/readme_

