Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
EU law for AI: EUR-Lex legislation and case law, citation graph, semantic search with asOf.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
LEXAPI_API_KEY, LEXAPI_BASE_URL, LEXAPI_MCP_READ_ONLY, LEXAPI_TIMEOUT_MS, Authorization标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
这个地址需要在请求的 header 中放入密钥,而添加连接器的菜单无法设置。请改用 Claude Code、Cursor 或 VS Code。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"lexapi": {
"command": "npx",
"args": [
"-y",
"@lexapi/mcp"
],
"env": {
"LEXAPI_API_KEY": "your-value",
"LEXAPI_BASE_URL": "your-value",
"LEXAPI_MCP_READ_ONLY": "your-value",
"LEXAPI_TIMEOUT_MS": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1 --header 'Authorization: your-value'claude mcp add lexapi --env LEXAPI_API_KEY=your-value --env LEXAPI_BASE_URL=your-value --env LEXAPI_MCP_READ_ONLY=your-value --env LEXAPI_TIMEOUT_MS=your-value -- npx -y @lexapi/mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"lexapi": {
"url": "https://mcp.lex-api.com/v1",
"headers": {
"Authorization": "your-value"
}
}
}
}粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"lexapi": {
"command": "npx",
"args": [
"-y",
"@lexapi/mcp"
],
"env": {
"LEXAPI_API_KEY": "your-value",
"LEXAPI_BASE_URL": "your-value",
"LEXAPI_MCP_READ_ONLY": "your-value",
"LEXAPI_TIMEOUT_MS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"lexapi": {
"type": "http",
"url": "https://mcp.lex-api.com/v1",
"headers": {
"Authorization": "your-value"
}
}
}
}粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"lexapi": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@lexapi/mcp"
],
"env": {
"LEXAPI_API_KEY": "your-value",
"LEXAPI_BASE_URL": "your-value",
"LEXAPI_MCP_READ_ONLY": "your-value",
"LEXAPI_TIMEOUT_MS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个地址需要在请求的 header 中放入密钥,而添加连接器的菜单无法设置。请改用 Claude Code、Cursor 或 VS Code。
你的选择通过 Cookie 保存在这台设备上,无需账户。
LEXAPI_BASE_URL envLEXAPI_MCP_READ_ONLY envLEXAPI_TIMEOUT_MS envAuthorization 机密 必填 HTTP header这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
我们还没有读取这个服务器的工具列表;我们会轮流检查各个端点。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 Lex-API 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
尚未检查;我们会轮流检查各个端点
尚未检查;我们会轮流检查各个端点
尚未检查;我们会在检查端点时读取工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:LEXAPI_API_KEY, Authorization
两种方式都可以:安装在你的电脑上,或者连接云端版本。
GitHub 仓库最后更新于–,最新版本(0.3.0)于9天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。它通过 URL 连接,所以接受远程 MCP 服务器的应用也可以使用,例如开启开发者模式的 ChatGPT。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Model Context Protocol server for LexAPI — EU law for AI assistants: EUR-Lex legislation parsed to article level, CJEU case law, the typed citation graph, and semantic search (including the law as in force on a past 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 just sign in with LexAPI from your MCP client; with the npm package (or if you prefer), use an API key from lex-api.com/dashboard. There is a FREE plan, no card required, with enough credits to try the read tools; current allowances are on lex-api.com/pricing.
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 — no key to copy. You see a LexAPI consent page listing what the connection can do; calls are billed to your plan exactly like your own API key, and you can disconnect the app at any time under *Dashboard → Connected apps* (that revokes it immediately).
*Settings → 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 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.
Any client that implements MCP authorization (OAuth 2.1 with protected-resource discovery) connects the same way: point it at https://mcp.lex-api.com/v1. The server answers an unauthenticated request with 401 and WWW-Authenticate: Bearer … resource_metadata="https://mcp.lex-api.com/.well-known/oauth-protected-resource/v1"; the client discovers LexAPI (https://lex-api.com) as the authorization server from there.
Clients without OAuth support — or scripts — send a key from the dashboard as Authorization: Bearer lex_... (or x-api-key: lex_...):
claude mcp add --transport http lexapi https://mcp.lex-api.com/v1 --header "Authorization: Bearer lex_..."
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 mcp add lexapi --env LEXAPI_API_KEY=lex_... -- npx -y @lexapi/mcp
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. It uses an API key; signing in with LexAPI is a feature of the hosted server.
Every call is billed from your LexAPI credit pool exactly like the REST endpoint it wraps; each tool's description states its cost so the model can see it.
| Tool | What it does | Credits |
|---|---|---|
lex_semantic_legislation | Find legislation articles by meaning. asOf returns the text in force on a date. Consolidated hits are labelled, with the authentic act to cite. | 5 (+ up to 5 per live version fetch with asOf) |
lex_semantic_case_law | Find judgments, orders and AG opinions by meaning; hyde for terse queries; court / date / case-number filters. | 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 |
lex_resolve | URL / ELI / ECLI → CELEX. | 1 |
lex_get_document | A document by CELEX — an outline first for large acts, then articleId or include parts; language and fallback languages. | 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_document_versions | LexAPI's observed version history of a document. | 1 |
lex_get_document_version | One observed snapshot, by version number or date. | 1 |
lex_cited_by | Documents citing / amending / correcting / repealing an act. includeNational adds national neighbours (BUSINESS+). | 1 |
lex_cites | What a document cites. includeNational adds national neighbours (BUSINESS+). | 1 |
lex_citation_network | Both directions in one call. includeNational adds national neighbours (BUSINESS+). | 20 |
lex_citation_path | Shortest citation chain between two documents. includeNational follows national documents (BUSINESS+). | 20 |
lex_related | Documents citing the same acts (bibliographic coupling). includeNational considers national documents (BUSINESS+). | 20 |
lex_citation_stats | Citation graph totals and most-cited documents. includeNational counts national documents (BUSINESS+). | 20 |
lex_extract_citations | Add a document's outbound citations to the graph. | 5 (1 if already done) |
lex_export | Corpus rows by type (exact label, any case) or type family (documentTypeCode), author, collection, language, document date (dateFrom/dateTo), changedSince or fetchedSince (BUSINESS plans and above). | 1 per row returned, at least 1 per call (1-credit admission, rows reserved up to limit, unreturned rows refunded; 402 if the pool cannot cover the reservation) |
lex_national_coverage | Which countries' national law LexAPI covers and what's live in each (sources, licences, attribution). Call first. | free |
lex_list_national_documents | Browse a country's national legislation/case law by title or type; cursor paging past the first 1,000 rows. | 3 per call |
lex_get_national_document | A national document by id. Always served from the corpus. | 5 → 1 |
lex_national_semantic_case_law | Semantic search over one country's case law. | 5 |
lex_national_semantic_legislation | Semantic search over one country's legislation. | 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 for changes to watched acts (paid plans). The URL must be a public https URL (port 443/8443, no internal hosts or private addresses) — checked here as well as by the API. | free |
lex_national_coverage, lex_list_national_documents, lex_get_national_document, lex_national_semantic_case_law and lex_national_semantic_legislation cover member-state legislation and case law alongside the EU_LAW tools above. A country can be registered on LexAPI before it is made available to customers — always call lex_national_coverage first; the other tools answer an error for a country that isn't live yet. The citation-graph tools (lex_cited_by, lex_cites, lex_citation_network, lex_citation_path, lex_related, lex_citation_stats) accept national document ids directly (e.g. "AT-NOR-12345") and an includeNational option to pull in national neighbours — BUSINESS, SCALE and ENTERPRISE only, 403 below that. National results have the same fields in every country (LexAPI API 2.8.0): documentKind (act | decision) everywhere, and on a decision court, chamber, caseNumbers and citedNorms — whatever the source calls them. Every national result carries attribution (the official source and its licence, e.g. RIS, gesetze-im-internet.de, Normattiva, Légifrance/Judilibre, the Rechtspraak open data) — show it to the user alongside anything quoted. On FREE/STARTER/PROFESSIONAL plans, national-law calls also draw from a separate monthly allowance (reported as allowance on each response); BUSINESS and higher have no separate limit. A document its source withdrew (a takedown, a pseudonymisation fix) answers a distinct error — nothing of it is served, not even the title; the model is told not to retry and to drop any cached copy.
textAvailability (why text is missing, which languages exist, a pointer to the latest consolidated version) and language-fallback labels.lex_get_document returns the whole body when it fits maxChars (default 40,000 characters), otherwise an outline (article ids, section tree, counts). Fetch an article with articleId or parts with include; long parts continue with offset.consolidated: true, consolidatedAsOf, baseCelex and a note: quote them, cite the act as published in the Official Journal.asOfResolved, asOfVersion); unresolved hits keep the current text with an asOfReason, and the response warns about them.| 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 | Override for staging or self-hosting. |
LEXAPI_MCP_READ_ONLY | off | true hides (and refuses) every tool that is not read-only: webhook create / update / delete / test, and lex_extract_citations (it writes to the shared citation graph and costs credits). |
LEXAPI_TIMEOUT_MS | 55000 | Deadline for one tool call towards LexAPI, retries included. Raise it only together with your MCP client's own tool timeout. |
LEXAPI_MCP_ALLOWED_ORIGINS | *(none)* | Hosted HTTP server only: browser Origins allowed to call it (comma-separated, * for any). Requests without an Origin header (all non-browser clients) are always allowed. |
The key is sent only as the x-api-key header to LexAPI; it is never logged or included in tool output. A LEXAPI_API_KEY containing whitespace or control characters (e.g. a multi-line paste) is rejected at startup.
npm run start:http (or the Dockerfile) runs the Streamable HTTP transport (POST /v1, GET /health). Self-hosted, it accepts LexAPI API keys (Authorization: Bearer lex_… or x-api-key: lex_…); a request without one gets 401. A value that cannot be an API key (it contains a . or is longer than 8192 characters) is answered 401 and never forwarded.
| Env var | Default | Purpose |
|---|---|---|
PORT | 3000 | Listen port. |
LEXAPI_BASE_URL | https://lex-api.com/api/v1 | LexAPI REST base. |
Sign in with LexAPI is a feature of the hosted server at https://mcp.lex-api.com/v1: it needs an OAuth client registered with LexAPI, so a self-hosted copy runs with API keys only. The OAuth-related settings in src/oauth/config.ts (LEXAPI_OAUTH_*, LEXAPI_MCP_*) are for that deployment; the server refuses to start if they are set incompletely.
`/health` returns status
只显示了开头部分;其余内容请在仓库中阅读