mcpField
G
Global law

Global law

远程服务
lexifina.com其他1.9k今天更新

关于 Global law

Global law 是按司法辖区组织并带版本历史的成文法与判例语料库,法律日期对应其生效时间。它面向需要跨辖区检查法律文本、变更、引文和历史的开发者及 AI 客户端。

主要功能

  1. 01读取指定日期生效的法律
  2. 02追溯条文及其修改法律
  3. 03比较不同日期的法律文本
  4. 04搜索法律文本与变更
  5. 05查看判例及法律引文

适用场景

  1. 01查询某条法律在过去日期的内容
  2. 02查找修改特定文本的法律
  3. 03比较两个日期的法律文本
  4. 04查看适用某条文的判决

MCP 相关

其 MCP 服务提供 18 个只读工具,用于查找和读取条文、追溯变更及撰写来源、搜索,以及依据适用法律检查案件或法律摘要。服务在本机运行,依赖 Python 3.9+ 和 git,不发起网络请求。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://global-law.lexifina.com/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

工具

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

Git for Global Law

The world's law in one git history. Every word traced to the law that wrote it for any country and any date.

An expansion of the same for the US Code, #1 on Hacker News (28/10/26). Semantic, searchable law on a global scale.

https://github.com/user-attachments/assets/f24f3411-24d9-416a-8c45-9cebc817c64e

Free to use: CC0. Fork it, build on it, ship it in a product: no permission or credit needed. The law text sits in each country's repository, under that repository's own terms.

Each jurisdiction's law is its own repository, lexifina/<country>-law, where every commit is one law taking effect, written by that law. This repository holds them all as submodules, arranged by jurisdiction, and moves each one forward to its latest commit. The tools read the In-force date of every commit, so they give the law of any country on any date.

global-law/
├── manifest.json              every corpus: path, repository, coverage and dates
├── jurisdiction.json          the world, and the jurisdictions in it
├── germany/bund/acts/         a country's law (submodule)
├── brazil/bahia/acts/         a state's
├── brazil/bahia/salvador/acts/  a city's
└── …

Start

git clone --depth 1 https://github.com/lexifina/global-law && cd global-law
python3 tools/countries.py add united-states/federal/usc   # one corpus; every country is several GB
python3 tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md

On Windows, type py or python where these say python3.

--depth 1 downloads the index without its whole history, a fraction of the size. The tools never read that history, so they work the same. To have it without its file contents, clone with --filter=blob:none instead. For every country, add --recurse-submodules. Don't clone a country's repository with --depth: its dates are read from its whole history, and countries.py add fetches all of it.

From an AI model (MCP)

tools/mcp_server.py is a Model Context Protocol server with 18 read-only tools: find a provision, read it on a date, who wrote each word, compare dates, a provision's history, search the text and the changes, and check a case or a brief against the law in force. It needs only Python 3.9+ and git, runs on your machine and makes no network calls.

The clone carries the setup for Claude Code, Cursor, VS Code and Codex, so the server starts when you open the folder. For another client:

{ "mcpServers": { "global-law": { "command": "git", "args": ["-C", "/path/to/global-law", "-c", "alias.global-law-mcp=!sh tools/mcp.sh", "global-law-mcp"] } } }

Then ask, for example, "What did 11 U.S.C. §1182(1) say on 1 May 2022, and which law last changed it?" MCP.md has every tool and the details.

Command line

python tools/law.py world 2022-05-01                       every corpus on that day
python tools/law.py show 2022-05-01 <path>                 a provision on a date
python tools/law.py blame 2022-07-01 <path>                the law behind each line
python tools/law.py words 2022-07-01 <path>                the law behind each word
python tools/law.py diff 2022-05-01 2022-07-01 <path>      what changed between two dates
python tools/law.py laws 1990-01-01 1990-12-31 germany     the laws that took effect

Dates are YYYY-MM-DD. The first read of a corpus indexes its history once and keeps the index in .git/global-law-cache.

  • A corpus moved to a new folder still answers under its old path (data/moved-paths.tsv). After a pull that moves corpora, run git submodule sync and git submodule update --init.
  • manifest.json and the jurisdiction.json files are written by tools/describe.py.

Case law

Court decisions sit beside the law in <country>/<court>/caselaw, one file and one commit per published decision, dated the day it was decided. manifest.json gives each corpus's court, coverage and gaps; where a source's licence asks for credit, the tools show it as a Credit: line.

A decision is a ruling, not a law (Kind: court), so the tools leave case law out of everything about law (laws, searches, change lists) unless you name it. Each corpus also files, under the law's own paths, the decisions that cite each article, with the version of the law in force on the day decided.

python tools/countries.py add netherlands/caselaw                   a country's case law (not added with the country)
python tools/law.py laws 2024-01-01 2024-01-31 netherlands/caselaw   decisions given in a window
python tools/law.py caselaw-index                                   after a pull: index the case law checked out

From an assistant, check_precedent lists the decisions that applied a provision and says whether the text each one applied is still in force, and what_else_changes counts them. find_provision and law_details take a court's own references (an ECLI, a docket or case number, a reporter citation), and resolve_citations reads citations of law in each country's usual form (Art. 336 OR, § 823 Abs. 1 BGB, article 1240 du code civil).

More

Videos

See all videos

https://github.com/user-attachments/assets/6020acb1-53f3-4b65-94a4-fe132b867358

https://github.com/user-attachments/assets/3e3076d7-cfb4-4e0a-8552-2926a630fc8e

License

This repository is CC0. The law text is in each country's repository, under that repository's own terms.

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。