
Lex
MCP英国政府 AI 孵化器(i.AI)出品的英国法律检索服务,提供远程 MCP:语义检索英国法律与条例、修订记录和立法说明。直接连接、无需账号;官方标注为实验性服务,判例库暂时停用,结果需律师复核。
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
MCP基于韩国法制处 Open API 检索韩国法令、判例、行政规则与自治法规,能核验引用的条文和判例是否真实存在、对比不同时间点的条文版本,适合处理涉韩法律事务。需免费申请法制处 API Key 并安装 Node.js;结果需律师复核。
chrisryugj/korean-law-mcp2.7k
SEC EDGAR MCP
MCP查询美国 SEC EDGAR 的 10-K、10-Q、8-K 公告、XBRL 财务报表和内部人交易,结果附原文链接便于核对,适合投资研究、财务分析与证券合规尽调。免费无需 API Key,需装 uv 并填写含姓名邮箱的 SEC_EDGAR_USER_AGENT;结论需专业人员复核。
stefanoamorelli/sec-edgar-mcp372
Vaquill MCP
MCP法律研究服务商 Vaquill 官方 MCP,检索美国联邦与 50 州法典、CFR 法规、宪法、法院规则和联邦公报,可把 Bluebook 法条引注直接解析到条文,另有印度法律库。需注册获取 API Key,按积分计费;非商业用途可邮件申请免费额度。结果须由律师复核。
Vaquill-AI/vaquill-mcp8
法律之星 MCP(LawStar MCP)
MCP法律之星(law-star.com)提供的云端 MCP,可按语义检索中国法律法规、按法名和条号调取条文原文(含历史版本),并核验 AI 引用的法条是否准确。需在法律之星开放平台创建 API Key,按积分计费、免费层每日限量;结果须由律师等专业人员复核。
law-star-cn/lawstar-mcp0
CN Law Hub
Skill中国法条检索技能:从国家法律法规数据库、国家规章库、司法部、最高法等 10 个官方来源检索并核验法规原文,支持按条号查条文、跨法规搜关键词、筛选现行有效版本和下载全文。需本地 Python 3.10+ 并安装依赖,另有可选 MCP 版;结论须由律师复核。
ZongziForu/cn-law-hub83
元典开放平台 MCP Server
MCP华宇元典官方 MCP:把元典开放平台的中国法规与案例检索、企业工商与涉诉信息、证券合规等接口变成 agent 工具,适合律师查法规、找类案、做企业尽调。需注册元典开放平台获取 API Key(调用消耗积分)并装 Node.js 20+;结果需律师复核。
yuandian-ailaw/yuandian-mcp-server5