Skip to main content
Glama

twlawexam-mcp

PyPI Python License: MIT

台灣司法官/律師考試(司律一試、二試)歷屆試題 MCP 伺服器。 內建 109–114 年共 1,940 題(含測驗題標準答案、申論題 AI 擬答、法條反查、考點與爭點索引), 裝好就能在 Claude Code / Claude Desktop 裡查題、抽題練習、記錄作答、看弱點、排讀書計畫、讓 AI 逐爭點批改申論。

資料留在你本機,不上雲、不連網、不需要 API key。


安裝(一行)

需要 uv(沒有的話:pip install uv)。

Claude Code

claude mcp add twlawexam -- uvx twlawexam-mcp

Claude Desktop — 在 claude_desktop_config.json 加入:

{
  "mcpServers": {
    "twlawexam": {
      "command": "uvx",
      "args": ["twlawexam-mcp"]
    }
  }
}

其他 MCP 客戶端(Cursor、Codex、Cline…):指令都是 uvx twlawexam-mcp,stdio 傳輸。

裝好之後對 Claude 說「給我抵押權 5 題」「我常錯什麼」「剩 30 天怎麼念」就會動了。 伺服器自帶教學指令(怎麼出題、怎麼批改申論、怎麼安排複習),不用自己寫 prompt。

還沒上 PyPI 之前,或想用 GitHub 最新版: uvx --from git+https://github.com/pass-and-prosper/twlawexam-mcp twlawexam-mcp


Related MCP server: xingce-solver

能做什麼

查題

工具

用途

search_questions

全文搜尋歷屆考題(匹配題幹/選項/擬答)

get_question

以 qid(年-考試-科目-題號)取得單題結構化內容

list_exams / list_subjects

列出可查的考試別、年度範圍與科目

get_exam_paper

取整份試卷(某年・某考試・某科目全部題目)

get_answer_key

測驗題標準答案(題號 → 答案)

get_model_answer

申論題 AI 擬答(含免責聲明)

search_by_statute

按法條反查考過哪些題

get_statute_frequency

法條考頻統計

考點與爭點

工具

用途

get_exam_map

考點地圖:科目 → 子科目 → 考點層級,附各科實際題數

get_topic_distribution

考點熱度排行(精準到「抵押權」層級)

get_topic_primer

考點重點提示:核心法條/常考判決釋字/學說對立/易錯陷阱

get_issue_distribution

申論爭點熱度排行(學說/實務交鋒點)

search_by_issue

依爭點找題,附各題的學說對立與實務見解

get_issues

取某申論題拆出的所有爭點與實務字號

get_issue_primer

爭點重點包:辨識訊號、前置觀念、考點重點

get_issue_chain

爭點脈絡圖:一題多個爭點的先決問題鏈

練習與批改

工具

用途

random_practice

依條件隨機抽題(可隱藏答案)

practice_by_topic

依考點抽題(「給我抵押權 5 題」)

essay_exam_by_topic

考點申論題卷(模擬考)

record_answer

記錄作答、自動批改、更新間隔重複排程

get_grading_rubric

申論批改評分表:爭點 checklist、學說對立、實務字號、五維評分準則

進度、弱點、讀書計畫

工具

用途

get_progress

學習總覽:作答數、答對率、今天到期複習數

get_weak_topics

弱點地圖:各考點答對率由弱到強

practice_weak

弱點練習:優先出到期複習與最弱考點

get_error_diagnosis

錯誤類型診斷:觀念混淆/掉陷阱/粗心

get_readiness

考試就緒度:依考點頻率加權推估分數與覆蓋率

get_study_plan

讀書計畫:綁考試日,排出攻擊順序與今日任務

reset_progress

清空作答記錄與複習排程


練習記錄放哪裡

作答記錄與複習排程寫在你本機的 progress.db,與題庫分開存放,是單機、個人的資料,不會被打包或上傳。 自 0.6 起它放在使用者資料夾、不在套件目錄裡,所以升級套件不會清掉進度:

平台

位置

Windows

%LOCALAPPDATA%\twlawexam-mcp\progress.db

macOS

~/Library/Application Support/twlawexam-mcp/progress.db

Linux

$XDG_DATA_HOME/twlawexam-mcp/progress.db(預設 ~/.local/share/...)

