gb-eli-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gb-eli-mcpShow me the Data Protection Act 2018"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 six tools
Tool | What it does |
| Search legislation by text, doc type and year ( |
| Fetch act/instrument metadata by reference (e.g. |
| Fetch the full text ( |
| Legislation published since a date, newest-first, optionally by doc type. |
| Search UK judgments via The National Archives' Find Case Law Atom feed, by text, court, and date range. |
| Fetch a judgment by neutral citation, Find Case Law URI/path, or opaque id - returns Akoma Ntoso XML, or a PDF link fallback. |
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.
Related MCP server: UK Case Law MCP Server
Install
cd gb-eli-mcp
pip install -e .Configure (Claude Code / any MCP client)
Copy .mcp.json.example and adjust if needed:
{
"mcpServers": {
"gb-eli-mcp": { "command": "gb-eli-mcp" }
}
}Environment:
GB_ELI_BASE_URL- defaulthttps://www.legislation.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; 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.Vendor-neutral - the server talks only to legislation.gov.uk and the local filesystem; no LLM provider, no 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
pip install -e ".[dev]"
pytest tests/test_instructions_drift.py -v # offline
pytest tests/test_citations_case_law.py -v # offline
pytest tests/test_smoke.py -v # hits live legislation.gov.uk
pytest tests/test_smoke_case_law.py -v # hits live caselaw.nationalarchives.gov.ukLicence
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.
This server cannot be installed
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/matematicsolutions/gb-eli-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server