Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words Sign in

China Law MCP

by thu-lawyerversion 0.1.1i★ 9iRuns on your computerRepository ↗
Registry nameio.github.thu-lawyer/china-law-mcp

How to install

What it does

Search 23,995 Chinese statutes and verify citations to catch LLM-fabricated references.

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Law & government data

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity12/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score24/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install China Law MCP. Follow https://mcp.popnx.com/i/thu-lawyer-china-law-mcp.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 13, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server China Law MCP for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "china-law": { "command": "uvx", "args": [ "china-law-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the China Law MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "china-law": {
          "command": "uvx",
          "args": [
            "china-law-mcp"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use China Law MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using China Law MCP or shows a China Law MCP tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect China Law MCP yet

China Law MCP runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect China Law MCP

  • Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)

B · Others in Law & government data that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server China Law MCP for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user china-law -- uvx china-law-mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the China Law MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user china-law -- uvx china-law-mcp
  4. Type /mcp in Claude Code

    You should see China Law MCP listed as connected

  5. Try it

    Use China Law MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using China Law MCP or shows a China Law MCP tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server China Law MCP for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "china-law": { "command": "uvx", "args": [ "china-law-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the China Law MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use China Law MCP and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using China Law MCP or shows a China Law MCP tool in the answer, you are connected

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server China Law MCP for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "china-law": { "type": "stdio", "command": "uvx", "args": [ "china-law-mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the China Law MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use China Law MCP and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using China Law MCP or shows a China Law MCP tool in the answer, you are connected

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use China Law MCP💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user china-law -- uvx china-law-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "china-law": {
      "command": "uvx",
      "args": [
        "china-law-mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "china-law": {
      "command": "uvx",
      "args": [
        "china-law-mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "china-law": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "china-law-mcp"
      ]
    }
  }
}

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
87/wk
Connection
Runs on your computer
Latest versioni
0.1.1
Published to registryi
Oct 4, 2026
Code last changedi
Nov 3, 2026
Maker
thu-lawyer
Packages
pypi: china-law-mcp
oci: ghcr.io/thu-lawyer/china-law-mcp:0.1.1
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 20, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account THUboran, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 17 days ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for china-law-mcp@0.1.1

Checks only this package version, not every dependency · checked Nov 15, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/thu-lawyer-china-law-mcp.svg)](https://mcp.popnx.com/en/servers/thu-lawyer-china-law-mcp)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Law & government datai

  • More stars than 97% of the other 1961 servers in this category
  • Published to the registry more recently than 39% of the other 1961 servers in this category
  • Basic checks equal to or better than 99% of the other 1961 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is China Law MCP safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 17 days ago, and the latest version (0.1.1) reached the registry 2 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv), Docker on your computer.

What can I use instead?

In the same category: Global law, Open Legal Data (Germany), LibreJustice, InfraNode, Fedlex Connector

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Global law

The law of nearly every country on earth, any date: read it, see what changed it, check citations.

by lexifinaWidely used★ 2.1KUpdated 10 days ago

Runs in the cloud✓ lexifina.com

LibreJustice

Search French-language and European case law and French legal texts (codes, statutes, treaties).

by librejusticeEarly★ 38Updated 2 months ago

Runs in the cloud✓ service owner · librejustice.fr

InfraNode

Keyless open data for 84 German cities: 12 lean read-only MCP tools covering 67 data types.

by street1983nkEarly★ 18Updated 5 months ago

Runs in the cloud✓ service owner · infranode.dev

Fedlex Connector

Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.

by JayTheSkierEarly★ 8Updated 7 months ago

Runs in the cloud✓ service owner · fedlex-connector.ch
Compared with similar ones
This one
China Law MCP
Global lawOpen Legal Data (Germany)LibreJusticeInfraNodeFedlex Connector
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyNoNoNoNoNoNo
Add with + in ClaudeNoNoNoNoNoNo
Basic checks3/34/44/44/44/44/4
LicenseMITNOASSERTIONMITApache-2.0Apache-2.0MIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

⚖️ china-law-mcp

中国法律条文 MCP 服务器 · 让 AI 引用法条不再编造

免费 · 免注册 · 免 API key · 本地运行

English · 中文


解决什么问题

直接问大模型中国法律问题,有两个后果:引用的条文可能根本不存在或已废止,你无法核实。法律是最不能容忍编造的领域。

china-law-mcp 给 AI 装上一个离线法条库 + 引用核验器:

  • 模型要引用《民法典》第 1254 条?先调 verify_citation 查一下,不存在就换掉
  • 模型写了一整段分析?check_citations_in_text 会把里面所有《某法》第 N 条抽出来逐条核验,列出编造的引用
  • 不知道适用哪条?search_statutes 用自然语言检索(支持「同事借我钱不还」这种口语)

数据在本地,不联网、不注册、不需要 API key。

快速开始

方式一:一行命令(推荐)

uvx china-law-mcp

方式二:pip 安装

pip install china-law-mcp

china-law-mcp

方式三:克隆运行

git clone https://github.com/thu-lawyer/china-law-mcp

cd china-law-mcp pip install -r requirements.txt python -m china_law_mcp # 首次运行自动构建 BM25 索引,约 6 秒

方式四:Docker(镜像已发布到 ghcr.io)

docker run -i --rm ghcr.io/thu-lawyer/china-law-mcp:latest
{

"mcpServers": { "china-law": { "command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/thu-lawyer/china-law-mcp:latest"] } } }

