
Pk Eli Mcp
io.github.matematicsolutionsPublished by GitHub account matematicsolutionsv0.4.4Updated Oct 24, 2026
MCP server for Pakistani law: search and cite federal statutes and Supreme Court judgments.
Overview
A local MCP server that lets an assistant search Pakistani federal statutes and Supreme Court judgments, fetch full texts, and verify legal citations.
- What you can do
- Search and retrieve federal statutes by keyword or law ID, with full text up to a length limit, and search Supreme Court judgments and fetch a single decision's full text by row index or case ID. Verify citations in drafted text, extracting statute sections, act numbers, Constitution articles and registry citations and checking them against the corpus, flagging nonexistent provisions and listing what could not be checked. Report corpus coverage, capture dates and explicit gaps with fallbacks. Every response carries a citation contract with a stable URI, a human-readable citation and a source URL.
- When to use it
- Useful when drafting or reviewing material that cites Pakistani law and you want statute and judgment text plus a check that cited provisions actually exist. Also suited to research where the snapshot dates and coverage limits are acceptable.
- Requirements
- Runs locally as a Python package (uvx or pip install), so Python and uv or pip are needed; on Windows 11 with Smart App Control, run it through the signed python interpreter instead of the blocked launchers. Network access is needed: the statute corpus (about 47 MB) is downloaded once and cached, and judgment searches are sent to Hugging Face's public datasets-server. Optional environment variables set the cache directory, audit log directory and corpus mirror URL.
Installation
In SourceWeft
- Open Pk Eli Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit 43a38fb
Tools
0Version history
2- v0.4.4LatestOct 6, 2026
- v0.4.3Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts