Skip to main content
Glama

polish-law-mcp

English · Polski


English

An MCP server that lets AI assistants search and read Polish legal texts. It reads the data published in polish-law (consolidated statutes as Markdown and JSON, CC0, refreshed daily). That data is produced by polish-law-toolkit.

Repository

What it holds

polish-law

the texts (data only)

polish-law-toolkit

the software that downloads and reads the texts

polish-law-mcp (this one)

the MCP server for AI clients

The texts have no official force. They are teksty ujednolicone: current but unofficial, prepared by the Chancellery of the Sejm, and extracted automatically from PDF files, so errors are expected. Always check the text published in Dziennik Ustaw (Journal of Laws). The server repeats this in every answer.

Tools

Tool

What it does

list_kinds

kinds of text available (today unified) and their size

search_acts

find acts by words in title or address, diacritics ignored

get_act

metadata: title, what the text is based on, source PDF, versions

get_act_text

the act as Markdown, in pages

get_provision

one provision by citation (art. 1 ust. 3 pkt 1) with its sub-units

search_provisions

provisions containing all given words, in one act or in all

Every tool takes kind (default unified). The data repository keeps each kind of text in its own top-level folder with the same layout, so kinds added there later work without changing the server (list them in POLISH_LAW_KINDS, or, with a local clone, they are discovered).

Install and use

pip install git+https://github.com/MikolajKondej/polish-law-mcp

Claude Desktop / any MCP client (stdio):

{ "mcpServers": { "polish-law": { "command": "polish-law-mcp" } } }

Two ways to read the data:

  • Over HTTP (default). Nothing to download: files are fetched from raw.githubusercontent.com when needed. Searching inside provisions works within one act; searching all acts at once does not.

  • Local clone (faster, full search). git clone https://github.com/MikolajKondej/polish-law and set POLISH_LAW_DATA_DIR=/path/to/polish-law. Searching all ~800 acts then takes about 10 seconds.

Variable

Meaning

POLISH_LAW_DATA_DIR

path to a local clone of polish-law

POLISH_LAW_REPO, POLISH_LAW_REF

repository (owner/name) and branch for HTTP mode; defaults MikolajKondej/polish-law, main

POLISH_LAW_KINDS

comma-separated kinds for HTTP mode; default unified

Tests

pip install -e '.[test]' && python -m pytest

Licence: Apache 2.0 for the code. The texts are CC0 (see polish-law).


Related MCP server: legal-cite

Polski

Serwer MCP, dzięki któremu asystenci AI wyszukują i czytają polskie teksty prawne. Czyta dane z repozytorium polish-law (teksty ujednolicone ustaw jako Markdown i JSON, CC0, odświeżane codziennie). Dane wytwarza program polish-law-toolkit.

Repozytorium

Co zawiera

polish-law

teksty (same dane)

polish-law-toolkit

program pobierający i odczytujący teksty

polish-law-mcp (to)

serwer MCP dla klientów AI

Teksty nie mają mocy urzędowej. To teksty ujednolicone: aktualne, ale nieurzędowe, opracowane przez Kancelarię Sejmu i odczytane automatycznie z plików PDF, więc mogą zawierać błędy. Zawsze sprawdź tekst ogłoszony w Dzienniku Ustaw. Serwer powtarza to w każdej odpowiedzi.

Narzędzia

list_kinds (rodzaje tekstów), search_acts (akty po słowach z tytułu, bez względu na polskie znaki), get_act (metadane i wersje), get_act_text (akt jako Markdown, stronami), get_provision (przepis po cytacie, np. art. 1 ust. 3 pkt 1, razem z jednostkami podrzędnymi), search_provisions (przepisy ze wszystkimi podanymi słowami, w jednym akcie albo we wszystkich). Każde narzędzie przyjmuje kind (domyślnie unified); nowe rodzaje tekstów w repozytorium danych (osobne katalogi o tym samym układzie) działają bez zmian w serwerze.

Instalacja i użycie

