UK legislation via MCP — full-text search across statutes and provisions
UK legislation via MCP — full-text search across statutes and provisions
Valid MCP server (3 strong, 2 medium validity signals). 5 known CVEs in dependencies (0 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (156/157 approved).
5 files analyzed · 6 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"eu-ansvar-uk-law-mcp": {
"args": [
"-y",
"@ansvar/uk-law-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
The legislation.gov.uk alternative for the AI age.
Query 3,241 UK statutes -- from the UK GDPR and Computer Misuse Act to the Employment Rights Act, Companies Act, and more -- directly from Claude, Cursor, or any MCP-compatible client.
If you're building legal tech, compliance tools, or doing UK legal research, this is your verified reference database.
Built by Ansvar Systems -- Stockholm, Sweden
UK legal research is scattered across legislation.gov.uk, BAILII, and EUR-Lex retained EU law indexes. Whether you're:
...you shouldn't need dozens of browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.
This MCP server makes UK law searchable, cross-referenceable, and AI-readable.
Connect directly to the hosted version -- zero dependencies, nothing to install.
Endpoint: https://mcp.ansvar.eu/law-gb/mcp
| Client | How to Connect |
|---|---|
| Claude.ai | Settings > Connectors > Add Integration > paste URL |
| Claude Code | claude mcp add uk-law --transport http https://mcp.ansvar.eu/law-gb/mcp |
| Claude Desktop | Add to config (see below) |
| GitHub Copilot | Add to VS Code settings (see below) |
Claude Desktop -- add to claude_desktop_config.json:
{
"mcpServers": {
"uk-law": {
"type": "url",
"url": "https://mcp.ansvar.eu/law-gb/mcp"
}
}
}
GitHub Copilot -- add to VS Code settings.json:
{
"github.copilot.chat.mcp.servers": {
"uk-law": {
"type": "http",
"url": "https://mcp.ansvar.eu/law-gb/mcp"
}
}
}
npx @ansvar/uk-law-mcp
Claude Desktop -- add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"uk-law": {
"command": "npx",
"args": ["-y", "@ansvar/uk-law-mcp"]
}
}
}
Cursor / VS Code:
{
"mcp.servers": {
"uk-law": {
"command": "npx",
"args": ["-y", "@ansvar/uk-law-mcp"]
}
}
}
Once connected, just ask naturally:
| Category | Count | Details |
|---|---|---|
| Statutes | 3,241 statutes | Acts of Parliament from legislation.gov.uk |
| Provisions | 512,651 sections | Full-text searchable with FTS5 |
| Case Law | 65,026 judgments | Premium tier -- court decisions and tribunal rulings |
| Preparatory Works | 3,838 documents | Explanatory Notes and Hansard references |
| Database Size | ~3,606 MB | Comprehensive SQLite, includes full provision text |
| Daily Updates | Automated | Freshness checks against legislation.gov.uk |
Verified data only -- every citation is validated against official sources (legislation.gov.uk). Zero LLM-generated content.
Verbatim Source Text (No LLM Processing):
Smart Context Management:
Technical Architecture:
legislation.gov.uk API --> Parse --> SQLite --> FTS5 snippet() --> MCP response
^ ^
Provision parser Verbatim database query
| Traditional Approach | This MCP Server |
|---|---|
| Search legislation.gov.uk by Act name | Search by plain English: "data subject access request" |
| Navigate multi-part statutes manually | Get the exact provision with context |
| Manual cross-referencing between Acts | build_legal_stance aggregates across sources |
| "Is this statute still in force?" -- check manually | check_currency tool -- answer in seconds |
| Find EU alignment -- dig through retained EU law index | get_eu_basis -- linked EU instruments instantly |
| Check 5+ sites for amendments | Daily automated freshness checks |
| No API, no integration | MCP protocol -- AI-native |
Traditional: Search legislation.gov.uk --> Download PDF --> Ctrl+F --> Cross-reference with Explanatory Notes --> Check for amendments --> Repeat
This MCP: "What does the UK GDPR say about data subject rights and how does it differ from the EU GDPR?" --> Done.
| Tool | Description |
|---|---|
search_legislation | FTS5 search on 512,651 provisions with BM25 ranking |
get_provision | Retrieve specific provision by Act name and section number |
validate_citation | Validate citation against database (zero-hallucination check) |
build_legal_stance | Aggregate citations from statutes, case law, and preparatory works |
format_citation | Format citations per UK conventions (full/short/pinpoint) |
check_currency | Check if statute is in force, amended, or repealed |
list_sources | List all available statutes with metadata and data provenance |
about | Server info, capabilities, dataset statistics, and coverage summary |
| Tool | Description |
|---|---|
get_eu_basis | Get EU instruments that UK statutes derive from or align with |
get_uk_implementations | Find UK laws implementing or derived from a specific EU act |
search_eu_implementations | Search EU documents with UK implementation and retention counts |
get_provision_eu_basis | Get EU law references for a specific UK provision |
validate_eu_compliance | Check UK implementation or adequacy status against EU directives |
The UK left the EU on 31 January 2020. The relationship between UK law and EU law is now one of adequacy and alignment, not membership.
| Topic | Status |
|---|---|
| EU Adequacy Decision | UK holds GDPR Article 45 adequacy decisions for England, Wales, Scotland, Northern Ireland, and Gibraltar (granted June 2021) |
| Retained EU Law | Significant body of EU-derived law was retained at exit under the European Union (Withdrawal) Act 2018, now progressively reviewed |
| UK GDPR | Near-identical to EU GDPR with UK-specific modifications -- the EU tools show alignment between UK GDPR and EU GDPR |
| NIS Regulations | UK implemented NIS before Brexit; UK NIS 2 equivalent under development |
The EU bridge tools in this MCP let you trace which UK statutes derive from EU directives, which provisions align with EU regulatory requirements, and where post-Brexit divergence has occurred.
Note: EU cross-references reflect derivation and alignment relationships. The UK is no longer subject to EU law, but understanding the EU origin of UK statutes is essential for cross-border compliance work.
All content is sourced from authoritative UK legal databases:
| Field | Value |
|---|---|
| Authority | The National Archives / King's Printer |
| Retrieval method | legislation.gov.uk API |
| Language | English |
| License | Open Parliament Licence / Open Government Licence |
| Coverage | 3,241 Acts from legislation.gov.uk |
A daily GitHub Actions workflow monitors legislation.gov.uk for changes:
| Check | Method |
|---|---|
| Statute amendments | Drift detection against known provision anchors |
| New statutes | Comparison against legislation.gov.uk index |
| Repealed statutes | Status change detection |
Verified data only -- every citation is validated against official sources. Zero LLM-generated content.
This project uses multiple layers of automated security scanning:
| Scanner | What It Does | Schedule |
|---|---|---|
| CodeQL | Static analysis for security vulnerabilities | Weekly + PRs |
| Semgrep | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push |
| Gitleaks | Secret detection across git history | Every push |
| Trivy | CVE scanning on filesystem and npm dependencies | Daily |
| Docker Security | Container image scanning + SBOM generation | Daily |
| Socket.dev | Supply chain attack detection | PRs |
| OSSF Scorecard | OpenSSF best practices scoring | Weekly |
| Dependabot | Automated dependency updates | Weekly |
See SECURITY.md for the full policy and vulnerability reporting.
THIS TOOL IS NOT LEGAL ADVICE
Statute text is sourced from legislation.gov.uk (The National Archives). However:
- This is a research tool, not a substitute for professional legal counsel
- Court case coverage is in the premium tier -- do not rely solely on this for case law research without the premium database
- Verify critical citations against primary sources for court filings
- EU cross-references reflect derivation and alignment, not current EU membership
- Northern Ireland has specific post-Brexit legal arrangements (Windsor Framework) that may not be fully reflected
Before using professionally, read: DISCLAIMER.md | PRIVACY.md
Queries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See PRIVACY.md for Law Society compliance guidance.
For guidance from your bar association: The Law Society (England & Wales) | Law Society of Scotland | Law Society of Northern Ireland
git clone https://github.com/Ansvar-Systems/UK-law-mcp
cd UK-law-mcp
npm install
npm run build
npm test
npm run dev # Start MCP server
npx @anthropic/mcp-inspector node dist/index.js # Test with MCP Inspector
npm run ingest # Ingest statutes from legislation.gov.uk
npm run build:db # Rebuild SQLite database
npm run drift:detect # Run drift detection against anchors
npm run check-updates # Check for amendments and new Acts
This server is part of Ansvar's Compliance Suite -- MCP servers that work together for end-to-end compliance coverage:
Query 49 EU regulations directly from Claude -- GDPR, AI Act, DORA, NIS2, MiFID II, eIDAS, and more. Full regulatory text with article-level search. npx @ansvar/eu-regulations-mcp
Query 3,241 UK statutes directly from Claude -- UK GDPR, DPA 2018, Computer Misuse Act, Employment Rights Act, and more. Full provision text with EU derivation cross-references. npx @ansvar/uk-law-mcp
Query US federal and state compliance laws -- HIPAA, CCPA, SOX, GLBA, FERPA, and more. npx @ansvar/us-regulations-mcp
Query 261 security frameworks -- ISO 27001, NIST CSF, SOC 2, CIS Controls, SCF, and more. npx @ansvar/security-controls-mcp
Query UNECE R155/R156 and ISO 21434 -- Automotive cybersecurity compliance. npx @ansvar/automotive-cybersecurity-mcp
Offline-capable sanctions screening -- OFAC, EU, UN sanctions lists. pip install ansvar-sanctions-mcp
70+ national law MCPs covering Australia, Brazil, Canada, Chile, Denmark, Finland, France, Germany, Ireland, Italy, Japan, Netherlands, Norway, Peru, Sweden, Switzerland, and more.
Contributions welcome! See CONTRIBUTING.md for guidelines.
Priority areas:
If you use this MCP server in academic research:
@software{uk_law_mcp_2026,
author = {Ansvar Systems AB},
title = {UK Law MCP Server: Production-Grade Legal Research Tool},
year = {2026},
url = {https://github.com/Ansvar-Systems/UK-law-mcp},
note = {3,241 UK statutes with 512,651 provisions sourced from legislation.gov.uk}
}
Apache License 2.0. See LICENSE for details.
We build AI-accelerated compliance and legal research tools for the global market. This MCP server makes 3,241 UK statutes searchable from any AI client -- no browser tabs, no PDFs, no manual cross-referencing.
ansvar.eu -- Stockholm, Sweden
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.