要換位置(例如放進雲端同步資料夾),設環境變數 TWEXAM_PROGRESS_DB 指到檔案路徑即可。


手機也能用

把伺服器改成 HTTP 模式,配 Cloudflare Tunnel 接到 Claude.ai 的自訂連接器,手機 App 就能用同一份題庫。 步驟見 docs/phone-setup.md。


從原始碼開發

git clone https://github.com/pass-and-prosper/twlawexam-mcp
cd twlawexam-mcp
uv venv
uv pip install -e ".[dev]"
uv run pytest -q

Claude Code 會自動讀專案根目錄的 .mcp.json,開發中的版本即載入為 twexam 伺服器。 該檔預設指向 Windows 的 .venv\Scripts\python.exe,macOS / Linux 請改成 .venv/bin/python。

打包發佈:python scripts/build_release.py。它會先確認題庫裡沒有個人作答資料才打包。

重建題庫(一般使用者不需要):pip install -e ".[ingest]" 後執行 python -m twexam_mcp.ingest.run,從考選部公開資料重新下載、解析。


資料來源

考選部公開資訊(政府公開資料),網域:wwwq.moex.gov.tw、wwwc.moex.gov.tw。


免責聲明

  • get_model_answer 與批改素材中的 AI 擬答為機器自動生成,並非官方解答或任何主管機關之見解。

  • 本工具所有內容不得作為應試依據、法律意見或任何正式文件之引用。

  • 考選部公告之標準答案與評分準則以官方公告為準。

  • 使用者應自行判斷資訊之準確性,作者及貢獻者不承擔任何因使用本工具所生之損失或法律責任。


授權

MIT License — 詳見 LICENSE。

Available Tools

29 tools
essay_exam_by_topicA

考點申論題卷(模擬考):把某考點或某子科目的所有申論題一次考出來,預設直接附 AI 擬答。 topic_point 或 topic_subject 至少給一個;show_answer=False 可先自己作答再看擬答。

Inputs: show_answer, topic_point, topic_subject.

get_answer_keyB

取某份試卷的測驗題標準答案(題號→答案)。

Inputs: year (required), subject (required), exam_code (required).

get_error_diagnosisA

錯誤類型診斷(不只正確率,要『為什麼錯』):回傳每筆答錯題帶——你反覆選的錯選項+正解 +逐項詳解+該題錯幾次+考點,並標『同考點群聚』。據此歸納誤解類型:①觀念混淆(把A當B) ②掉陷阱(選最誘人的錯選項)③粗心(偶發)。wrong_times≥2 或群聚=系統性,優先補。

Inputs: limit, q_type.

get_exam_mapA

考點地圖:各科目層級與核心考點(trial='sl1'/'sl2'/None=全部)。

Inputs: trial.

get_exam_paperB

取整份試卷(某年·某考試·某科目全部題目)。

Inputs: year (required), subject (required), exam_code (required). Returns: result

get_grading_rubricA

申論批改評分表(學生寫完申論作答後呼叫):一次備齊批改該題所需素材——爭點 checklist +學說對立+實務字號+🔍辨識訊號/📐前置觀念+滿分擬答+五維評分準則。供你逐爭點對照 學生作答給形成性回饋(爭點漏抓/要件未涵攝/學說未選邊/字號漏引/架構),不打硬分數。

Inputs: qid (required).

get_issue_chainB

爭點脈絡圖:一題的多個爭點不是孤立的——回傳它們的『先決問題』鏈(誰是誰的先決問題、 事實哪個轉折引爆下一個爭點)。破解「孤立考點背熟、遇綜合題卻看不出脈絡」。帶使用者解綜合 申論前先看脈絡;單爭點題或尚未編脈絡者 chain 為空。

Inputs: qid (required).

get_issue_distributionB

爭點熱度排行:申論真實考點(學說/實務交鋒點)考過幾題,由多到少。可選子科目篩選。

Inputs: topic_subject. Returns: result

get_issue_primerA

申論爭點重點包(做題前必讀):🔍辨識訊號(怎麼從事實認出此爭點)+📐前置觀念 (要先懂的定義/法理)+考點重點。issue 可給標準爭點名或原始爭點字串(自動正規化)。

Inputs: issue (required).

get_issuesA

取某申論題拆出的所有爭點:爭點名+學說對立+實務見解(判例/決議/釋字/憲判字號)。