pip install git+https://github.com/MikolajKondej/polish-law-mcp

Konfiguracja klienta MCP: { "mcpServers": { "polish-law": { "command": "polish-law-mcp" } } }.

Domyślnie serwer pobiera pliki przez HTTP z GitHuba (wyszukiwanie w treści działa w obrębie jednego aktu). Żeby przeszukiwać wszystkie akty naraz (ok. 10 s), sklonuj polish-law i ustaw POLISH_LAW_DATA_DIR. Zmienne: POLISH_LAW_DATA_DIR, POLISH_LAW_REPO, POLISH_LAW_REF, POLISH_LAW_KINDS (opis wyżej).

Licencja kodu: Apache 2.0. Teksty: CC0 (zob. polish-law).

Available Tools

6 tools
get_actA

Metadata of one act: title, dates, what the consolidated text is based on, source PDF, versions seen. act_id is an ELI id such as DU/1992/86 (or an address such as 'Dz.U. 1992 nr 21 poz. 86').

Inputs: act_id (required), kind. Returns: result

get_act_textA

Read an act as Markdown, in pages. Statutes are long: use next_offset from the answer to continue, or prefer get_provision when you know the citation.

Inputs: act_id (required), kind, offset, max_chars. Returns: result

get_provisionB

One provision of an act by citation, e.g. 'art. 15', 'art. 1 ust. 3 pkt 1' or 'art. 24aa ust. 2'. With include_children (default) the sub-units (ustępy, punkty, litery) come too, in reading order.

Inputs: act_id (required), citation (required), kind, include_children. Returns: result

list_kindsA

List the kinds of text available (e.g. 'unified' = consolidated texts) and how many acts each holds.

Inputs: no named parameters. Returns: result

search_actsA

Find acts by words in their title or address (diacritics ignored), e.g. 'podatek dochodowy osob prawnych' or 'Dz.U. 1992'. Returns ids to pass to the other tools. Titles only: to search inside provisions use search_provisions.

Inputs: query (required), kind, year, limit, +1 more. Returns: result

search_provisionsA

Find provisions containing ALL the given words (diacritics ignored). With act_id it searches that act. Without it, it searches every act of the kind, which works only when the server reads a local clone of the data (POLISH_LAW_DATA_DIR); otherwise give an act_id (find it with search_acts).

Inputs: query (required), kind, limit, act_id. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct target: list_kinds (corpus summary), search_acts (title lookup) vs search_provisions (content lookup), get_act (metadata) vs get_act_text (full paginated text) vs get_provision (single citation). The overlap between get_act_text and get_provision is explicitly resolved by the description's guidance to prefer get_provision when a citation is known.

    Naming Consistency5/5

    Uniform snake_case verb_noun pattern throughout (list_kinds, search_acts, get_act, get_act_text, get_provision, search_provisions). The two verbs (list/get/search) map predictably onto summary/metadata vs. retrieval vs. lookup semantics.

    Tool Count5/5

    Six tools is well within the ideal range and each earns its place: corpus overview, two search axes, metadata, bulk text, and single-provision retrieval. Nothing redundant and nothing feels missing at the count level.

    Completeness4/5

    The read-only retrieval lifecycle (discover kinds -> search acts -> act metadata -> text -> provision -> search inside provisions) is fully covered with no dead ends. Minor gaps remain: no table-of-contents/structure endpoint for long acts, no way to retrieve historical/specific versions despite metadata mentioning versions seen, and search_provisions is crippled without a local data clone.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      13
      23
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Verifies legal citations by fetching the exact, in-force wording of cited articles from official PL and EU legal sources, preventing hallucination by returning verbatim text.
      2
      9
      Apache 2.0
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to search, retrieve and cite over 600 Polish statutes and regulations from the Journal of Laws in full text, including the wording of a provision as of any date, in-force status checked against the ELI register, related provisions, annexes and tables. Access is read-only via a hosted endpoint with e-mail sign-in, optional free trial queries, and paid plans.
      -