polish-legal-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
polish-legal-mcp
Free, open-source remote MCP server that lets Claude (web, desktop, mobile) and other MCP clients retrieve, inspect and cite official Polish legislation (ELI API of the Sejm — Dziennik Ustaw, Monitor Polski), bills pending in the Sejm (API Sejmu), EU law and CJEU case law in Polish (EU Publications Office / EUR-Lex) and court decisions (SAOS), with explicit, component-level verification of what could and could not be established.
Ważne / Important
Serwer jest narzędziem pomocniczym, nie źródłem opinii prawnych. Każde twierdzenie bez statusu
VERIFIEDnależy traktować jako niezweryfikowane.Nie wklejaj do publicznych usług AI informacji poufnych, niejawnych, wewnętrznych dokumentów urzędu, danych osobowych ani opisów spraw zawierających takie dane.
Projekt nie jest oficjalnym narzędziem żadnego organu ani instytucji publicznej.
What it does
Main use case: helping public-administration employees prepare applications, letters and legal justifications with correct, sourced citations:
„Przygotowuję wniosek dotyczący zakwaterowania żołnierza. Znajdź odpowiednie przepisy, podaj ich aktualne brzmienie, wskaż artykuły i przygotuj propozycję uzasadnienia."
Claude does the language work; this server supplies authoritative source material, links and verification results. It never uses an extra LLM and never fabricates acts, articles, dates or case numbers.
Related MCP server: mcp-isap
MCP tools
Tool | Purpose |
| Search acts by title fragments / ELI keyword; base acts ranked before amending acts. |
| Metadata, status, dates, text formats, consolidated texts, paged table of contents. |
| Exact wording of art./ust./§/pkt/lit. from official HTML, citation, later amendments, verification report. |
| EU regulations/directives/decisions by words of the Polish title (EUR-Lex metadata); base legislative acts in force first. |
| Polish acts implementing an EU directive as notified to the Commission (EUR-Lex national implementing measures), mapped to ELI with the official ELI title for cross-checking. |
| EU law (e.g. RODO) by CELEX, act number or alias: most current Polish wording from the EUR-Lex consolidated version (amendments + corrigenda), OJ citation, verification report. |
| Amending acts with ELI dates, pending amendments, amendments after the latest consolidated text, TK rulings. |
| Parse a citation ("art. 61 § 1 k.p.a.", "… (Dz. U. z 2025 r. poz. 817)"), resolve the act, check unit, wording and date. |
| Candidate acts: ELI keyword vocabulary + title stems, optionally ( |
| SAOS search (common courts, Supreme Court, Constitutional Tribunal, KIO) with paging. |
| Judgment metadata, legal bases, referenced regulations, paged text, phrase excerpts, citation built from SAOS metadata ("wyrok Sądu Najwyższego z dnia …, I CSK …"). |
| CJEU / General Court decisions interpreting an EU act (optionally one article, e.g. RODO art. 17), newest first, from EU Publications Office metadata. |
| CJEU decision in Polish by case number, ECLI or CELEX: operative part, selected numbered paragraphs or paragraphs matching a phrase, interpreted provisions, language of the case, citation with ECLI and "pkt N". |
| Bills pending in the Sejm (current term) whose title names a given act or contains a phrase, with the current stage and links (Sejm, RCL). |
| Judgments (newest first) whose SAOS metadata cite a given provision, e.g. art. 5 k.c.; each one confirmed against its list of cited provisions. |
Tool names are English; descriptions and messages are Polish. All outputs are typed (structured content) and bounded.
Verification statuses
VERIFIED, UNVERIFIED, NOT_FOUND, NOT_APPLICABLE, SOURCE_UNAVAILABLE — reported
separately for source authenticity, act existence, unit existence, exact wording, act in force on
the date, temporal applicability of the wording, amendment completeness (always UNVERIFIED)
and substantive relevance (always UNVERIFIED). Full semantics:
docs/legal-verification.md.
Example (real data, 2026-10-30): art. 61 § 1 k.p.a. → wording read from the current consolidated
text Dz. U. 2025 poz. 1691 (PDF only) and confirmed against the last official HTML text →
exact_wording and temporal_applicability: VERIFIED; amendment_completeness: UNVERIFIED.
Requirements
Python 3.12+ (3.13 pinned in
.python-version), uvDocker (for container deployment); a Raspberry Pi 4/5 with 64-bit OS for the reference setup
For remote use: Tailscale account (free) and a Google OAuth client or GitHub OAuth App (free)
Quick start (local)
uv sync
uv run polish-legal-mcp # http://127.0.0.1:8000/mcp (development, no auth)
curl -fsS http://127.0.0.1:8000/healthConfiguration
Environment variables with prefix PLMCP_ (see .env.example):
Variable | Default | Notes |
|
|
|
|
| Docker image sets |
|
|
|
| – | Public HTTPS URL without |
| – | GitHub OAuth App. |
| – | ≥32 random chars. |
| – | Comma-separated allowlist (GitHub mode). |
| – | Google OAuth client (Web application). |
| – | Comma-separated allowlist of Google-verified e-mails (Google mode). |
| – | Comma-separated Google Workspace domains: all accounts managed by the domain (Google mode). |
|
| Per user. |
|
| Upstream calls. |
|
| In-memory cache (metadata TTL, max documents). |
|
| Cache time for texts of published acts (ELI struct/HTML/PDF, EUR-Lex documents). |
| k.c., k.p.c., k.p.a., k.p. | Production: acts whose newest texts are loaded at start-up and every 6 h (empty = off). |
Testing
uv run pytest # offline suite: real captured ELI/SAOS fixtures, mocked with respx
uv run pytest -m live # optional smoke tests against the real APIs
uv run ruff check . && uv run ruff format --check . && uv run pyrightDocker
docker compose up -d --build # loopback-only port, non-root, read-only FS, healthcheck
docker compose psRemote deployment (Raspberry Pi + Tailscale Funnel)
Short version — full runbook with verification commands in docs/deployment.md:
Pi OS 64-bit, Docker,
sudo tailscale up, enable MagicDNS + HTTPS + Funnel in the tailnet.GitHub OAuth App with callback
https://<pi>.<tailnet>.ts.net/auth/callback..envwithPLMCP_ENV=production, GitHub credentials, JWT key, allowed logins.docker compose up -d --build && sudo tailscale funnel --bg 8000.From outside the LAN:
curl https://<pi>.<tailnet>.ts.net/healthand expect401on/mcp.
Hosts without Docker can use the hardened systemd unit and installer in deploy/ (§3.8). A VPS + Caddy variant is in the same document.
Claude integration (incl. mobile)
claude.ai → Settings → Connectors → Add custom connector (the Free plan allows one).
URL
https://<pi>.<tailnet>.ts.net/mcp; leave OAuth client ID/secret empty.Connect → consent page → sign in with an allowlisted Google or GitHub account.
Enable the connector in a chat and ask in Polish, e.g.:
„Znajdź ustawę o gospodarce nieruchomościami."
„Podaj artykuły dotyczące zakwaterowania żołnierzy."
„Sprawdź, czy art. 61 § 1 k.p.a. obowiązuje na dzień 29 października 2026 roku."
„Znajdź orzeczenia dotyczące gospodarowania nieruchomościami Skarbu Państwa."
„Zweryfikuj podstawę prawną: art. 61 § 1 k.p.a. i podaj link do oficjalnego źródła."
„Podaj propozycję uzasadnienia wniosku na podstawie znalezionych przepisów, wyraźnie oznaczając wszystkie nieweryfikowane twierdzenia."
Mobile: the connector is available in the Claude app (Android/iOS) on the same account; the server is reached through Anthropic's infrastructure, so it must be publicly reachable.
No Anthropic API key and no running Claude Code are needed after deployment. The server cannot guarantee Claude's final wording — it supplies evidence; check the statuses.
Security
HTTPS via Funnel, OAuth 2.1 (DCR/CIMD, PKCE) with Google or GitHub sign-in and an allowlist, fail-closed production config, Host guard, per-user rate limits, bounded inputs/outputs, no arbitrary URL fetching, no logging of tool arguments, hardened container. Details: docs/security.md.
Known limitations
ELI has no HTML for acts published since 2025 → the server reads the PDF: unchanged provisions are confirmed against the last HTML text (
VERIFIED); changed ones are read automatically from the PDF and markedUNVERIFIEDwith the page number to check.SAOS has no administrative-court (WSA/NSA) judgments and is not complete.
Search is lexical (titles/keywords), not full-text or semantic.
EU law: acts are found by number/CELEX/alias or words of the Polish title (no full-text search); wording comes from the EUR-Lex consolidated version, which is informational — the Official Journal text is binding. CJEU decisions in Polish are translations.
Amendment completeness, staged entry into force of amending acts and transitional provisions are not verified.
See docs/limitations.md.
Roadmap
Delivered items, sources blocked for lack of an official API (e.g. WSA/NSA) and deliberate non-goals: docs/roadmap.md.
Documentation
architecture · API research · legal verification · security · deployment · limitations · roadmap
License
MIT — see LICENSE. Legal texts and judgments come from public official sources (api.sejm.gov.pl, saos.org.pl, publications.europa.eu).
This server cannot be deployed
Maintenance
Related MCP Connectors
Polish statutes (Dziennik Ustaw, ELI) and court rulings (SAOS) for AI agents. Runs on Apify.
Polish and EU law: statutes, rulings, UODO/UOKiK/KNF, EU regulations, citation checks. Free tier.
Resolve, search and verify legal citations against the official sources, with provenance.
Semantic search over Polish law and case law, citing the exact in-force article.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI-powered legal research and analysis of Polish legal acts from the Sejm API. Provides comprehensive search, document retrieval, metadata analysis, and content access for legal documents from Dziennik Ustaw and Monitor Polski.1323MIT
- AlicenseAqualityCmaintenanceMCP server for Polish legislation (ISAP / Sejm) — search acts (Dz.U., M.P.) and fetch full texts with ELI identifiers and verifiable citations.3139 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables semantic search over Polish court judgments and legislative acts via MCP. Allows LLMs to retrieve legal documents using natural language queries.Apache 2.0
- AlicenseNot gradedqualityFmaintenanceMCP server providing access to Polish law statutes, provisions, case law, and EU law integrations, enabling natural language legal research, citation validation, and cross-referencing.56 npm7Apache 2.0