PDF Digitisation
Historical legislation digitised using AI for improved accessibility:
- X PDF-sourced Acts (LLM extracted)
- X PDF-sourced sections (LLM extracted)
UK legal API for AI agents and researchers. Access comprehensive UK legislation and caselaw data with semantic search and Model Context Protocol integration.
Our API provides programmatic access to millions of UK legal documents, court decisions, and statutory instruments with advanced semantic search capabilities, making it easier than ever to build AI-powered legal applications and conduct comprehensive legal analysis. Data is sourced from legislation.gov.uk under the Open Government Licence v3.0 and The National Archives under the Open Justice Licence.
This API is hosted as an experimental service and should not be used as a production dependency.
Find precedents and relevant legislation in seconds. Ask natural language questions about UK law.
Track legislative changes over time. Compare provisions across different Acts and amendments.
Ground AI assistants in authoritative UK legal sources. Reduce hallucinations with verified data.
Connect the Lex API to AI assistants via Model Context Protocol for seamless legal research integration.
Add this configuration to your Claude Desktop configuration file:
Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "lex": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://lex.lab.i.ai.gov.uk/mcp" ] } } }
Tip: Also install the Lex UK Law skill for enhanced legal research guidance.
Connect Claude Code to Lex API using the CLI. Claude Code supports HTTP, SSE, and stdio MCP transports.
Run this command in your terminal to add the Lex MCP server:
claude mcp add --transport http lex https://lex.lab.i.ai.gov.uk/mcp
Tip: Also install the Lex UK Law skill for enhanced legal research guidance.
Scope options:
--scope local (default) — Available only in current project--scope project — Shared via .mcp.json file--scope user — Available across all projectsManage servers:
# List configured servers claude mcp list # Check server status (in Claude Code) /mcp # Remove a server claude mcp remove lex
Install the Lex UK Law skill for automatic legal research guidance. Skills work across Claude Code, Claude Desktop, and claude.ai.
Run these commands in Claude Code:
# Add the marketplace /plugin marketplace add i-dot-ai/lex # Install the skill /plugin install lex-uk-law
Download the skill and upload via Settings → Capabilities → Upload skill:
Download Skill (.zip)Skills are reusable capabilities that Claude automatically activates based on your request. Unlike MCP servers which provide tools, skills provide context and guidance for specific domains.
When you ask about UK law, Claude will automatically use the Lex skill to guide its legal research approach.
Use both together for best results:
Install the MCP server first, then add the skill for enhanced legal research guidance.
Add the Lex API MCP server to Cursor with one click or configure manually.
Click the button below to automatically add Lex to your Cursor configuration:
Add this to your Cursor MCP configuration file:
Config file location: ~/.cursor/mcp.json (global) or .cursor/mcp.json (project)
{ "mcpServers": { "lex": { "url": "https://lex.lab.i.ai.gov.uk/mcp" } } }
To use Lex API with Microsoft Copilot Studio, follow these steps:
Server URL:
https://lex.lab.i.ai.gov.uk/mcp
Add this configuration to your VS Code MCP settings file:
Config file location: .vscode/mcp.json (workspace) or user profile mcp.json
{ "servers": { "lex": { "type": "http", "url": "https://lex.lab.i.ai.gov.uk/mcp" } } }
Via Command Palette:
Cmd+Shift+P / Ctrl+Shift+P)MCP: Add ServerHTTP transporthttps://lex.lab.i.ai.gov.uk/mcplexThis experimental service provides access to comprehensive UK legal data for research and development purposes.
Historical legislation digitised using AI for improved accessibility:
Download complete datasets in Parquet format. Updated weekly every Sunday at 03:00 UTC.
Files split by year for manageability. See manifest.json for current file list.
Files split by year (2001-present). See manifest.json for current file list.
Format: Snappy-compressed Apache Parquet. 4-week retention for archived files. View manifest for file sizes and record counts.
Interactive API documentation with live examples and comprehensive endpoint details.
Interactive API explorer with request and response examples for all endpoints.
View Swagger DocumentationClean, reference-style documentation with detailed schemas and examples.
View ReDoc DocumentationWant to host your own instance or contribute to development? Lex API is open source under MIT licence.