Skip to main content
Glama
Emnllawlab

faxin-mcp

by Emnllawlab

faxin-mcp (Faxin MCP Connector · Public Edition)

Wraps Faxin (the legal research platform under Law Press China) into an MCP (Model Context Protocol) service, so that any MCP-capable AI client (Claude Desktop, Cherry Studio, various coding agents, etc.) can directly search Chinese laws and regulations, adjudicative rules, Faxin outline concepts, and similar cases (authoritative case library).

How it works: Login is completed by you in the pop-up browser using your own Faxin website account; after that, all searches and detail reads are pure HTTP calls carrying that session cookie (the browser serves only as a cookie container, no page rendering), with each search taking about 2-8 seconds.

Features (9 tools)

Tool

Purpose

faxin_check_login

Check login state (30-minute cache, force=true for a forced check)

faxin_search_law

Law and regulation search (central/local, with validity filtering: currently in effect / invalid / superseded / not yet in effect)

faxin_search_case

Adjudicative rule search (case holdings distilled by Faxin editors)

faxin_search_lib

Specialized library search: national treaties / Hong Kong law / Macau law / law journals / legal interpretations / legislative materials / judicial documents

faxin_search_outline

Faxin outline concept search (Faxin code knowledge tree; do concept discovery first when you don't know which terms to search)

faxin_get_outline

Concept details: aggregated counts across libraries + related provision excerpts

faxin_get_tiao

Direct provision lookup: law name (abbreviations allowed) + article number → full article text + validity information

faxin_search_lalei

Similar case search (authoritative case library: guiding cases / gazette cases / published cases, with filters for cause of action, court level, province, year, etc.)

faxin_get_detail

Document reading (full text of laws / adjudicative rules / specialized library entries, with support for fetching a specific article by number)

Related MCP server: LexLink

Installation

# 1. 克隆本仓库
git clone <repo-url>
cd faxin-mcp-public

# 2. 建虚拟环境并装依赖
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

# 3. 安装 Playwright 浏览器
.venv/bin/playwright install chromium

First-time login

.venv/bin/python login.py
  • A browser window pops up → open the Faxin website → click "Login" → complete login with your own Faxin account (account/password, SMS verification code, or QR code, depending on what the official website offers);

  • After confirming the page shows a logged-in state, return to the terminal and press Enter to save the session;

  • The script will automatically verify headless reuse once. After that, no further login is needed during normal use; if the session expires (the tools will prompt you), just rerun this script.

This script does not read, record, or upload your account password — all credentials pass only through the Faxin official website page.

Configuring an MCP Client

Using Claude Desktop (claude_desktop_config.json) as an example:

{
  "mcpServers": {
    "faxin": {
      "type": "stdio",
      "command": "/你的路径/faxin-mcp-public/.venv/bin/python",
      "args": ["/你的路径/faxin-mcp-public/server.py"]
    }
  }
}

Other MCP clients (Cherry Studio, etc.) work the same way: fill in the python interpreter path + server.py path.

Optional Environment Variables

Variable

Default

Description

FAXIN_BASE_URL

https://www.faxin.cn

Faxin entry point

FAXIN_USER_DATA_DIR

~/.faxin-mcp/browser-data

Browser user data directory (stores session cookie)

FAXIN_HEADLESS

true

Headless mode on the server side; set to false for debugging to see the page

FAXIN_MAX_RESULTS

20

Default number of results returned per search

Usage Suggestions (Keyword Strategy)

  • Prefer case cause words (e.g., "买卖合同纠纷" (sales contract dispute), "民间借贷纠纷" (private lending dispute)) or exact wording from the statutory text (e.g., "盗窃公私财物" / theft of public or private property) when searching; abstract legal concepts have a low hit rate;

  • To look up a provision: if you already know the law name + article number, use faxin_get_tiao directly (fastest); if you only know a topic word, use faxin_search_law;

  • If you don't know which terms to search, first run faxin_search_outline for concept discovery, then drill into the library with the aggregated counts per library;

  • The adjudicative rule library is large; a single search taking 7-17 seconds is normal; use it at low frequency, do not call it repeatedly in quick succession (the platform will temporarily throttle you, and it self-heals after about 60 seconds).

Main Site Compatibility Test (2026-08-22, www.faxin.cn anonymous + logged-in dual-round probing)

Anonymous access (no login required):

Capability

Endpoint

Status

Homepage/login page

//login.aspx

✅ Login form includes account/password, SMS, and QR code

Per-library counts

GetLibSearchResultNum.ashx

✅ Returns JSON {"lib":..,"searchnum":..}

Law search

GetFileInfoForZyfl.ashx

✅ Returns FirstHtml result list

Direct provision lookup

GetZyflTiaoInfo.ashx

✅ Returns full article text + document number + validity information

Law detail

ZyflContent.aspx?gid=

✅ Full text served directly from the server

Post-login verification (tested with a personal Faxin account):

Capability

Interface

Login-state result

Login state

Search page redirect

✅ No redirect when logged in (session reuse across interfaces works)

Outline concepts

GetKeyWordList.ashx

✅ Returns keywordhtml concept list

Adjudicative rule search

GetFileInfoForAlyz.ashx

❌ The interface counts by keyword (AllCount changes with the term) but the result list is empty — this account has no content permission for the adjudicative rule library (it can count but not view). The count interface with lib=alyz returns searchnum=0, confirming this. The account needs to purchase the adjudicative rule library permission

Similar case search

wenshu.faxin.cn

⚠️ The homepage laIndex link has an empty token=, and directly accessing laIndex.html redirects to wenshu/v2/#/index (no token). The main site's similar case token generation mechanism differs from the bar association version, so this tool does not support similar case search on the main site for now (to be adapted later)

Conclusion: The main site's interface paths are isomorphic to the bar association VIP version. Law search / direct provision lookup / outline / detail reading work after login; the adjudicative rule library is limited by account permissions (unrelated to the connector); similar case search is not supported for now on the main site due to the token mechanism difference (the bar association version works normally).

⚠️ Compliance Statement (read before use)

This project is only an MCP protocol adaptation layer, with the following positioning and boundaries:

  1. It does not bypass any authentication. Login must be performed by the user themselves in the pop-up browser, using their own Faxin account. This project contains no cracking, simulated login, CAPTCHA recognition, or encryption algorithm parsing code.

  2. It does not evade any detection or anti-scraping measures. This project does not use any hidden automation-feature startup parameters or script injection.

  3. It does not access beyond your permissions. It only accesses content within the user's account permissions. Some libraries (such as the adjudicative rule library and similar case library) may require a paid Faxin account for full access — please rely on your own account's actual permissions.

  4. It does not do bulk scraping or build a local database. It only provides on-demand single searches; please use it at low frequency and comply with the Faxin platform's user agreement and robots rules.

  5. The content relayed by this project is copyrighted by the original platform. Search results are for personal research and learning only, and must not be used for commercial resale.

Disclaimer

  • This project is a personal learning and exchange open-source tool, with no affiliation or authorization relationship with the Faxin platform;

  • The Faxin platform's page structure and interfaces may change at any time; this project does not guarantee long-term availability;

  • Users should ensure their usage complies with the Faxin platform's user agreement and applicable laws; all consequences arising from using this project are the user's own responsibility;

  • Search results are for reference only and do not constitute legal advice; for formal citation of statutory provisions, please refer to the official published text.

  • Anyone who modifies this code (e.g., fork and further develop) and then redistributes or uses it bears all legal risks arising from their modifications and their usage, which are unrelated to the original author.

  • This project contains no bulk scraping, anti-detection, or cracking functionality. If the Faxin platform updates its user agreement to explicitly prohibit automated tools from calling its interfaces, users should stop using this project on their own; the original author bears no responsibility for this.

License

MIT License (see LICENSE). The copyright of the Faxin platform's content is not changed by this project's MIT license.

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables searching and retrieving Korean legal information including laws, court precedents, legal interpretations, and local ordinances from the Korean National Law Information Center API with intelligent search ranking.
  • F
    license
    A
    quality
    B
    maintenance
    Enables AI systems to search, retrieve, and analyze Korean legal information from the National Law Information API (law.go.kr), including laws, administrative rules, English translations, and law-ordinance linkages.
    26
    1
  • F
    license
    A
    quality
    B
    maintenance
    Enables semantic search and retrieval of Chinese judicial cases from the Supreme People's Court case library, supporting natural language queries for similar cases, case details, filtering, and statistics.
    8
    5

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Emnllawlab/faxin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server