Gb Eli Mcp

io.github.matematicsolutions由 GitHub 账号 matematicsolutions 发布v0.5.3更新于 Oct 24, 2026

MCP server for UK legislation, case law (Find Case Law), GOV.UK tribunal decisions and HMRC manuals.

概览

AI 生成的概览

让助手检索英国立法、判例法、GOV.UK 裁判文书和 HMRC 手册,并提供可核验的引用。

可以做什么
通过八个只读工具访问英国公开法律数据源。gb_search、gb_get_act、gb_get_text 和 gb_recent_legislation 覆盖 legislation.gov.uk(议会法案、法定文书,以及苏格兰、威尔士和北爱尔兰的同类文书)。gb_search_case_law 和 gb_get_case 查询国家档案馆的 Find Case Law。gb_search_govuk 和 gb_get_govuk_content 覆盖 GOV.UK 文档,例如裁判文书和 HMRC 手册章节,gb_coverage 说明覆盖与未覆盖范围。每条响应都带有稳定标识符 URI、可读引用和 source_url。
适用场景
适合助手需要查询英国法规或法定文书、查找或获取判决,或提取 GOV.UK 裁判文书与 HMRC 手册正文的场景,也适合要求答案引用可核验公开来源的场合。它面向法律、合规与研究检索,而非通用网页搜索。
运行要求
作为本地 Python 包运行(PyPI 包 gb-eli-mcp,通常用 uvx,或以 pip 安装后作为模块运行)。需要 Python,并能访问 legislation.gov.uk、caselaw.nationalarchives.gov.uk 和 www.gov.uk。无需 API 密钥或账号。可选环境变量用于设置基础 URL、缓存目录和审计目录。
安装前请注意
对公开数据源为只读,但每次工具调用都会追加到本地审计日志,搜索参数会离开本机。首次使用时可能从项目 GitHub Releases 获取一个小型配置文件;设置 GB_ELI_RUNTIME_URL="" 可关闭。内容采用 Open Government Licence v3.0,使用时需署名。在 Windows 11 上,Smart App Control 可能阻止 uvx、pip 和启动器可执行文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gb Eli Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

gb-eli-mcp

An MCP server for legislation.gov.uk, The National Archives' official portal for United Kingdom legislation. It searches and retrieves Acts of Parliament, UK Statutory Instruments, and the equivalent instruments of the Scottish Parliament, Senedd Cymru/Welsh Parliament and Northern Ireland Assembly, with persistent identifiers and verifiable citations.

Part of the MateMatic eu-legal-mcp production line: the UK counterpart of the Polish sejm-eli-mcp and the German de-eli-mcp, built on the same architecture and citation contract against the UK's own source.

No native ELI. legislation.gov.uk does not publish a native /eli/ namespace (confirmed live: GET /eli/ukpga/2018/12 returns 404), even though its own persistent-identifier scheme predates and is closely related to ELI - the UK is widely credited with pioneering the URI-based legislation-identifier concept that ELI later formalised EU-wide. eli_uri therefore carries the UK's own stable id URI (https://www.legislation.gov.uk/id/{type}/{year}/{number}) instead of a fabricated ELI path - the same disclosure pattern used by this factory's nl-eli-mcp and se-eli-mcp. See CONSTITUTION.md Art. 4.

