pk-eli-mcp
This server provides corpus-based access to Pakistani federal statutes and Supreme Court judgments for legal research and citation verification.
Core capabilities:
Search federal statutes (
pk_search_laws): Keyword search across 967 federal statutes with title-weighted ranking, returning law IDs, titles, snippets, and source URLs. (First call downloads and caches a ~47 MB corpus.)Retrieve full statute text (
pk_get_law): Fetch complete statute text by corpus ID, truncated at ~300,000 characters for large laws.Search Supreme Court judgments (
pk_case_search): Full-text search across 1,414 Supreme Court of Pakistan judgments, returning case IDs, row indices, snippets, and source URLs.Retrieve full judgment text (
pk_get_decision): Fetch complete judgment text by dataset row index or registry citation (e.g.,Crl.A. 93/2013).Verify legal citations (
pk_verify_citations): Extract and validate Pakistani legal citations from any text (drafts, memos, pleadings) — checking statute sections, act coordinates, Constitution articles, and Supreme Court registry citations — with hallucination detection, range hints for non-existent sections, content mismatch warnings, and reporting of unverifiable gaps.
Design properties:
Every response includes a stable
eli_uri,human_readable_citation, andsource_url.Read-only; all tool calls are logged with a SHA-256 input hash, duration, and status.
Key limitations:
Corpora are static snapshots (statutes: 2025-01-30; judgments: 2024-07-26) — amendments and newer judgments are not reflected.
The judgment corpus is a subset of the Court's full output; a missing case does not prove non-existence.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pk-eli-mcpsearch for Pakistan Penal Code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Collection | Source | Snapshot | License |
Federal statutes (967) | Pakistan_Laws_Dataset, collected from pakistancode.gov.pk PDFs (Ministry of Law and Justice) | 2025-01-30 | ODC-BY 1.0 |
Supreme Court judgments (1,414) | 2024-07-26 | MIT |
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
Tool | What it does |
| Keyword search over the 967 federal statutes (title-weighted). First call downloads the 47 MB corpus once, then serves from cache. |
| Full statute text by |
| Server-side full-text search over the Supreme Court judgments. |
| One judgment's full text, by |
| Anti-hallucination check: extracts Pakistani legal citations from any text and verifies each against the corpus. |
Related MCP server: swiss-courts-mcp
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
uvx pk-eli-mcp # or: pip install pk-eli-mcpClaude Code:
claude mcp add pk-eli-mcp -- uvx pk-eli-mcpOr 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:
python -m pip install pk-eli-mcp
python -m pk_eli_mcppip.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.
{ "mcpServers": { "pk-eli-mcp": { "command": "python", "args": ["-m", "pk_eli_mcp"] } } }Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.
Configuration
Env | Default | Purpose |
|
| Corpus file + HTTP cache |
|
| JSONL audit log (one line per tool call) |
Development
python -m venv .venv && .venv/Scripts/pip install -e ".[dev]" # Linux/macOS: .venv/bin/pip
ruff check src tests
pytest tests/test_instructions_drift.py tests/test_corpus.py # offline
pytest tests/test_smoke.py # live (downloads the corpus)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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server providing AI assistants access to Canadian case law and legislation metadata from CanLII across all jurisdictions, supporting search and citation relationships.Last updated7295MIT
- AlicenseAqualityAmaintenanceMCP server for searching Swiss court decisions from federal and cantonal courts via entscheidsuche.ch. Enables full-text search, law reference lookup, and filtering by canton, court level, and date without API keys.Last updated71MIT
- Flicense-qualityDmaintenanceAn MCP server for searching and citing research papers using RAG, enabling semantic search, citation finding, and question answering over a collection of PDF papers.Last updated
- Alicense-qualityAmaintenanceAn MCP server for accessing Turkish legislation (laws, regulations, decrees) via the Adalet Bakanligi API, providing search, full-text retrieval, and structured citations.Last updatedApache 2.0
Related MCP Connectors
Public Indian legal search MCP for Roop judgments, statutes, and corpus grounding.
Task-oriented MCP for Indonesian law: search, resolve citations, read laws, and MK decisions.
MCP for CanLII: Canadian case law and legislation metadata (federal, provincial, territorial).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/matematicsolutions/pk-eli-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server