
Pk Eli Mcp
io.github.matematicsolutions由 GitHub 帳號 matematicsolutions 發布v0.4.4更新於 Oct 24, 2026
MCP server for Pakistani law: search and cite federal statutes and Supreme Court judgments.
概覽
本機 MCP 伺服器,讓助理檢索巴基斯坦聯邦法規與最高法院判決、取得全文,並核驗法律引註。
- 可以做什麼
- 依關鍵字或法規 ID 檢索並取得聯邦法規全文,全文有長度上限;檢索最高法院判決,並依列號或案件 ID 取得單一判決全文。核驗草稿中的引註,擷取法條、法令編號、憲法條文與登記引註並與語料比對,標出並不存在的條文,並列出無法核驗的部分。回報語料涵蓋範圍、擷取日期以及明確的缺口與替代做法。每個回應都附帶引註約定,包含穩定 URI、可讀引註與來源連結。
- 適用情境
- 適合起草或審閱引用巴基斯坦法律的文稿時,需要法規與判決原文並確認所引條文確實存在。也適合能接受快照日期與涵蓋範圍限制的研究工作。
- 執行需求
- 以 Python 套件在本機執行(uvx 或 pip 安裝),需要 Python 及 uv 或 pip;在啟用 Smart App Control 的 Windows 11 上,應透過已簽章的 python 解譯器執行,而非被封鎖的啟動器。需要網路:法規語料(約 47 MB)首次下載後快取,判決檢索會傳送到 Hugging Face 的公開 datasets-server。選用環境變數可設定快取目錄、稽核日誌目錄與語料鏡像位址。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pk Eli Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
pk-eli-mcp
MCP server for Pakistani law: 967 federal statutes and 1,414 Supreme Court of Pakistan judgments, full text, with a strict citation contract on every response.
Pakistan publishes no machine-readable legal API, so this connector is corpus-based: it serves two public HuggingFace mirrors of official sources instead of querying a government endpoint live.
Honest limits, stated up front: both collections are static snapshots.
Amendments after 2025-01-30 and judgments after 2024-07-26 are absent, and the
judgment corpus is a subset of the Court's output. Every response repeats this
in dataset_note. Verify currency against pakistancode.gov.pk
and scp.gov.pk before relying on a provision.
Tools
Citation verification (pk_verify_citations)
Run it on a drafted answer, memo or pleading before it reaches a reader. The tool extracts every checkable citation and verifies it against the corpus:
- statute sections:
section 302 of the Pakistan Penal Code,section 10A of the Pakistan Study Centres Act, 1976,sections 6 and 7 of ...,sub-section (1) of section 6 of ...; - act coordinates:
Act No. XLV of 1860,Ordinance No. LII of 2000(Roman or Arabic); - Constitution articles:
Article 184(3) of the Constitution(the tail is required - a bareArticle 5could be any instrument and is deliberately ignored); - Supreme Court registry citations:
Crl.A. 93/2013,Criminal Appeal No. 93 of 2013.
The semantics are deliberately hard:
- A cited section that does not exist makes the whole result
HALLUCINATION_DETECTEDwithisError=true, plus a range hint of what does exist (section 999 does not exist in this act; 59 sections are machine-detectable in its text, numbered section 1-66). NO_CITATIONS_FOUNDis not a success - it means there was nothing to check.- A parenthetical description right after a citation
(
section 302 of the Pakistan Penal Code (punishment of qatl-i-amd)) is content-checked against the real provision text with a character-trigram match. A mismatch is a review signal, never a hard block. - Everything the tool could NOT check is listed in a structured
gapsfield. The judgment corpus is a subset and roughly half the statute PDFs carry no machine-readable coordinate header, so an unresolvable citation is reported asout_of_corpus("existence UNKNOWN, not disproven"), never as a hallucination.
The parse-verify-report pattern is adapted from
korean-law-mcp (MIT) - see
THIRD_PARTY.md. The same pattern shipped first in it-eli-mcp v0.6.0; the fleet
rollout plan lives in docs/VERIFY-ROLLOUT.md.
Citation contract
Pakistan has not deployed ELI. Every response still carries the fleet contract:
eli_uri- a stable, resolvable URL: the canonical pakistancode.gov.pk PDF for statutes, the dataset row URI for judgments. Never invented; seeeli_note.human_readable_citation- e.g.THE PRIVATISATION COMMISSION ORDINANCE, 2000orSupreme Court of Pakistan, Crl.A. 93/2013.source_url- where a human can read the same document.
Install
As a Claude plugin (Claude Code or the desktop app, needs uv); see plugin/README.md for what it sends and stores:
As a standalone server:
Claude Code:
Or drop .mcp.json.example into your project as .mcp.json.
Windows 11 with Smart App Control
Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe
and the pk-eli-mcp.exe launcher that pip writes at install time. The python.exe and
py.exe from the python.org installer are signed by the Python Software
Foundation, so running the module through the interpreter works:
pip.exe is blocked for the same reason, so install with python -m pip, not
pip install. If python is not on PATH, use the Windows launcher: py -3 -m pk_eli_mcp.
Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.
Configuration
Network: statute searches run on the local corpus; judgment searches send the query to Hugging Face's public datasets-server. The corpus is downloaded once, from the mirror above or from Hugging Face. No LLM provider, no telemetry.
Development
Governance
Read-only by design: the server can search and fetch, never write. Every tool
call appends an audit line (~/.matematic/audit/pk-eli-mcp.jsonl) with a SHA-256
input hash, duration and status. See CONSTITUTION.md for the rules this
connector is built under and DISCOVERY.md for how the sources were chosen.
License
Apache-2.0 for this code. The datasets keep their own licenses (ODC-BY 1.0 and MIT); the underlying texts are Government of Pakistan public legal documents.
來源:README.md,提交 43a38fb
工具
0版本歷史
2- v0.4.4最新Oct 6, 2026
- v0.4.3Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分