Skip to main content
Glama

tk-mcp

Serwer MCP dla orzecznictwa Trybunału Konstytucyjnego: wyszukiwarka wyroków i postanowień oraz pełny tekst orzeczenia. Źródło: oficjalna strona trybunal.gov.pl (HTML, bez auth).

Strona nie ma API - konektor czyta HTML. Wyszukiwarka to Solr (type=7383), pełny tekst czytamy z kontenera #content strony orzeczenia.

Instalacja

uv pip install -e ".[dev]"

Related MCP server: Constitutional-Court-decision-mcp

Narzędzia

Tool

Opis

search_judgments(query, page, sort, filter)

wyszukiwarka orzeczeń; count = globalna liczba trafień, items = jedna strona wyników

get_judgment_text(path)

pełny tekst orzeczenia (akapity z #content, bez PDF)

tk_coverage()

co konektor pokrywa, a czego nie (każda luka ma fallback)

Fasety (filter): signature:K|Kp|Kpt|P|Pp|SK|U, category:Wyrok, category:Postanowienie, modificationDate:today|lastWeek|lastMonth|lastYear|all. Sortowanie: publicationDate+desc / publicationDate+asc.

Uruchomienie

tk-mcp          # stdio
python -m tk_mcp.server

Rozwój

pytest
pytest -m smoke -v   # testy online (live trybunal.gov.pl)
ruff check

Audit log: ~/.matematic/audit/tk-mcp.jsonl (override: TK_MCP_AUDIT_DIR). Logowane są metadane wywołań (params_hash, result_summary, source_urls, latency_ms) - bez pełnych treści orzeczeń.

Uwagi o źródle

  • type=7383 jest obowiązkowy w wyszukiwarce - bez niego strona zwraca sam szkielet.

  • Brak trafień = count=0, nie błąd.

  • category:Publiczne ogłoszenie orzeczenia to faseta ogłoszeń (komunikatów), nie orzeczeń - dla realnych sygnatur zwraca 0.

  • Orzeczenia TK z lat 2024-2026 są częścią sporu ustrojowego: konektor zwraca treść verbatim i nie rozstrzyga o ważności ani prawidłowości składu.

Available Tools

3 tools
get_judgment_textA
Read-onlyIdempotent

Pelny tekst orzeczenia TK ze strony trybunal.gov.pl.

Parser scope'uje sie do kontenera #content (nav/naglowek emituja wlasne dlugie <p>), wiec zwrocone akapity to sklad orzekajacy i uzasadnienie, bez boilerplate. Bez PDF, bez JS.

Inputs: path. Returns: object

search_judgmentsA
Read-onlyIdempotent

Szuka orzeczen TK w wyszukiwarce trybunal.gov.pl (Solr, type=7383).

Zwraca globalny count z naglowka i jedna strone wynikow. Brak naglowka licznika albo licznik 0 to count=0 z pustymi items - nie blad.

Inputs: page, sort, query, filter. Returns: object

tk_coverageA
Read-onlyIdempotent

Declare what this connector covers, how it is sourced, and what it does NOT cover.

Call this before telling a user that the Constitutional Tribunal record "does not contain" something, and whenever a search comes back empty: the absence may be a gap in this connector rather than in the TK record. Every gap carries a fallback saying where to look instead.

Returns: Coverage with families, an as-of note, and a non-empty list of known gaps.

Inputs: no named parameters. Returns: What this connector covers, how it is sourced, and what it does not cover.

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 3 tools

    Disambiguation5/5

    search_judgments (find judgments) and get_judgment_text (fetch full text of a known judgment) target clearly different actions, and tk_coverage is an explicit meta/coverage declaration tool that plays a distinct role. No overlap or plausible misselection.

    Naming Consistency4/5

    search_judgments and get_judgment_text follow a clean snake_case verb_noun pattern. tk_coverage breaks it by using a namespace prefix and no verb, but it is still readable and only a single deviation.

    Tool Count4/5

    Three tools is lean for a read-only judgment connector but each earns its place: search, retrieve, and a coverage/gap disclaimer. Slightly thin but well-scoped rather than padded.

    Completeness4/5

    The core read lifecycle (search then fetch full text) plus a coverage/gap declaration is covered for this domain. Minor gaps remain around pagination beyond one page and metadata-only listing, which the coverage tool at least documents.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Provides access to Polish court judgments from the SAOS database. Enables search and retrieval of judgments with full-text search, filtering, and detailed case information.
      3
      20 npm
      1
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables searching Polish parliamentary prints and retrieving the full legislative process history, including links to final legal acts, via the official Sejm API.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables access to Polish Constitutional Tribunal rulings, including search by keywords or case signature, listing recent decisions, and retrieving full judgment texts with metadata and official links. Supports section-wise and chunked retrieval of long documents to manage context budgets.
      4
      MIT