{
  "markdown": "# UK Law MCP Server\n\n<!-- ANSVAR-CTA-BEGIN -->\n> **The UK law corpus is now served through the Ansvar Gateway.** Connect your AI assistant (Claude, Copilot, Cursor, custom MCP client) to `https://gateway.ansvar.eu/mcp` — one OAuth connection, free tier available, covering this corpus plus EU regulations, national law across 28 audited jurisdictions, and CVE/security intelligence, every result with a verbatim source citation. Start at https://ansvar.eu/docs/quickstart\n\n### Connect\n\n**Claude Code** (one line):\n\n```bash\nclaude mcp add ansvar --transport http https://gateway.ansvar.eu/mcp\n```\n\n**Claude Desktop / Cursor** — add to `claude_desktop_config.json` (or `mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"ansvar\": {\n      \"type\": \"url\",\n      \"url\": \"https://gateway.ansvar.eu/mcp\"\n    }\n  }\n}\n```\n\n**Claude.ai** — Settings → Connectors → Add custom connector → paste `https://gateway.ansvar.eu/mcp`\n\nFirst request opens an OAuth signup flow (setup details: [ansvar.eu/docs/quickstart](https://ansvar.eu/docs/quickstart)). After signup, your client is bound to your account; tier (free / premium / team / company) determines fan-out, quota, and which downstream MCPs are reachable.\n\n---\n\n## Self-host this MCP\n\nYou can also clone this repo and build the corpus yourself. The schema,\nfetcher, and tool implementations all live here. What is not in the repo is\nthe pre-built database — TDM and standards-licensing constraints on the\nupstream sources mean we host the corpus on Ansvar infrastructure rather\nthan redistribute it as a public artifact.\n\nBuild your own: run this repo's ingestion script (entry-point varies per\nrepo — typically `scripts/ingest.sh`, `npm run ingest`, or `make ingest`;\ncheck the repo root).\n<!-- ANSVAR-CTA-END -->\n\n\n**The legislation.gov.uk alternative for the AI age.**\n\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![GitHub stars](https://img.shields.io/github/stars/Ansvar-Systems/UK-law-mcp?style=social)](https://github.com/Ansvar-Systems/UK-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/UK-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/UK-law-mcp/actions/workflows/ci.yml)\n[![Daily Data Check](https://github.com/Ansvar-Systems/UK-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/UK-law-mcp/actions/workflows/check-updates.yml)\n[![Database](https://img.shields.io/badge/database-pre--built-green)](docs/EU_INTEGRATION_GUIDE.md)\n[![Provisions](https://img.shields.io/badge/provisions-512%2C651-blue)](docs/EU_INTEGRATION_GUIDE.md)\n\nQuery **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.\n\nIf you're building legal tech, compliance tools, or doing UK legal research, this is your verified reference database.\n\nBuilt by [Ansvar Systems](https://ansvar.eu) -- Stockholm, Sweden\n\n---\n\n## Why This Exists\n\nUK legal research is scattered across legislation.gov.uk, BAILII, and EUR-Lex retained EU law indexes. Whether you're:\n- A **lawyer** validating citations in a brief or contract\n- A **compliance officer** checking if a statute is still in force or has been amended post-Brexit\n- A **legal tech developer** building tools on UK law\n- A **researcher** tracing legislative history from Bill to Act\n\n...you shouldn't need dozens of browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes UK law **searchable, cross-referenceable, and AI-readable**.\n\n---\n\n## Example Queries\n\nOnce connected, just ask naturally:\n\n- *\"What does the UK GDPR say about data subject rights?\"*\n- *\"Is the Computer Misuse Act still in force?\"*\n- *\"Find provisions about employment rights under the Employment Rights Act 1996\"*\n- *\"What EU adequacy status does the UK hold post-Brexit?\"*\n- *\"Which UK laws implement the equivalent of the NIS2 Directive?\"*\n- *\"Get the text of Section 7 of the Data Protection Act 2018\"*\n- *\"Compare data breach notification requirements across UK GDPR and DPA 2018\"*\n- *\"Validate the citation 'Computer Misuse Act 1990, s.1'\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Statutes** | 3,241 statutes | Acts of Parliament from legislation.gov.uk |\n| **Provisions** | 512,651 sections | Full-text searchable with FTS5 |\n| **Case Law** | 65,026 judgments | Premium tier -- court decisions and tribunal rulings |\n| **Preparatory Works** | 3,838 documents | Explanatory Notes and Hansard references |\n| **Database Size** | ~3,606 MB | Comprehensive SQLite, includes full provision text |\n| **Daily Updates** | Automated | Freshness checks against legislation.gov.uk |\n\n**Verified data only** -- every citation is validated against official sources (legislation.gov.uk). Zero LLM-generated content.\n\n---\n\n## See It In Action\n\n### Why This Works\n\n**Verbatim Source Text (No LLM Processing):**\n- All statute text is ingested from legislation.gov.uk official sources\n- Provisions are returned **unchanged** from SQLite FTS5 database rows\n- Zero LLM summarization or paraphrasing -- the database contains statute text, not AI interpretations\n\n**Smart Context Management:**\n- Search returns ranked provisions with BM25 scoring (safe for context)\n- Provision retrieval gives exact text by Act name and section number\n- Cross-references help navigate without loading everything at once\n\n**Technical Architecture:**\n```\nlegislation.gov.uk API --> Parse --> SQLite --> FTS5 snippet() --> MCP response\n                             ^                        ^\n                      Provision parser         Verbatim database query\n```\n\n### Traditional Research vs. This MCP\n\n| Traditional Approach | This MCP Server |\n|---------------------|-----------------|\n| Search legislation.gov.uk by Act name | Search by plain English: *\"data subject access request\"* |\n| Navigate multi-part statutes manually | Get the exact provision with context |\n| Manual cross-referencing between Acts | `build_legal_stance` aggregates across sources |\n| \"Is this statute still in force?\" -- check manually | `check_currency` tool -- answer in seconds |\n| Find EU alignment -- dig through retained EU law index | `get_eu_basis` -- linked EU instruments instantly |\n| Check 5+ sites for amendments | Daily automated freshness checks |\n| No API, no integration | MCP protocol -- AI-native |\n\n**Traditional:** Search legislation.gov.uk --> Download PDF --> Ctrl+F --> Cross-reference with Explanatory Notes --> Check for amendments --> Repeat\n\n**This MCP:** *\"What does the UK GDPR say about data subject rights and how does it differ from the EU GDPR?\"* --> Done.\n\n---\n\n## Available Tools (13)\n\n### Core Legal Research Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `search_legislation` | FTS5 search on 512,651 provisions with BM25 ranking |\n| `get_provision` | Retrieve specific provision by Act name and section number |\n| `validate_citation` | Validate citation against database (zero-hallucination check) |\n| `build_legal_stance` | Aggregate citations from statutes, case law, and preparatory works |\n| `format_citation` | Format citations per UK conventions (full/short/pinpoint) |\n| `check_currency` | Check if statute is in force, amended, or repealed |\n| `list_sources` | List all available statutes with metadata and data provenance |\n| `about` | Server info, capabilities, dataset statistics, and coverage summary |\n\n### EU/International Law Integration Tools (5)\n\n| Tool | Description |\n|------|-------------|\n| `get_eu_basis` | Get EU instruments that UK statutes derive from or align with |\n| `get_uk_implementations` | Find UK laws implementing or derived from a specific EU act |\n| `search_eu_implementations` | Search EU documents with UK implementation and retention counts |\n| `get_provision_eu_basis` | Get EU law references for a specific UK provision |\n| `validate_eu_compliance` | Check UK implementation or adequacy status against EU directives |\n\n---\n\n## EU Law Integration\n\nThe 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.\n\n| Topic | Status |\n|-------|--------|\n| **EU Adequacy Decision** | UK holds GDPR Article 45 adequacy decisions for England, Wales, Scotland, Northern Ireland, and Gibraltar (granted June 2021) |\n| **Retained EU Law** | Significant body of EU-derived law was retained at exit under the European Union (Withdrawal) Act 2018, now progressively reviewed |\n| **UK GDPR** | Near-identical to EU GDPR with UK-specific modifications -- the EU tools show alignment between UK GDPR and EU GDPR |\n| **NIS Regulations** | UK implemented NIS before Brexit; UK NIS 2 equivalent under development |\n\nThe 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.\n\n> **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.\n\n---\n\n## Data Sources & Freshness\n\nAll content is sourced from authoritative UK legal databases:\n\n- **[legislation.gov.uk](https://www.legislation.gov.uk/)** -- The official UK legislation database (National Archives)\n- **[BAILII](https://www.bailii.org/)** -- British and Irish Legal Information Institute (case law, premium tier)\n\n### Data Provenance\n\n| Field | Value |\n|-------|-------|\n| **Authority** | The National Archives / King's Printer |\n| **Retrieval method** | legislation.gov.uk API |\n| **Language** | English |\n| **License** | Open Parliament Licence / Open Government Licence |\n| **Coverage** | 3,241 Acts from legislation.gov.uk |\n\n### Automated Freshness Checks (Daily)\n\nA [daily GitHub Actions workflow](.github/workflows/check-updates.yml) monitors legislation.gov.uk for changes:\n\n| Check | Method |\n|-------|--------|\n| **Statute amendments** | Drift detection against known provision anchors |\n| **New statutes** | Comparison against legislation.gov.uk index |\n| **Repealed statutes** | Status change detection |\n\n**Verified data only** -- every citation is validated against official sources. Zero LLM-generated content.\n\n---\n\n## Security\n\nThis project uses multiple layers of automated security scanning:\n\n| Scanner | What It Does | Schedule |\n|---------|-------------|----------|\n| **CodeQL** | Static analysis for security vulnerabilities | Weekly + PRs |\n| **Semgrep** | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push |\n| **Gitleaks** | Secret detection across git history | Every push |\n| **Trivy** | CVE scanning on filesystem and npm dependencies | Daily |\n| **Docker Security** | Container image scanning + SBOM generation | Daily |\n| **Socket.dev** | Supply chain attack detection | PRs |\n| **OSSF Scorecard** | OpenSSF best practices scoring | Weekly |\n| **Dependabot** | Automated dependency updates | Weekly |\n\nSee [SECURITY.md](SECURITY.md) for the full policy and vulnerability reporting.\n\n---\n\n## Important Disclaimers\n\n### Legal Advice\n\n> **THIS TOOL IS NOT LEGAL ADVICE**\n>\n> Statute text is sourced from legislation.gov.uk (The National Archives). However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Court case coverage is in the premium tier** -- do not rely solely on this for case law research without the premium database\n> - **Verify critical citations** against primary sources for court filings\n> - **EU cross-references** reflect derivation and alignment, not current EU membership\n> - **Northern Ireland** has specific post-Brexit legal arrangements (Windsor Framework) that may not be fully reflected\n\n**Before using professionally, read:** [DISCLAIMER.md](DISCLAIMER.md) | [PRIVACY.md](PRIVACY.md)\n\n### Client Confidentiality\n\nQueries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See [PRIVACY.md](PRIVACY.md) for Law Society compliance guidance.\n\n> For guidance from your bar association: **The Law Society** (England & Wales) | **Law Society of Scotland** | **Law Society of Northern Ireland**\n\n---\n\n## Documentation\n\n- **[EU Integration Guide](docs/EU_INTEGRATION_GUIDE.md)** -- Detailed EU cross-reference documentation\n- **[EU Usage Examples](docs/EU_USAGE_EXAMPLES.md)** -- Practical EU lookup examples\n- **[Security Policy](SECURITY.md)** -- Vulnerability reporting and scanning details\n- **[Disclaimer](DISCLAIMER.md)** -- Legal disclaimers and professional use notices\n- **[Privacy](PRIVACY.md)** -- Client confidentiality and data handling\n\n---\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/Ansvar-Systems/UK-law-mcp\ncd UK-law-mcp\nnpm install\nnpm run build\nnpm test\n```\n\n### Running Locally\n\n```bash\nnpm run dev                                       # Start MCP server\nnpx @anthropic/mcp-inspector node dist/index.js   # Test with MCP Inspector\n```\n\n### Data Management\n\n```bash\nnpm run ingest                    # Ingest statutes from legislation.gov.uk\nnpm run build:db                  # Rebuild SQLite database\nnpm run drift:detect              # Run drift detection against anchors\nnpm run check-updates             # Check for amendments and new Acts\n```\n\n### Performance\n\n- **Search Speed:** <100ms for most FTS5 queries\n- **Database Size:** ~3,606 MB (comprehensive -- full UK statute corpus)\n- **Reliability:** 100% ingestion success rate across 3,241 statutes\n\n---\n\n## More Ansvar MCPs\n\nFull fleet coverage at [ansvar.eu/coverage](https://ansvar.eu/coverage).\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nPriority areas:\n- Court case law expansion (BAILII integration)\n- Northern Ireland-specific legal provisions\n- Scottish law divergence tracking\n- Historical statute versions and amendment tracking\n\n---\n\n## Roadmap\n\n- [x] Core statute database with FTS5 search\n- [x] Full corpus ingestion (3,241 statutes, 512,651 provisions)\n- [x] EU/international law alignment tools\n- [x] Vercel Streamable HTTP deployment\n\n- [x] Daily freshness checks against legislation.gov.uk\n- [x] Premium case law (65,026 judgments)\n- [x] Premium preparatory works (3,838 documents)\n- [ ] Northern Ireland Windsor Framework annotations\n- [ ] Scottish law divergence markers\n- [ ] Historical statute versions (amendment tracking)\n- [ ] Welsh language provision coverage\n\n---\n\n## Citation\n\nIf you use this MCP server in academic research:\n\n```bibtex\n@software{uk_law_mcp_2026,\n  author = {Ansvar Systems AB},\n  title = {UK Law MCP Server: Production-Grade Legal Research Tool},\n  year = {2026},\n  url = {https://github.com/Ansvar-Systems/UK-law-mcp},\n  note = {3,241 UK statutes with 512,651 provisions sourced from legislation.gov.uk}\n}\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE) for details.\n\n### Data Licenses\n\n- **Statutes & Legislation:** `OGL-3.0` — UK Crown copyright under CDPA 1988 ss. 163–164 with an explicit Open Government Licence v3.0 grant on [legislation.gov.uk](https://www.legislation.gov.uk). UK is NOT a statutory-PD regime; the open-licence grant is the operative permission. Commercial reuse permitted with attribution; no share-alike. Required attribution text: \"Contains public sector information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).\" UK Parliamentary content (Hansard, bills) is Parliamentary copyright (not Crown copyright) and falls under the separate Open Parliament Licence v3.0. Verified 2026-05-17.\n- **Case Law:** BAILII (used under terms of service, premium tier)\n- **EU Metadata:** EUR-Lex (EU public domain)\n\n---\n\n## About Ansvar Systems\n\nWe 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.\n\n**[ansvar.eu](https://ansvar.eu)** -- Stockholm, Sweden\n\n---\n\n<p align=\"center\">\n  <sub>Built with care in Stockholm, Sweden</sub>\n</p>\n",
  "bytes": 16318,
  "sha": "2004a52b443bde77c38256704b32bcc321f457bcb86e4c4156d3d6f3d5a1e0be",
  "repo_slug": "ansvar-systems/uk-law-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_eu_ansvar_uk_law_mcp_2249dae9/readme"
}