Skip to content

Lex Remote MCP Server

A remote MCP server providing access to 63,000+ court cases and advanced legislation search with semantic capabilities.

Overview

PropertyValue
URLhttps://lex.lab.i.ai.gov.uk/mcp
TransportHTTP (remote server)
API keyNot required
Local setupNone -- configured as a remote MCP endpoint
Maintained byUK Government AI Lab (Incubator for AI, DSIT)

No Local Installation

Unlike the uk-legislation server, the Lex server runs remotely. You do not need to install or start anything locally. It is configured in .mcp.json and Claude Code connects to it over HTTP when needed.

Configuration

In .mcp.json:

json
{
  "mcpServers": {
    "lex": {
      "type": "http",
      "url": "https://lex.lab.i.ai.gov.uk/mcp"
    }
  }
}

Tools

The Lex server provides a broader set of tools compared to the local uk-legislation server, with a focus on case law, semantic search, and explanatory notes.

ToolDescription
search_for_legislation_actsSearch for Acts of Parliament with semantic matching
search_for_legislation_sectionsSearch within specific sections of legislation
search_amendmentsFind amendments affecting legislation
search_amendment_sectionsSearch within amendment text

Legislation Lookup

ToolDescription
lookup_legislationLook up a specific piece of legislation by identifier
get_legislation_full_textRetrieve the complete text of legislation
get_legislation_sectionsGet all sections of a statute

Explanatory Notes

ToolDescription
search_explanatory_noteSearch explanatory notes across legislation
get_explanatory_note_by_sectionGet the explanatory note for a specific section
get_explanatory_note_by_legislationGet all explanatory notes for a statute

What Are Explanatory Notes?

Explanatory notes are published alongside most Acts of Parliament. They explain the purpose and effect of each section in plain language. They are not part of the law itself but are invaluable for understanding legislative intent.

Data Proxy

ToolDescription
proxy_legislation_dataProxy raw data requests to legislation.gov.uk

Server Status

ToolDescription
get_live_stats_api_stats_getLive API statistics
health_check_healthcheck_getServer health check

When Is Lex Used?

The Lex server complements the local uk-legislation server. Skills may use either or both depending on the task:

NeedServerWhy
Look up a specific statuteuk-legislationDirect XML access, works offline
Check if a provision is in forceuk-legislationDedicated check_in_force tool
Search for case lawlex63,000+ court cases with semantic search
Get explanatory noteslexStructured explanatory note access
Semantic legislation searchlexAI-powered relevance ranking
Check amendmentsEitherBoth provide amendment tools

Comparison with Local Server

Featureuk-legislation (local)lex (remote)
Transportstdio (local process)HTTP (remote)
Data sourcelegislation.gov.uk XMLlegislation.gov.uk + court cases
Court casesNoYes (63,000+)
Explanatory notesNoYes
Semantic searchNoYes
In-force checkingYesNo (dedicated tool)
Territorial extentYesNo (dedicated tool)
Offline capableYes (after cache)No
Cache24h in-memoryServer-side

Availability

The Lex server is hosted by the UK Government AI Lab. While generally available, it depends on external infrastructure. If the server is unreachable, skills that need case law or explanatory notes will fall back to what is available from the local uk-legislation server and the AI's training data.

Example Usage in Skills

When a skill like Legislation Tracker runs, it might call tools from both servers:

  1. search_legislation (local) -- find the statute referenced in the contract
  2. check_in_force (local) -- verify the statute is still in force
  3. check_amendments (local) -- check for recent amendments
  4. get_explanatory_note_by_section (lex) -- understand the purpose of a section
  5. search_for_legislation_acts (lex) -- find related legislation via semantic search

This combination of local and remote MCP servers gives skills comprehensive, real-time access to UK legal data.

AI Legal UK · The Counsel — Established MMXXVI · Built for England & Wales · Not legal advice.