
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 分