Mcp Taiwan Legal Db
Description
台灣司法院判決 + 全國法規資料庫 MCP server · Query Taiwan legal data from any MCP AI agent
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
mcp-taiwan-legal-db
[English](https://github.com/lawchat-oss/mcp-taiwan-legal-db/blob/main/README.en.md) · **繁體中文**
台灣法規、裁判書、憲法法庭裁判 — MCP Server。
讓任何 MCP 相容的 AI 助手直接存取台灣公開法律資料:
- 司法院裁判書 — judgment.judicial.gov.tw(全文搜尋 + 取得)
- 全國法規資料庫 — law.moj.gov.tw(11,700+ 部法規)
- 憲法法庭 — cons.judicial.gov.tw(868 筆大法官解釋 + 憲判字,含理由書全文,離線快取)
以 Python 搭配 [FastMCP](https://github.com/modelcontextprotocol/python-sdk) 寫成。純工具 wrapper,只連線台灣政府官方來源(詳見下方「資料來源與統計」),不發送任何其他網路請求;憲法法庭資料為內建離線打包。
特色
| 功能 | 說明 |
|---|---|
| 8 個 MCP 工具 | 裁判書搜尋/全文、法規查詢、釋字/憲判字查詢、引用關係圖譜 |
| 離線快取 | 868 筆大法官解釋與憲判字(含理由書/意見書全文)從本地 JSON 即時回傳 |
| 引用關係圖譜 | 從理由書抽取所有引用的釋字/憲判字,追溯憲法學說演變 |
| 全文搜尋 | 裁判書關鍵字搜尋 + 釋字爭點/理由書全文搜尋 |
| 混合請求策略 | 預設用 httpx 直打(~0.25s),觸發司法院 F5 WAF 時自動以 Playwright 刷 cookie 後繼續 |
⚡ 安裝(PyPI,推薦)
pip install mcp-taiwan-legal-db
**Debian / Ubuntu / WSL 注意**:系統 Python 受 PEP 668 保護,直接 `pip install` 會被擋。請改用:
pipx install mcp-taiwan-legal-db(推薦,自動建隔離 venv,CLI tool 標準裝法)- 或
pip install --user --break-system-packages mcp-taiwan-legal-db
裝完後 entry point `mcp-taiwan-legal-db` 會在 PATH 上。**接到 Claude Code**(任何專案都能用):
claude mcp add taiwan-legal-db mcp-taiwan-legal-db --scope user
接著 `/mcp` 重啟連線、Claude 就會在自然語言查詢時自動用 8 個 MCP tool。
**選擇性 — F5 WAF fallback**:
playwright install chromium # 僅在司法院 WAF 觸發時用,平時 idle
開發環境設置
下面是 clone 來修程式 / 跑測試的流程:
# 1. Clone repo
git clone https://github.com/lawchat-oss/mcp-taiwan-legal-db.git
cd mcp-taiwan-legal-db
# 2. 建立並初始化虛擬環境
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -e .
# 3. 安裝 Playwright Chromium(僅在司法院 WAF 觸發時使用,一般查詢不會啟動)
.venv/bin/playwright install chromium
# 4. 驗證伺服器可以啟動並註冊 8 個工具
.venv/bin/python -c "
import asyncio
from mcp_server.server import mcp
print('Server:', mcp.name)
tools = asyncio.run(mcp.list_tools())
print('Tools:', [t.name for t in tools])
assert len(tools) == 8, f'Expected 8 tools, got {len(tools)}'
Related Skills
mcp-server-postgres
Read-only PostgreSQL database access.
Data mcp-server-sqlite
SQLite database interaction and querying.
Data mcp-server-google-maps
Google Maps integration for location data.
Data Bitbucket Data Center
---
Data Csv Data Summarizer
Automatically analyze CSV files and generate comprehensive insights with visualizations
Data Financial Services
Reference agents, skills, and data connectors for the financial-services workflows we see most — investment ba
Data