Legislation Uk logo

Legislation Uk

Searches UK legislation, retrieves versioned text and metadata, traces amendments, and reads government explanatory notes.

Install Legislation Uk

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "legislation-uk": {
      "command": "npx",
      "args": [
        "-y",
        "@pipeworx/mcp-legislation-uk"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

Legislation Uk MCP server connects AI agents to legislation.gov.uk, the UK's official database of Acts and statutory instruments. It provides tools for searching legislation, retrieving metadata and text, checking amendments, and reading Explanatory Notes. Version-aware text queries support current, enacted, or date-specific views, while section retrieval avoids loading an entire large Act. Use it when an agent needs source legislation covering England, Wales, Scotland, or Northern Ireland.

Use cases

  • Search UK Acts and statutory instruments by title and year
  • Retrieve a section as enacted or at a historical date
  • Trace amendments affecting a specific piece of legislation
  • Compare current and enacted legislative text
  • Read government Explanatory Notes for a section

Key features

  • UK legislation search across multiple jurisdictions
  • Versioned whole-work and section text retrieval
  • Legislation metadata and full-text URLs
  • Paged amendment relationship data
  • Government Explanatory Notes
  • Hosted HTTP and local stdio access

Tools6

What Legislation Uk lets your agent do. Expand a tool for its parameters.

Self-reported~343 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

7/7 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · @pipeworx/mcp-legislation-uk (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads614Package downloads in the last 30 days.
Last commit6d agoMost recent push to the default branch.
Tools exposed6Callable tools this server registers over MCP.

How Legislation Uk works

What Legislation Uk MCP server does

The Legislation Uk MCP server exposes UK legislation.gov.uk data through MCP tools. It covers UK Public General Acts, UK Statutory Instruments, Acts of the Scottish Parliament, Welsh legislation, Northern Ireland Acts, and UK Local Acts. The source is the official legislation.gov.uk database, and the service does not require an API key or account.

Search results identify matching Acts or instruments and include full-text URLs. Once a work is identified, an agent can retrieve its title, status, territorial extent, enactment date, and other metadata. Text can be requested for an entire work or for one section. Explanatory Notes provide departmental commentary about intended meaning, but they are separate from the legal text and are not themselves law.

How it works

The Legislation Uk MCP server accepts MCP tool calls through either a hosted gateway endpoint or a local stdio package. The hosted endpoint is available at https://gateway.pipeworx.io/legislation-uk/mcp; the local package is started with npx -y @pipeworx/mcp-legislation-uk. The gateway endpoint also exposes shared Pipeworx meta-tools, while the standalone process exposes only this pack's legislation tools.

Text requests can use current, enacted, or a date in YYYY-MM-DD format. as_at is supported as the date-based equivalent. Responses identify the version that was actually served with version_valid_from; when the requested date falls between changes, a note explains that the nearest earlier version was returned. Repealed or omitted wording follows the rendering supplied by legislation.gov.uk.

Amendment results are paginated in groups of 50 and include counts, page information, and a next-page value where applicable. This matters for legislation with extensive change histories. Search accepts an exact legislation type, a plain category such as act, si, or ssi, or no type; omission defaults to ukpga.

Setup and configuration

For a hosted MCP connection, add the gateway URL to the client's MCP configuration:

config.json
{
  "mcpServers": {
    "legislation-uk": {
      "url": "https://gateway.pipeworx.io/legislation-uk/mcp"
    }
  }
}

For local stdio use:

config.json
{
  "mcpServers": {
    "legislation-uk": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-legislation-uk"]
    }
  }
}

No environment variables or authentication credentials are required. The HTTP tool interface can also be called directly through the gateway's /v1/tools routes.

Tools and capabilities

  • search_uk_legislation finds Acts and instruments by title words and optional year. The former search_legislation name remains available as an alias.
  • get_legislation returns identifying and status metadata for a work selected by type, year, and number.
  • get_legislation_section retrieves one section in a selected version, which is useful when a full Act would be too large.
  • get_legislation_text retrieves whole-work text with a byte limit and indicates when truncation requires section-level retrieval.
  • legislation_amendments lists instruments that affected a work or works affected by it, including provisions, change type, application status, and commencement date.
  • get_explanatory_notes returns an overview or section commentary when notes exist. Some Acts have no notes, and section commentary is not guaranteed.

Limitations and notes

Legislation can differ materially between enacted, current, and date-specific versions. Section numbering can also change after amendments, so a section available in one version may not exist in another. A requested historical date may return the nearest earlier version rather than an exact-date snapshot; inspect the returned version metadata.

Whole-text responses are byte-bounded and may be truncated. Use the section tool for large works. Explanatory Notes use different HTML layouts depending on the age of the Act, and some newer material is divided into separate content pages. Commentary is explanatory material from the responsible department, not part of the legislation itself.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Legislation Uk

Legislation Uk is an MCP server that connects AI agents to legislation.gov.uk, the UK's official legislation database. Its main tools search Acts and instruments, retrieve metadata and versioned whole-work or section text, list amendments, and return government Explanatory Notes. It covers legislation from the UK, Scotland, Wales, and Northern Ireland.

Install it locally by configuring an MCP client to run `npx -y @pipeworx/mcp-legislation-uk`. The package communicates over stdin and stdout and requires no Pipeworx account or environment variables. Alternatively, configure the hosted MCP URL `https://gateway.pipeworx.io/legislation-uk/mcp`.

Yes, Legislation Uk works with Cursor. Add either the hosted MCP URL or the local `npx` command to Cursor's MCP server configuration. The README also gives examples for Claude Desktop and Windsurf.

Pass `version` as `current`, `enacted`, or a `YYYY-MM-DD` date, or use the equivalent `as_at` date argument on the text tools. Responses include `version_valid_from` and explain when legislation.gov.uk supplied the nearest earlier version.

Yes, use `legislation_amendments`. The default `direction: "affected"` shows what has amended the selected legislation; `direction: "affecting"` shows what it amends. Results include affected provisions, change type, application status, commencement date, and pagination details.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLegislation Uk AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/legislation-uk?style=directory)](https://allmcps.com/mcp/legislation-uk)
HTML Embed
<a href="https://allmcps.com/mcp/legislation-uk"><img src="https://allmcps.com/api/badge/legislation-uk?style=directory" alt="Legislation Uk on AllMCPs" /></a>