Inputs: qid (required). Returns: result

get_model_answerB

取申論題 AI 擬答(含免責聲明)。

Inputs: qid (required).

get_progressC

學習總覽:總作答數、答對率、已練題數、今天到期複習數。

Inputs: q_type.

get_questionA

以 qid(年-考試-科目-題號)取得單題結構化內容。

Inputs: qid (required).

get_readinessC

考試就緒度:依考點頻率加權推估分數、覆蓋率、最拖分考點、每日覆蓋進度(target=及格參考線)。

Inputs: daily, q_type, target.

get_statute_frequencyC

法條考頻統計(可選 exam_code)。

Inputs: exam_code.

get_study_planA

讀書計畫引擎(綁考試日的處方):把「弱點×考點頻率」排成攻擊順序,依剩餘天數排出分相日程 (掃弱點→申論模擬→衝刺複習)+今日該做什麼+進度夠不夠的誠實判斷。days_remaining 請用 使用者的考試日期減今天算出。非及格保證,作答數據越多越準。

Inputs: days_remaining (required), daily, q_type, target.

get_topic_distributionA

考點熱度排行:各 (子科目, 考點) 考過幾題(q_type='mcq'/'essay',exam_code='sl1'/'sl2')。

Inputs: q_type, exam_code. Returns: result

get_topic_primerC

考點重點提示:做題前必讀的核心法條/常考判決釋字/學說對立/易錯陷阱。

Inputs: topic_point (required).

get_weak_topicsC

弱點地圖:依個人作答正確率,由弱到強列出各考點(含答對率)。

Inputs: limit, q_type, min_attempts. Returns: result

list_examsA

列出可查的考試別與年度範圍。

Inputs: no named parameters. Returns: result

list_subjectsB

列出科目(可選 exam_code 篩選)。

Inputs: exam_code. Returns: result

practice_by_topicB

依考點抽題練習(topic_point 為必填,如「抵押權(普通/最高限額)」)。

Inputs: topic_point (required), n, seed, q_type, +2 more. Returns: result

practice_weakA

弱點練習:優先出「今天到期複習」與「最弱考點」的題目(hide_answer 預設隱藏答案)。

Inputs: n, q_type, subject, hide_answer. Returns: result

random_practiceC

依條件抽題練習(hide_answer 可隱藏答案/擬答)。

Inputs: n, seed, q_type, subject, +2 more. Returns: result

record_answerB

記錄一次作答並自動批改+更新間隔重複排程。MCQ 自動對答案;申論可傳 self_correct 自評。

Inputs: qid (required), answer, self_correct.

reset_progressA

清空所有作答記錄與複習排程(重新開始)。

Inputs: no named parameters.

search_by_issueA

依爭點找題:某爭點(如「不能未遂之判斷標準」)考過哪幾題,附各題的學說對立與實務見解。

Inputs: issue (required). Returns: result

search_by_statuteB

按法條反查考過哪些題。

Inputs: statute (required). Returns: result

search_questionsB

全文搜尋歷屆考題(匹配題幹/選項/擬答)。

Inputs: query (required), limit. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but a few pairs could be confused, such as get_issue_primer vs get_topic_primer and get_issue_distribution vs get_topic_distribution, which both offer preparatory/statistical content centered on either issues or topics. Descriptions are detailed enough to resolve most ambiguities, but the overlap is notable.

    Naming Consistency4/5

    The vast majority follow snake_case verb_noun conventions (e.g., get_readiness, list_subjects, search_questions, practice_by_topic). Minor deviations like random_practice and essay_exam_by_topic break the pattern slightly, but overall the naming is predictable and readable.

    Tool Count4/5

    At 29 tools, the surface is on the heavy side, but each tool serves a distinct function within a comprehensive exam preparation workflow—from question retrieval and practice to analytics, grading, and study planning. The count is justified by the breadth of the domain, though consolidation of a few overlapping utilities could make it tighter.

    Completeness5/5

    The tool set covers the full exam prep lifecycle: exam and question discovery, practice in multiple modes, answer recording and grading, progress tracking, weakness analysis, study planning, and detailed issue breakdowns. There are no obvious dead ends or missing core operations for the stated purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      一个优化过的台湾法规查询MCP服务器,提供高效的法规搜索、条文查询和关键字搜索功能,支持摘要模式减少token消耗。
      MIT