Chinese law database — cybersecurity, data protection, commercial law with full-text search
Chinese law database — cybersecurity, data protection, commercial law with full-text search
Valid MCP server (2 strong, 2 medium validity signals). 1 known CVE in dependencies (0 critical, 1 high severity) Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (129/129 approved).
5 files analyzed · 2 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"eu-ansvar-chinese-law-mcp": {
"args": [
"-y",
"@ansvar/chinese-law-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
The NPC National Law Database alternative for the AI age.
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 -- Stockholm, Sweden
Chinese legal research is scattered across official NPC databases, State Council publications, and commercial legal platforms. Whether you're:
...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.
Connect directly to the hosted version -- zero dependencies, nothing to install.
Endpoint: https://mcp.ansvar.eu/law-cn/mcp
| Client | How to Connect |
|---|---|
| Claude.ai | Settings > Connectors > Add Integration > paste URL |
| Claude Code | claude mcp add chinese-law --transport http https://mcp.ansvar.eu/law-cn/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:
{
"mcpServers": {
"chinese-law": {
"type": "url",
"url": "https://mcp.ansvar.eu/law-cn/mcp"
}
}
}
GitHub Copilot -- add to VS Code settings.json:
{
"github.copilot.chat.mcp.servers": {
"chinese-law": {
"type": "http",
"url": "https://mcp.ansvar.eu/law-cn/mcp"
}
}
}
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
{
"mcpServers": {
"chinese-law": {
"command": "npx",
"args": ["-y", "@ansvar/chinese-law-mcp"]
}
}
}
Cursor / VS Code:
{
"mcp.servers": {
"chinese-law": {
"command": "npx",
"args": ["-y", "@ansvar/chinese-law-mcp"]
}
}
}
Once connected, just ask naturally:
| 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 |
| Category | Chinese Name | Count |
|---|---|---|
| Constitution | 宪法 | 7 |
| Constitutional-related | 宪法相关法 | 75 |
| Civil & Commercial | 民法商法 | 46 |
| Administrative | 行政法 | 146 |
| Economic | 经济法 | 133 |
| Social | 社会法 | 44 |
| Criminal | 刑法 | 7 |
| Procedural | 诉讼与非诉讼程序法 | 15 |
| Administrative Regulations | 行政法规 | 799 |
| CAC Departmental Rules | 部门规章 (CAC) | 4 |
| Total | 1,276 enumerated (1,188 ingestable) |
Verified data only -- every provision is extracted from official sources: NPC National Law Database DOCX files (flk.npc.gov.cn) and CAC published regulations (cac.gov.cn). Zero LLM-generated content.
Verbatim Source Text (No LLM Processing):
Smart Context Management:
Technical Architecture:
NPC FLK Database → DOCX Download → mammoth HTML ─┐
├→ Article Parser → SQLite → FTS5 snippet() → MCP response
CAC (cac.gov.cn) → HTML Fetch ───────────────────┘ ↑ ↑
第X条 regex parser Verbatim database query
| Traditional Approach | This MCP Server |
|---|---|
| Navigate flk.npc.gov.cn SPA manually | Search by plain language: "个人信息 同意" |
| Download DOCX files one at a time | Get the exact provision with context |
| Manual cross-referencing between laws | build_legal_stance aggregates across sources |
| "Is this statute still in force?" → check manually | check_currency tool → answer in seconds |
| Check multiple sources for updates | Daily automated freshness checks |
| No API, no integration | MCP protocol → AI-native |
Traditional: Browse flk.npc.gov.cn → Find law → Download DOCX → Open Word → Ctrl+F → Repeat for each law → Manual cross-referencing
This MCP: "What does the PIPL say about cross-border data transfers?" → Done.
| Tool | Description |
|---|---|
search_legislation | FTS5 search on 62,981 provisions with BM25 ranking |
get_provision | Retrieve specific provision by law name + article number |
list_sources | List all 1,188 available laws with metadata |
validate_citation | Validate citation against database (zero-hallucination check) |
build_legal_stance | Aggregate citations from statutes for a legal topic |
format_citation | Format citations per Chinese conventions (full/short/pinpoint) |
check_currency | Check if statute is in force, amended, or repealed |
about | Server info, capabilities, and coverage summary |
All content is sourced from authoritative Chinese legal databases:
The entire NPC National Law Database was enumerated via the FLK search API across 9 legal categories. Each law's official DOCX file was downloaded, converted to HTML via mammoth, and parsed article-by-article using Chinese legal numbering patterns (第X条). CAC departmental rules are fetched directly from cac.gov.cn and parsed from their HTML pages.
| Metric | Value |
|---|---|
| Total laws enumerated | 1,276 |
| Ingestable (in force + amended) | 1,188 |
| Excluded (repealed) | 88 |
| Provisions extracted | 62,981 |
| Ingestion success rate | 99.9% (1 network timeout) |
| Corpus date | 2026-02-25 |
A daily GitHub Actions workflow monitors the NPC database for new or amended laws.
This project uses multiple layers of automated security scanning:
| Scanner | What It Does | Schedule |
|---|---|---|
| CodeQL | Static analysis for security vulnerabilities | Weekly + PRs |
| Semgrep | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push |
| Gitleaks | Secret detection across git history | Every push |
| Trivy | CVE scanning on filesystem and npm dependencies | Daily |
| Socket.dev | Supply chain attack detection | PRs |
| Dependabot | Automated dependency updates | Weekly |
See SECURITY.md for the full policy and vulnerability reporting.
THIS TOOL IS NOT LEGAL ADVICE
Statute text is sourced from the official NPC National Law Database (flk.npc.gov.cn). However:
- This is a research tool, not a substitute for professional legal counsel
- Only the Chinese-language text is legally binding under PRC law
- Verify critical citations against primary sources for court filings
Before using professionally, read: DISCLAIMER.md | PRIVACY.md
Queries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See PRIVACY.md for guidance.
This repository uses a dev integration branch. Do not push directly to main.
feature-branch → PR to dev → verify on dev → PR to main → deploy
main is production-ready. Only receives merges from dev via PR.dev is the integration branch. All changes land here first.dev.git clone https://github.com/Ansvar-Systems/chinese-law-mcp
cd chinese-law-mcp
npm install
npm run build
npm test
npm run dev # Start MCP server
npx @anthropic/mcp-inspector node dist/index.js # Test with MCP Inspector
npm run ingest # Census-driven full corpus ingestion from flk.npc.gov.cn
npm run ingest:cac # Ingest CAC departmental rules from cac.gov.cn
npm run build:db # Rebuild SQLite database from seed files
npm run check-updates # Check NPC database for amendments
npm run drift:detect # Detect data drift against census
npm test # Run all tests
npm run test:contract # Run golden contract tests
This server is part of Ansvar's Compliance Suite -- MCP servers that work together for end-to-end compliance coverage:
Query 49 EU regulations directly from Claude -- GDPR, AI Act, DORA, NIS2, MiFID II, eIDAS, and more. Full regulatory text with article-level search. npx @ansvar/eu-regulations-mcp
Query US federal and state compliance laws -- HIPAA, CCPA, SOX, GLBA, FERPA, and more. npx @ansvar/us-regulations-mcp
Query 261 security frameworks -- ISO 27001, NIST CSF, SOC 2, CIS Controls, SCF, and more. npx @ansvar/security-controls-mcp
Query UNECE R155/R156 and ISO 21434 -- Automotive cybersecurity compliance. npx @ansvar/automotive-cybersecurity-mcp
69+ national law MCPs covering Australia, Brazil, Canada, China, Denmark, Finland, France, Germany, Ghana, Iceland, India, Ireland, Israel, Italy, Japan, Kenya, Netherlands, Nigeria, Norway, Poland, Singapore, Slovenia, South Korea, Spain, Sweden, Switzerland, Thailand, Turkey, UAE, UK, US, Zimbabwe, and more.
Contributions welcome! See CONTRIBUTING.md for guidelines.
Priority areas:
If you use this MCP server in academic research:
@software{chinese_law_mcp_2026,
author = {Ansvar Systems AB},
title = {Chinese Law MCP Server: Production-Grade Legal Research Tool},
year = {2026},
url = {https://github.com/Ansvar-Systems/chinese-law-mcp},
note = {Comprehensive Chinese legal database with 1,188 laws and 62,981 provisions from NPC National Law Database and CAC}
}
Apache License 2.0. See LICENSE for details.
We build AI-accelerated compliance and legal research tools for the global market. This MCP server started as our internal reference tool -- turns out everyone building compliance tools has the same research frustrations.
So we're open-sourcing it. Navigating 1,188 Chinese laws shouldn't require a law degree.
ansvar.eu -- Stockholm, Sweden
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.