UK Law

io.github.flaviohtavares由 GitHub 账号 flaviohtavares 发布v1.0.1更新于 Nov 7, 2026

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

已验证Streamable HTTP可网页运行网页搜索与抓取知识与记忆

概览

AI 生成的概览

免费的只读远程 MCP 服务器,让助手检索并阅读 legislation.gov.uk 上的英国法案与法规。

可以做什么
  • 按标题中的词语或 id 检索英国法案与法规,可按类型、是否生效、适用范围、主题和数量筛选
  • 按 id 阅读法律:短法全文返回,长法先返回前置信息与目录,再按章节、附表、条例或部分逐段读取
  • 列出 legislation.gov.uk 的官方主题分类及现行法律数量,可按名称中的词语筛选
  • 列出某一主题下现行的法案与法规,并给出每部法案在该主题下的条例数量,大主题可按年份缩小范围
适用场景
适合让助手依据法案或法规原文回答英国法律问题,并附上生效状态、适用范围和官方链接,而不是凭记忆作答。也适合按主题浏览立法。
运行要求
远程 Streamable HTTP 端点,无需登录、无需 API 密钥,本地无需安装任何东西。需要客户端支持自定义远程 MCP 服务器,例如 Claude、Claude Code、Codex 和 ChatGPT(ChatGPT 的自定义 MCP 服务器需 Pro、Business 或 Enterprise/Edu 套餐)。
安装前请注意
只读且不存储用户数据,但文本是非官方副本,可能过时或存在转换错误,部分文本为颁布时版本、后续修订未应用。维护方声明这不构成法律意见,且与 The National Archives、legislation.gov.uk 及英国政府无关联或背书;依赖前请核对官方文本或咨询律师。

安装

在 SourceWeft 中

  1. 打开 控制台中的 UK Law,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.flaviohtavares%2Fuk-law/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "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.

来源:README.md,提交 29a1a20

工具

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.

输入参数limitquery必填topictypesextentin_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).

输入参数id必填partmax_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.

输入参数query

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.

输入参数name必填yearmax_chars

版本历史

1
  1. v1.0.1最新Nov 7, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分