台灣司法院判決 + 全國法規資料庫 MCP server · Query Taiwan legal data from any MCP AI agent
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"taiwan-legal-db": {
"args": [
"-m",
"mcp_server.server"
],
"command": ".venv/bin/python"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in legal
87 tools for Korean law — statutes, precedents, ordinances, interpretations | MCP Server · CLI · npm
Proof primitive for AI agents on MultiversX. Anchor file hashes on-chain as verifiable proofs.
956k Swiss court decisions: full-text search, citation graph, statute lookup (DE/FR/IT)
Query 750+ Swedish statutes, EU cross-references, case law, and preparatory works
MCP Security Weekly
Get CVE alerts and security updates for Mcp Taiwan Legal Db and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
English · 繁體中文
台灣法規、裁判書、憲法法庭裁判 — MCP Server。
讓任何 MCP 相容的 AI 助手直接存取台灣公開法律資料:
以 Python 搭配 FastMCP 寫成。純工具 wrapper,只連線台灣政府官方來源(詳見下方「資料來源與統計」),不發送任何其他網路請求;憲法法庭資料為內建離線打包。
| 功能 | 說明 |
|---|---|
| 8 個 MCP 工具 | 裁判書搜尋/全文、法規查詢、釋字/憲判字查詢、引用關係圖譜 |
| 離線快取 | 868 筆大法官解釋與憲判字(含理由書/意見書全文)從本地 JSON 即時回傳 |
| 引用關係圖譜 | 從理由書抽取所有引用的釋字/憲判字,追溯憲法學說演變 |
| 全文搜尋 | 裁判書關鍵字搜尋 + 釋字爭點/理由書全文搜尋 |
| 混合請求策略 | 預設用 httpx 直打(~0.25s),觸發司法院 F5 WAF 時自動以 Playwright 刷 cookie 後繼續 |
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)}'
print('✓ Setup OK')
"
預期輸出:
Server: 台灣法律資料庫
Tools: ['search_judgments', 'get_judgment', 'query_regulation', 'get_pcode', 'search_regulations', 'get_interpretation', 'search_interpretations', 'get_citations']
✓ Setup OK
上面沒報錯就完成了。Repo 根目錄已經帶一份 .mcp.json,任何在此資料夾內開的 Claude Code session 會自動載入這個 server,不需要額外註冊。
8 個 MCP 工具,全部唯讀,全部只打台灣政府的公開資料庫。
| 工具 | 用途 | 典型呼叫 |
|---|---|---|
search_judgments | 搜尋司法院裁判書資料庫 | search_judgments(keyword="預售屋 遲延交屋", case_type="民事") |
get_judgment | 依 JID 或 URL 取得單筆判決全文 | get_judgment(jid="TPSM,114,台上,3753,20251112,1") |
query_regulation | 查詢法規條文/範圍/全文/修法沿革 | query_regulation(law_name="民法", article_no="184") |
get_pcode | 將法規名稱解析為 pcode(法規代號) | get_pcode(law_name="律師法") |
search_regulations | 以關鍵字搜尋 11,700+ 部法規 | search_regulations(keyword="勞動") |
| 工具 | 用途 | 典型呼叫 |
|---|---|---|
get_interpretation | 大法官解釋/憲判字全文(離線快取) | get_interpretation("釋字748", reasoning_keyword="婚姻") |
search_interpretations | 搜尋釋字/憲判字(爭點 + 理由書全文) | search_interpretations(keyword="集會自由") |
get_citations | 引用關係圖譜(往前追溯) | get_citations("釋字748", include_context=True) |
search_judgments搜尋司法院判決系統。支援:
case_word + case_number + year_fromkeywordmain_text="被告應將 移轉" + keyword="借名登記" → 找被告敗訴的借名登記案court、case_type(民事/刑事/行政/懲戒)、year_from/year_to 過濾重要:要查某個特定案號時,一定要用 case_word+case_number,不要放進 keyword。
# ✅ 正確 — 查 114 台上 3753 最高法院
search_judgments(case_word="台上", case_number="3753", year_from=114, court="最高法院")
# ✅ 正確 — 全文搜尋
search_judgments(keyword="預售屋 遲延交屋")
# ❌ 錯 — 把案號放進 keyword
search_judgments(keyword="114年度台上字第3753號")
get_judgment取得單筆判決的結構化全文。
jid(從 search_judgments 結果取得)或 url