Licence. Content is published under the Open Government Licence v3.0 (confirmed live from the site's own /help page), which permits copying, publishing and adapting with attribution. This connector only relays that public content, with a source_url on every response.

The nine tools

ToolWhat it does
gb_searchSearch legislation by text, doc type and year (/all/data.feed or /{doc_type}/data.feed).
gb_get_actFetch act/instrument metadata by reference (e.g. ukpga/2018/12).
gb_get_textFetch the full text (xml, html, akn/Akoma Ntoso, rdf, pdf, csv).
gb_recent_legislationLegislation published since a date, newest-first, optionally by doc type.
gb_search_case_lawSearch UK judgments via The National Archives' Find Case Law Atom feed, by text, court, and date range.
gb_get_caseFetch a judgment by neutral citation, Find Case Law URI/path, or opaque id - returns Akoma Ntoso XML, or a PDF link fallback.
gb_search_govukSearch GOV.UK documents via the keyless Search API - employment/tax/property tribunal decisions, HMRC internal manuals, CMA cases - with server-side date filters and real totals.
gb_get_govuk_contentFetch one GOV.UK document via the Content API - tribunal decisions return the judgment PDF link, HMRC manual sections return the full text.
gb_coverageDeclare what this connector covers, when each family was captured, and - explicitly - what it does NOT cover. Every gap carries a fallback.

GOV.UK coverage (added v0.3.0, feature-003)

One upstream, many institutions: gb_search_govuk filters by document_type. Live-verified totals (2026-07-07, from the Search API's own total/facet fields - probe: https://www.gov.uk/api/search.json?count=0&facet_content_store_document_type=1000):

document_typeDocuments
employment_tribunal_decision132,162
hmrc_manual_section85,315
residential_property_tribunal_decision17,088
employment_appeal_tribunal_decision2,571
cma_case2,565
utaac_decision (Upper Tribunal, AAC)2,031
tax_tribunal_decision1,414
asylum_support_decision101

See SOURCES.md for the full per-source ledger, including what was scouted and deliberately rejected (ICO, FCA, IAC) and why.

Every response carries the contract: eli_uri (e.g. https://www.legislation.gov.uk/id/ukpga/2018/12), human_readable_citation (e.g. Data Protection Act 2018 c. 12), and source_url. Case-law responses carry the same-spirit contract (human_readable_citation, source_url, dataset_note) - see CONSTITUTION.md Art. 5.

Install

As a Claude plugin (Claude Code or the desktop app, needs uv); see plugin/README.md for what it sends and stores:

/plugin marketplace add matematicsolutions/gb-eli-mcp/plugin install gb-eli-mcp@gb-eli-mcp

As a standalone server, from PyPI (uvx gb-eli-mcp), or from source:

bash
cd gb-eli-mcppip install -e .

Configure (Claude Code / any MCP client)

Copy .mcp.json.example and adjust if needed:

json
{  "mcpServers": {    "gb-eli-mcp": { "command": "gb-eli-mcp" }  }}

Windows 11 with Smart App Control

Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe and the gb-eli-mcp.exe launcher that pip writes at install time. The python.exe and py.exe from the python.org installer are signed by the Python Software Foundation, so running the module through the interpreter works:

bash
python -m pip install gb-eli-mcppython -m gb_eli_mcp

pip.exe is blocked for the same reason, so install with python -m pip, not pip install. If python is not on PATH, use the Windows launcher: py -3 -m gb_eli_mcp.

json
{ "mcpServers": { "gb-eli-mcp": { "command": "python", "args": ["-m", "gb_eli_mcp"] } } }

Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.

Environment:

  • GB_ELI_BASE_URL - default https://www.legislation.gov.uk
  • GB_ELI_CASELAW_BASE_URL - default https://caselaw.nationalarchives.gov.uk
  • GB_ELI_GOVUK_BASE_URL - default https://www.gov.uk
  • GB_ELI_CACHE_DIR - default ~/.matematic/cache/gb-eli
  • GB_ELI_AUDIT_DIR - default ~/.matematic/audit

No API key. legislation.gov.uk is keyless.

Governance

  • Public data only - read-only against legislation.gov.uk, Find Case Law and GOV.UK; no client data leaves the machine beyond search parameters.
  • Audit log - every tool call appends one JSON line to ~/.matematic/audit/gb-eli-mcp.jsonl.
  • Network - the server talks to legislation.gov.uk, caselaw.nationalarchives.gov.uk, www.gov.uk and the local filesystem. Once, on first use, it also fetches a small configuration file (gb-runtime.json.gz, updated source addresses) from this repository's GitHub Releases. That request carries no query content; GitHub's download counter for the file is the only usage signal we see. GB_ELI_RUNTIME_URL="" turns it off; the Claude plugin ships with it off. No LLM provider, no other telemetry.
  • Verifiable citations - every response is independently checkable via source_url.

See CONSTITUTION.md (the binding rules) and DISCOVERY.md (the live API probe).

Tests

bash
pip install -e ".[dev]"pytest tests/test_instructions_drift.py -v   # offlinepytest tests/test_citations_case_law.py -v   # offlinepytest tests/test_citations_govuk.py -v      # offlinepytest tests/test_smoke.py -v                # hits live legislation.gov.ukpytest tests/test_smoke_case_law.py -v       # hits live caselaw.nationalarchives.gov.ukpytest tests/test_smoke_govuk.py -v          # hits live www.gov.uk

Licence

Apache-2.0. (c) Matematic Solutions / Wieslaw Mazur.

Note: the code in this repository is Apache-2.0. The legislation content fetched at runtime from legislation.gov.uk remains Crown copyright, published under the Open Government Licence v3.0 - not relicensed by this project.

来源:README.md,提交 6f77dc1

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分