
Lex
MCPUK legal research service from i.AI, the UK government's AI incubator, with a remote MCP: semantic search over UK legislation, amendments and explanatory notes. Connect directly, no account. Officially experimental; case law is temporarily disabled and results need a lawyer's review.
Lex
UK legal API for AI agents and researchers. Access comprehensive UK legislation data with semantic search and Model Context Protocol integration.
What is Lex?
Lex provides programmatic access to 8.4M+ UK legal documents - legislation, amendments, and explanatory notes - with hybrid semantic search.
This is an experimental service and should not be used as a production dependency.
Dataset Coverage
- Legislation - 220K Acts and Statutory Instruments (1267-present, complete from 1963)
- Amendments - 892K legislative changes and modifications
- Explanatory Notes - 89K notes providing legislative context
- Case Law - 70K judgments and 4.7M paragraphs (temporarily disabled pending TNA licence)
- PDF Digitisation - Historical legislation (pre-1963) digitised using AI
What Can You Build?
- Legal Research - Find relevant legislation in seconds
- Policy Analysis - Track legislative changes over time
- AI Grounding - Ground AI assistants in authoritative UK legal sources
MCP Integration
Connect AI assistants to Lex via Model Context Protocol. See the live documentation for setup instructions for:
- Claude Desktop
- Claude Code
- Cursor
- Microsoft Copilot Studio
- VS Code + GitHub Copilot
Local Development
Prerequisites
- Python 3.12+
- uv
- Docker & Docker Compose
- Azure OpenAI credentials
Quick Start
# Clone and setup
git clone https://github.com/i-dot-ai/lex.git && cd lex
cp .env.example .env # Add your Azure OpenAI keys
# Start services and load sample data
docker compose up -d
make ingest-all-sample
# Visit http://localhost:8000/docs for API documentation
Data Loading
# Quick samples (recommended for testing)
make ingest-legislation-sample
make ingest-all-sample
# Full datasets (production use)
make ingest-legislation-full
make ingest-all-full
# Create indexes for fast filtering
uv run python scripts/create_payload_indexes.py
Development Commands
make install # Install dependencies
make test # Run tests
make run # Start API locally (without Docker)
uv run ruff format . # Format code
Architecture
lex/
├── src/
│ ├── lex/ # Data pipeline (scraping, parsing, indexing)
│ └── backend/ # API server (FastAPI + MCP)
├── infrastructure/ # Azure Bicep templates and deploy scripts
├── scripts/ # Maintenance, migration, and export utilities
├── tests/ # Test suite
└── docs/ # Documentation
Documentation
- System Architecture - Start here for the full picture
- Deployment Guide
- Operations Runbook
- Data Pipeline Guide
- API Reference
- Troubleshooting
- Contributing
Acknowledgements
Built with support from The National Archives and Ministry of Justice.
License
MIT - See LICENSE for details.
관련 리소스

Korean Law MCP
MCPSearches Korean statutes, case law, administrative rules and local ordinances via the Korean Ministry of Government Legislation's Open API, verifies whether cited provisions and cases exist, and compares versions over time. Needs a free API key and Node.js; have a lawyer review results.
chrisryugj/korean-law-mcp2.7k
SEC EDGAR MCP
MCPQueries SEC EDGAR 10-K, 10-Q and 8-K filings, XBRL financial statements and insider trades, with links to the source documents for checking; for investment research and compliance due diligence. Free, no API key; needs uv and a SEC_EDGAR_USER_AGENT with your name and email.
stefanoamorelli/sec-edgar-mcp372
Vaquill MCP
MCPVaquill's official legal research MCP: search US federal and state codes, CFR, constitutions, court rules and the Federal Register, resolve Bluebook citations to statute text, plus Indian law. Needs a credit-based API key (non-commercial users can request free credits). A lawyer must review.
Vaquill-AI/vaquill-mcp8
brief
SkillThree kinds of briefs for legal teams: daily briefs of to-dos and deadlines from email, calendar and contracts; topic briefs on a legal question; and incident briefs for breaches, litigation threats or regulator inquiries. Needs email and calendar tools. From Anthropic; not legal advice.
anthropics/knowledge-work-plugins29.9k
Claude for Legal
PluginAnthropic's official legal plugin marketplace: 13 plugins covering commercial contracts, privacy, product counsel, M&A, employment, regulatory, AI governance, litigation and IP, plus plugins for law school clinics and law students. All output is a draft for attorney review.
anthropics/claude-for-legal9.7k
Regulatory Legal
PluginAnthropic's official regulatory compliance plugin: monitors sources like the Federal Register, compares new rules with your policy library to find gaps, tracks comment deadlines and open gaps, and drafts policy revisions and weekly regulatory digests. Outputs are drafts for attorney review.
anthropics/claude-for-legal9.7k