接入你的客户端

标准 stdio 服务器,任何 MCP 客户端都能接。先确定 uvx 在 PATH 里(uv 随附)。

客户端接入方式
Claude Code一条命令:claude mcp add china-law -- uvx china-law-mcp
Claude Desktop编辑 claude_desktop_config.json(macOS:~/Library/Application Support/Claude/;Windows:%APPDATA%\Claude\),粘入下面的 JSON 后重启
Cursor项目级 .cursor/mcp.json 或全局 ~/.cursor/mcp.json,粘入下面的 JSON
VS Code(Copilot Chat).vscode/mcp.json,注意顶层键是 `servers` 而不是 mcpServers
国内客户端(Cherry Studio、ChatWise、LobeChat、DeepChat 等)在各自的 MCP 设置页粘贴同一段 JSON

把 uvx 换成 Docker 也可以,见上一节。

{

"mcpServers": { "china-law": { "command": "uvx", "args": ["china-law-mcp"] } } }

工具

工具作用
search_statutes(query, top_k, law?)自然语言问题 → 相关法条(口语自动扩展为法言法语)
get_article(law, article_no)法律 + 条号 → 条文原文,支持「民法典」「1254」「第一千二百五十四条」
list_laws(keyword?, department?)浏览库内法律目录
verify_citation(law, article_no)核验单条引用是否真实存在
check_citations_in_text(text)抽取文本中全部引用并逐条核验,列出编造的

效果示例

下图为真实工具调用返回结果的渲染(终端样式,非截图):

自然语言检索(口语直接问):

search_statutes("同事借我钱不还怎么办")

→ 中华人民共和国民法典 第六百七十五条 借款人应当按照约定的期限返还借款… → 中华人民共和国民法典 第六百七十四条 借款人应当按照约定的期限支付利息…

search_statutes("外卖吃出异物能退吗") → 中华人民共和国食品安全法 第一百四十八条 消费者因不符合食品安全标准的食品受到损害的, 可以向经营者要求赔偿损失,也可以向生产者要求赔偿…

引用核验(防止 AI 编造):

verify_citation("民法典", "1254")   → verified=True   (真实存在)

verify_citation("民法典", "9999") → verified=False 中华人民共和国民法典 没有第 9999 条

