lex
mcp
Uyari
Health Gecti
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 38 GitHub stars
Code Uyari
- process.env — Environment variable access in app/next.config.ts
Permissions Gecti
- Permissions — No dangerous permissions requested
Purpose
This server is an MCP integration that provides AI assistants with programmatic access to over 8.4 million UK legal documents, offering features like semantic search across legislation, amendments, and explanatory notes.
Security Assessment
Overall Risk: Low. The tool does not request dangerous local permissions or execute hidden shell commands. It makes standard outbound network requests to fetch data from external legal databases and relies on environment variables (via `process.env`) rather than hardcoding sensitive API keys. To run the server locally, users must provide their own Azure OpenAI credentials via a `.env` file. Because the tool inherently interacts with legal texts, it processes domain-specific information, but it does not exhibit malicious behaviors regarding your local file system or private data.
Quality Assessment
The project is actively maintained, with repository activity as recent as today. It uses a permissive MIT license, making it highly accessible for developers. The codebase requires Python 3.12+ and provides a clear, standard testing and formatting setup. While it has a modest community footprint with 38 GitHub stars, it is crucial to note the author's explicit warning: this is an experimental service and should not be treated as a production dependency.
Verdict
Safe to use for research and testing, though developers should proceed with caution before integrating it into any production environment.
This server is an MCP integration that provides AI assistants with programmatic access to over 8.4 million UK legal documents, offering features like semantic search across legislation, amendments, and explanatory notes.
Security Assessment
Overall Risk: Low. The tool does not request dangerous local permissions or execute hidden shell commands. It makes standard outbound network requests to fetch data from external legal databases and relies on environment variables (via `process.env`) rather than hardcoding sensitive API keys. To run the server locally, users must provide their own Azure OpenAI credentials via a `.env` file. Because the tool inherently interacts with legal texts, it processes domain-specific information, but it does not exhibit malicious behaviors regarding your local file system or private data.
Quality Assessment
The project is actively maintained, with repository activity as recent as today. It uses a permissive MIT license, making it highly accessible for developers. The codebase requires Python 3.12+ and provides a clear, standard testing and formatting setup. While it has a modest community footprint with 38 GitHub stars, it is crucial to note the author's explicit warning: this is an experimental service and should not be treated as a production dependency.
Verdict
Safe to use for research and testing, though developers should proceed with caution before integrating it into any production environment.
UK legal API for AI agents and researchers.
README.md
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.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi