UK Law

io.github.flaviohtavaresPublished by GitHub account flaviohtavaresv1.0.1Updated Nov 7, 2026

Search and read all UK legislation (130k Acts and regulations), updated daily, with official links.

VerifiedStreamable HTTPWeb executableWeb Search & ScrapingKnowledge & Memory

Overview

AI-generated overview

Free, read-only remote MCP server that lets an assistant search and read UK Acts and regulations from legislation.gov.uk.

What you can do
  • Search UK Acts and regulations by words in the title or by id, with filters for type, in-force status, extent, topic and limit
  • Read a law by id, getting short laws whole and long laws as front matter plus a contents list, then one section, schedule, regulation or part at a time
  • List official legislation.gov.uk subject headings with counts of laws in force, optionally filtered by words in the name
  • List the Acts and regulations in force on one topic, with per-Act regulation counts, and narrow big topics by year
When to use it
Useful when you want an assistant to answer questions about UK law by quoting the actual text of an Act or regulation, with its status, extent and official link, instead of relying on memory. Also handy for browsing legislation by subject area.
Requirements
A remote Streamable HTTP endpoint with no sign-in, no API key and nothing to install locally. Works in clients that support custom remote MCP servers, such as Claude, Claude Code, Codex and ChatGPT (custom MCP servers on ChatGPT need a Pro, Business or Enterprise/Edu plan).
Before you install
Read-only and stores no user data, but the texts are an unofficial copy that can be out of date or contain conversion errors, and some texts are as-enacted with later amendments not applied. The maintainer states it is not legal advice and is not affiliated with or endorsed by The National Archives, legislation.gov.uk or the UK Government; check the official text or a lawyer before relying on it.

Installation

In SourceWeft

  1. Open UK Law in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.flaviohtavares%2Fuk-law/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "uk-law": {
      "type": "http",
      "url": "https://uk-law-mcp.uk-law-mcp.workers.dev/mcp"
    }
  }
}

README

UK Law MCP server

A free, read-only MCP server that lets AI assistants (Claude, ChatGPT, Claude Code, Codex and others) search and read all UK legislation, about 130,000 Acts and regulations from UK Law, updated daily from legislation.gov.uk.

Not legal advice. The texts are an unofficial copy and can be out of date or contain conversion errors. Always check the official text at legislation.gov.uk.

Server URL: https://uk-law-mcp.uk-law-mcp.workers.dev/mcp (no sign-in). The page at the root of that address has the same instructions.

Install: step by step