check_citations_in_text("根据《民法典》第1254条…依据《劳动合同法》第99条和《民法典》第88888条…") → 共 3 条,有效 1,无效 2 → invalid: ['《劳动合同法》第99条', '《民法典》第88888条']

作为 Agent Skill 使用(不用 MCP)

如果你用的 Agent 还不支持 MCP,或者只想在命令行里快速查一条法条,仓库里的 skills/china-law/ 提供了等价能力:

pip install china-law-mcp

python skills/china-law/law.py search "外卖吃出异物能退吗" python skills/china-law/law.py verify 民法典 1254 python skills/china-law/law.py get 民法典 1254 python skills/china-law/law.py list 劳动 echo "根据《民法典》第1254条,另依据《民法典》第88888条。" | python skills/china-law/law.py check -

每个子命令都支持 --json

python skills/china-law/law.py verify 民法典 1254 --json

把 skills/china-law/ 整个目录放进对应 Agent 的技能目录即可:Claude Code 用户级 ~/.claude/skills/ 或项目级 .claude/skills/;Codex ~/.codex/skills/;Kimi CLI 通过 --skills-dir 指定。

数据

  • 378 部法律、23,995 条现行条文(宪法、法律、立法解释全量)
  • 每条含:法律名、编章、条号(中文 + 阿拉伯数字)、条文全文、部门法、时效状态
  • SQLite 数据库(15 MB)随仓库提供,开箱即用;BM25 索引首次运行自动构建(约 6 秒,之后缓存)

换成你自己的语料:

python scripts/build_corpus.py 你的条文.jsonl     # → data/laws.db

字段说明见 scripts/build_corpus.py 头部注释。scripts/ 下另有两个可选工具:make_subset.py(抽取常用法律子集)、encrypt_data.py(把数据库加密为 laws.db.enc,服务器可用 CHINA_LAW_KEY 环境变量自动解密)。

工作原理

用户提问

↓ search_statutes ← BM25 召回 + 口语同义词/共现规则扩展 + 覆盖率与短语重排 + 条号直查 ↓ 返回条文原文(含出处) ↓ 模型依据条文作答 ↓ check_citations_in_text ← 正则抽取《X法》第N条,逐条查库核验 ↓ 编造的引用被列出并剔除

检索是纯本地 BM25(rank-bm25 + jieba),不调用任何外部 API,因此没有网络依赖、没有调用成本,也不会把你的查询发给第三方。

已知局限

  • 检索是 BM25 基线,口语→法言法语的映射靠一张手工规则表(约 40 条)。常见场景效果好,生僻表述可能召回不相关条文——请始终以返回的条文原文为准。
  • 覆盖范围为宪法、法律、立法解释(378 部),不含行政法规、地方性法规、司法解释。修法频繁的领域请留意时效状态字段。
  • 条文时效状态部分为库内推定(见语料 status_basis 字段)。
  • 本工具提供条文检索与引用核验,不构成法律意见。

收录情况

  • PyPI:https://pypi.org/project/china-law-mcp/ (v0.1.1)
  • MCP 官方注册表(active):https://registry.modelcontextprotocol.io/v0/servers?search=china-law-mcp
  • Glama:https://glama.ai/mcp/servers/thu-lawyer/china-law-mcp —— 工具定义评分 A
  • awesome 列表:已向 punkpeye/awesome-mcp-servers(Legal 分类)与 yzfly/Awesome-MCP-ZH 提交 PR,仍在审核中、尚未合并
  • 容器镜像:ghcr.io/thu-lawyer/china-law-mcp

开发

pip install -r requirements-dev.txt

PYTHONPATH=src pytest tests/ -v # 12 个测试,覆盖检索、直查、引用核验

发布镜像与注册表条目走 tag 触发:

git tag v0.1.2 && git push origin v0.1.2

或在 Actions 里手工触发 Publish image and register 工作流并填入版本号。

相关项目

许可

MIT。条文数据来自公开渠道整理,请遵守相应来源的使用条款。