Taiwan Law MCP Server
A Model Context Protocol (MCP) server for scraping Taiwan law information from the Legislative Yuan's legal database. This server provides comprehensive access to Taiwan's legal documents, including law articles, amendments history, and legal text processing utilities.
🚀 Features
This MCP server provides 6 different tools for interacting with Taiwan law data:
Available Tools
- 🔍 search_law - Search for laws by name and get basic information
- 📜 get_law_history - Get complete history of a specific law including all amendments
- 📋 get_law_articles - Get current articles of a specific law
- 🔧 parse_law_text - Parse and normalize law text, converting Chinese numbers to Arabic
- 📅 convert_dates - Convert ROC (Republic of China) dates to Western dates
- 🔢 normalize_article_number - Convert Chinese article numbers to Arabic format
📦 Installation
Using pip (Recommended)
pip install taiwan-law-history-mcp
Using UV
uv add taiwan-law-history-mcp
From source
git clone https://github.com/yourusername/taiwan-law-history-mcp.git
cd taiwan-law-history-mcp
pip install -e .
🔧 Usage
As an MCP Server
Add this to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"taiwan-law-history-mcp": {
"command": "taiwan-law-history-mcp"
}
}
}
Command Line Usage
# Run the MCP server
taiwan-law-history-mcp
# Test functionality
python -c "from taiwan_law_mcp.server import normalize_article_no; print(normalize_article_no('第十九條之一'))"
Usage
As an MCP Server
Add this to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"law-history-mcp": {
"command": "uv",
"args": ["run", "law-history-mcp"],
"cwd": "/path/to/law_history_mcp"
}
}
}
Example Tool Calls
Search for a law:
{
"tool": "search_law",
"arguments": {
"law_name": "農業保險法"
}
}
Get law history:
{
"tool": "get_law_history",
"arguments": {
"law_name": "農業保險法"
}
}
Convert ROC date:
{
"tool": "convert_dates",
"arguments": {
"roc_date": "1110520 修正"
}
}
Normalize article number:
{
"tool": "normalize_article_number",
"arguments": {
"article_text": "第十九條之一"
}
}
Data Format
The server returns structured JSON data with normalized fields:
- Article numbers are converted from Chinese (第十九條之一) to Arabic format (19-1)
- ROC dates are converted to Western dates (YYYY-MM-DD)
- Text is cleaned and normalized
- Modification types are extracted (制定, 修正, 全文修正, etc.)
Dependencies
- mcp >= 1.0.0
- requests >= 2.31.0
- beautifulsoup4 >= 4.12.0
- html5lib >= 1.1
- lxml >= 4.9.0
Technical Notes
- Uses custom SSL configuration to handle legacy government websites
- Implements proper session management and retry logic
- Handles timeout.html redirects automatically
- Supports multiple HTML parsers (html5lib, lxml, html.parser)
License
MIT License
Metadata
Release files for taiwan-law-history-mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| taiwan_law_history_mcp-0.1.4.tar.gz | 11.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| taiwan_law_history_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.3 kB
Release files / taiwan_law_history_mcp-0.1.4.tar.gz
| Download URL | taiwan_law_history_mcp-0.1.4.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf6e685f4eb9fd15b5def20c91f47b181f86a3076f476214b61ac926343d0d28
|
|
BLAKE2b-256 checksum How to use checksums |
c1f7b995d46b60c065d5551a503e8cf3c5bd20777bbce5a8abf9f201b14771ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / taiwan_law_history_mcp-0.1.4-py3-none-any.whl
| Download URL | taiwan_law_history_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05c5d7fefbdd1474df6e2f621079319ddac2345a7668ca78938dd32824e534d5
|
|
BLAKE2b-256 checksum How to use checksums |
f391167b7f5030ad25da9f8baa9e034a9af416f74cd581a30b2e0ba503b0f30c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|