
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.
概覽
讓助理檢索英國立法、判例法、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、快取目錄與稽核目錄。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Gb Eli Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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/12returns 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_uritherefore 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'snl-eli-mcpandse-eli-mcp. SeeCONSTITUTION.mdArt. 4.Licence. Content is published under the Open Government Licence v3.0 (confirmed live from the site's own
/helppage), which permits copying, publishing and adapting with attribution. This connector only relays that public content, with asource_urlon every response.
The nine tools
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):
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:
As a standalone server, from PyPI (uvx gb-eli-mcp), or from source:
Configure (Claude Code / any MCP client)
Copy .mcp.json.example and adjust if needed:
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:
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.
Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.
Environment:
GB_ELI_BASE_URL- defaulthttps://www.legislation.gov.ukGB_ELI_CASELAW_BASE_URL- defaulthttps://caselaw.nationalarchives.gov.ukGB_ELI_GOVUK_BASE_URL- defaulthttps://www.gov.ukGB_ELI_CACHE_DIR- default~/.matematic/cache/gb-eliGB_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
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版本歷史
1- v0.5.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分