eu.ansvar/chinese-law-mcp

Chinese law database — cybersecurity, data protection, commercial law with full-text search

2Apache-2.0databases

Install

Config snippet generator goes here (5 client tabs)

README

# Chinese Law MCP Server

**The NPC National Law Database alternative for the AI age.**

[![npm version](https://badge.fury.io/js/%40ansvar/chinese-law-mcp.svg)](https://www.npmjs.com/package/@ansvar/chinese-law-mcp)
[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![GitHub stars](https://img.shields.io/github/stars/Ansvar-Systems/chinese-law-mcp?style=social)](https://github.com/Ansvar-Systems/chinese-law-mcp)
[![CI](https://github.com/Ansvar-Systems/chinese-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/chinese-law-mcp/actions/workflows/ci.yml)
[![Daily Data Check](https://github.com/Ansvar-Systems/chinese-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/chinese-law-mcp/actions/workflows/check-updates.yml)
[![Database](https://img.shields.io/badge/database-pre--built-green)](#whats-included)
[![Provisions](https://img.shields.io/badge/provisions-62%2C981-blue)](#whats-included)

Query **1,188 Chinese laws, administrative regulations, and departmental rules** -- from 个人信息保护法 and 网络安全法 to 民法典, 公司法, and CAC AI regulations -- directly from Claude, Cursor, or any MCP-compatible client.

If you're building legal tech, compliance tools, or doing Chinese legal research, this is your verified reference database.

Built by [Ansvar Systems](https://ansvar.eu) -- Stockholm, Sweden

---

## Why This Exists

Chinese legal research is scattered across official NPC databases, State Council publications, and commercial legal platforms. Whether you're:
- A **lawyer** validating citations in a brief or contract
- A **compliance officer** checking PIPL, CSL, or DSL requirements
- A **legal tech developer** building tools on Chinese law
- A **researcher** analysing legislation across 9 legal categories

...you shouldn't need dozens of browser tabs and manual cross-referencing. Ask Claude. Get the exact provision. With context.

This MCP server makes Chinese law **searchable, cross-referenceable, and AI-readable**.

---

## Quick Start

### Use Remotely (No Install Needed)

> Connect directly to the hosted version -- zero dependencies, nothing to install.

**Endpoint:** `https://chinese-law-mcp.vercel.app/mcp`

| Client | How to Connect |
|--------|---------------|
| **Claude.ai** | Settings > Connectors > Add Integration > paste URL |
| **Claude Code** | `claude mcp add chinese-law --transport http https://chinese-law-mcp.vercel.app/mcp` |
| **Claude Desktop** | Add to config (see below) |
| **GitHub Copilot** | Add to VS Code settings (see below) |

**Claude Desktop** -- add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "chinese-law": {
      "type": "url",
      "url": "https://chinese-law-mcp.vercel.app/mcp"
    }
  }
}
```

**GitHub Copilot** -- add to VS Code `settings.json`:

```json
{
  "github.copilot.chat.mcp.servers": {
    "chinese-law": {
      "type": "http",
      "url": "https://chinese-law-mcp.vercel.app/mcp"
    }
  }
}
```

### Use Locally (npm)

```bash
npx @ansvar/chinese-law-mcp
```

**Claude Desktop** -- add to `claude_desktop_config.json`:

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "chinese-law": {
      "command": "npx",
      "args": ["-y", "@ansvar/chinese-law-mcp"]
    }
  }
}
```

**Cursor / VS Code:**

```json
{
  "mcp.servers": {
    "chinese-law": {
      "command": "npx",
      "args": ["-y", "@ansvar/chinese-law-mcp"]
    }
  }
}
```

---

## Example Queries

Once connected, just ask naturally:

- *"个人信息保护法第四条说了什么?"* (What does Article 4 of PIPL say?)
- *"搜索关于数据安全的规定"* (Search for provisions about data security)
- *"网络安全法是否仍然有效?"* (Is the Cybersecurity Law still in force?)
- *"算法推荐管理规定对推荐算法有什么要求?"* (What does the Algorithm Recommendation Provisions require?)
- *"Find provisions about反垄断 (anti-monopoly) in Chinese law"*
- *"Validate this citation: 民法典 第一条"*
- *"Build a legal stance on data breach notification requirements"*
---

## What's Included

| Category | Count | Details |
|----------|-------|---------|
| **National Laws** | 385 statutes | Constitution, constitutional-related, civil & commercial, administrative, economic, social, criminal, procedural |
| **Administrative Regulations** | 799 regulations | State Council administrative regulations (行政法规) |
| **CAC Departmental Rules** | 4 rules | Key AI/cybersecurity regulations from the Cyberspace Administration of China |
| **Provisions** | 62,981 articles | Full-text searchable with FTS5 |
| **Database Size** | ~51 MB | Optimized SQLite, portable |
| **Daily Updates** | Automated | Freshness checks against NPC database |

### Legal Categories Covered

| Category | Chinese Name | Count |
|----------|-------------|-------|
| Constitution | 宪法 | 7 |
| Co