There are two ways to connect an assistant, and both are free:

  • the MCP server (https://uk-law-mcp.uk-law-mcp.workers.dev/mcp), for Claude, ChatGPT, Claude Code and Codex. Nothing to install on your computer and no sign-in;
  • the skill (a small Python script), for Claude Code and Codex. It reads GitHub directly and works without the server.

After installing, test it with a question such as: "What does section 86 of the Employment Rights Act 1996 say about notice periods?" The answer should quote the section and link legislation.gov.uk.

Claude (claude.ai, Claude Desktop and the mobile apps)

Works on every plan; the Free plan allows one custom connector.

  1. Open Customize → Connectors. The same connector then works in Claude Desktop and the mobile apps.
  2. Click + Add, then Add custom connector.
  3. Name: UK Law. Remote MCP server URL: https://uk-law-mcp.uk-law-mcp.workers.dev/mcp. Click Continue.
  4. Under Authentication, choose No sign in, then click Add.
  5. In a chat, click + (bottom left) → Connectors and make sure UK Law is switched on. Then ask your question.

On Team and Enterprise plans an Owner adds the connector once in Organization settings → Connectors (Add → Custom → Web, same URL, "No sign in"); members then switch it on in Customize → Connectors.

Claude Code

Option A, the plugin (recommended). Type in Claude Code:

/plugin marketplace add flaviohtavares/uk-law-tools/plugin install uk-law@uk-law-tools

Restart Claude Code if asked. Update later with /plugin marketplace update uk-law-tools.

Option B, the MCP server. In a terminal:

sh
claude mcp add --transport http --scope user uk-law https://uk-law-mcp.uk-law-mcp.workers.dev/mcp

--scope user makes it available in every project. Check it with /mcp inside Claude Code.

Codex (CLI, IDE extension and app)

Option A, the MCP server. In a terminal:

sh
codex mcp add uk-law --url https://uk-law-mcp.uk-law-mcp.workers.dev/mcp

or add this to ~/.codex/config.toml:

toml
[mcp_servers.uk-law]url = "https://uk-law-mcp.uk-law-mcp.workers.dev/mcp"

Check it with codex mcp list, then start a new Codex session.

Option B, the skill. In a terminal:

sh
curl -fsSL https://raw.githubusercontent.com/flaviohtavares/uk-law-tools/main/install.sh | sh

It copies the skill to ~/.agents/skills/uk-law (and ~/.codex/skills/uk-law). Restart Codex. Run the same command to update.

ChatGPT

Custom MCP servers work on chatgpt.com (web) with a Pro, Business or Enterprise/Edu plan. On Business, only workspace admins and owners can add them.

  1. Open Plugins.
  2. Click +, then Add custom MCP server.
  3. Name: UK Law. Under Connection, enter https://uk-law-mcp.uk-law-mcp.workers.dev/mcp.
  4. Authentication: None.
  5. Tick I understand and want to continue, then click Create as a plugin and install it.
  6. In a new chat, type @, pick UK Law, and ask your question.

Free and Plus plans: paste this link into the chat and ask your question; ChatGPT reads the instructions and opens the right file:

https://raw.githubusercontent.com/flaviohtavares/uk-law/main/llms.txt

Other MCP clients

Add https://uk-law-mcp.uk-law-mcp.workers.dev/mcp as a remote server (Streamable HTTP transport, no authentication).

Tools

tooldoes
search_lawsfind laws by words of the title or by id; filters: types, in_force, extent, topic, limit
get_lawread a law; for long laws, the contents, then one part ("section 86", "schedule 1", "part 2")
list_topicsofficial subject headings with counts of laws in force
get_topicActs and regulations in force on one topic (year for big topics)

How it works

A Cloudflare Worker with a stateless MCP handler (createMcpHandler from the Agents SDK). The index of laws (index/laws.csv of the data repository) is kept in D1 with a full-text index on the titles; the texts are read from GitHub (cached for an hour). No user data is stored.

Run your own

sh
npm installnpx wrangler loginnpx wrangler d1 create uk-law          # put the database_id in wrangler.jsoncnpm run sync:full                      # loads index/laws.csv from a clone of uk-law (UKLAW_DATA)npm run deploy

npm run sync sends only the rows that changed since the last sync; the maintainer runs it after each daily update. For local development: python3 scripts/sync.py --full --local and npm run dev.

Who maintains this

Built and maintained by Tavlabs Ltd, a London software house for small and medium businesses. [email protected]

Not affiliated with or endorsed by The National Archives, legislation.gov.uk or the UK Government. Code: MIT. Legislation texts: © Crown and database right, Open Government Licence v3.0.

Source: README.md at commit 29a1a20

Tools

4

search_laws

Search UK laws

Find UK Acts and regulations by words of their title, or by id (e.g. ukpga/1996/18). Exact titles, Acts and laws in force come first. Returns id, title, status, extent and topics.

Parameterslimitqueryrequiredtopictypesextentin_force

get_law

Read a UK law

Read a law by id. Short laws come whole. Long laws (100+ sections) return their front matter and a Contents list: then ask for one part, e.g. part: "section 86", "schedule 1", "regulation 3" or "part 2" (lists that part's sections).

Parametersidrequiredpartmax_chars

list_topics

List topics

Topics (the official subject headings of legislation.gov.uk) with the number of Acts and regulations in force. Optionally only those whose name has these words.

Parametersquery

get_topic

Read a topic page

The Acts and regulations in force on one topic, with how many regulations each Act has on it. Big topics list regulations by year: pass year to read one.

Parametersnamerequiredyearmax_chars

Version history

1
  1. v1.0.1LatestNov 7, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts