mcp-saos
This server lets you search and retrieve Polish court judgments from SAOS and check whether a judgment is still good law.
Search judgments: full-text and filtered search by keywords, case number, judge name, legal basis, referenced regulation, court type, and date range, with pagination.
Get full judgment: fetch complete judgment details by numeric SAOS ID, including metadata, summary, and the first 2000 characters of text.
Search by case number: quick shortcut to find a judgment by its signature (e.g.
I ACa 772/13) usingsearch_by_case.Citator check: use
saos_cite_checkto find later judgments citing a given signature and detect possible overruling/departure language, with verdicts such asprzelamanie_wykryte,uchwala_skladu_powiekszonego,nadal_cytowany, orbrak_cytowan_w_saos.Understand coverage caveats: responses clarify that administrative courts (WSA/NSA) are not indexed, and that dates may contain OCR artifacts—so verify critical results elsewhere.
mcp-saos
Installation (one command)
Published on npm + the MCP Registry (io.github.matematicsolutions/mcp-saos). Run without cloning:
npx -y @matematicsolutions/mcp-saosMCP client configuration (stdio):
{ "mcpServers": { "mcp-saos": { "command": "npx", "args": ["-y", "@matematicsolutions/mcp-saos"] } } }(Building from source - below.)
An MCP (Model Context Protocol) server for Polish case law - a connector to SAOS (System Analizy Orzeczen Sadowych - the courts' public case-law database, run by Fundacja ePanstwo).
Part of the MateMatic "Polish legal AI" project. It runs as a separate process communicating over stdio; the chat template (a fork of mike) calls it through the MCP protocol.
Related MCP server: mcp-nsa
What SAOS is
An open database of Polish court judgments. Public REST API, no key required.
Coverage caveat: coverage is broad and includes current judgments (2024-2026 are well populated), but it is uneven by court type, and some Supreme Court resolutions exist only as citations in other judgments. Verify anything critical against sn.pl, orzeczenia.ms.gov.pl, trybunal.gov.pl.
The database covers: common courts (COMMON), the Sad Najwyzszy (Supreme Court, SUPREME), the Trybunal Konstytucyjny (Constitutional Tribunal, CONSTITUTIONAL_TRIBUNAL), the KIO (National Appeal Chamber, NATIONAL_APPEAL_CHAMBER). Administrative courts (WSA/NSA) - no data in SAOS.
MCP tools
Tool | Description |
| Full-text and filtered search (court, judge, legal basis, dates) |
| Full judgment by ID from SAOS |
| Shortcut: search by case number (e.g. "I ACa 772/13") |
| Citator: is the judgment still good law? Finds later citing judgments and scans them for overruling language near the signature |
saos_cite_check - the citator
Give it a case number (a placeholder here; use a real one):
{ "caseNumber": "III CZP NN/RR" }It searches SAOS full-text for later judgments citing that signature, scans
their reasoning for departure phrases ("odstepuje od pogladu wyrazonego",
"nie podziela pogladu", "traci moc uchwala", "uchwala skladu siedmiu sedziow"
and others) within ~500 characters of the signature, and returns one of four
verdicts: przelamanie_wykryte, uchwala_skladu_powiekszonego,
nadal_cytowany, brak_cytowan_w_saos. Each hit includes a +-200 character
fragment for human verification.
Every phrase on the list was verified against live SAOS data - the evidence table, the algorithm and the honest-limits section are in docs/CITE-CHECK.md. The short version: no hits does NOT mean the judgment is still good law, and every response says so.
Requirements
Node.js >= 18
npm >= 9
Internet access (live API saos.org.pl)
Installation and build
git clone https://github.com/matematicsolutions/mcp-saos
cd mcp-saos
npm install
npm run buildAfter npm run build, the entry point is dist/index.js.
Standalone run (test)
node dist/index.js
# the server listens on stdin/stdout, diagnostic logs go to stderrWiring into the chat template (fork of mike) - mcp-servers.json
Add an entry to your client's MCP configuration (e.g. mcp-servers.json):
{
"name": "saos",
"transport": "stdio",
"command": "node",
"args": ["C:/Users/<YOUR-USER>/mcp-saos/dist/index.js"],
"enabled": true
}Provide the absolute path to dist/index.js. On Windows use forward slashes /
or double backslashes \\.
Tests
npm run build
npm test # offline: drift test + unit tests (parser, window scan, phrase patterns)
node test/smoke.mjs # live: 5 checks against the real SAOS API, including the citatorThe smoke test checks tools/list (4 tools), search, search_by_case,
a Constitutional Tribunal lookup and saos_cite_check on a Supreme Court
resolution with known later treatment.
Architecture
stdin --> MCP JSON-RPC (stdio transport) --> src/index.ts
|
SAOS REST API
https://www.saos.org.pl/api
/search/judgments
/judgments/{id}
stdout <-- formatted text responses <--No external dependencies for HTTP/JSON - requests go through the built-in node:https.
The only production dependency: @modelcontextprotocol/sdk.
Limitations and known pitfalls
pageSizehas a hard lower limit of 10 (SAOS returns HTTP 400 for less) - the server automatically enforces a minimum of 10.courtType=ADMINISTRATIVEreturns empty results - SAOS does not index WSA/NSA.Dates in the database may contain OCR artifacts (e.g. "3013-12-04") - the case number is more reliable than the
judgmentDatefield.Coverage is uneven by court type - the server states the relevant caveats in every tool response.
saos_cite_checkis a heuristic. It reads the top citing judgments only, its phrase list cannot cover every way a court departs from a line of case law, and no hits does not confirm the judgment is current.
License
MIT - see the LICENSE file for details. Judgment data: Fundacja ePanstwo, open license (public API with no usage restrictions).
Part of MateMatic
This connector queries its source live. It is one of the Polish and EU source connectors bundled in PATRON and works with any MCP client.
Poland, one server for all sources: prawo-pl-mcp · each source on its own: mcp-saos (this repo) · mcp-nsa · mcp-isap · mcp-krs · mcp-eureka · kio-orzeczenia-mcp
European Union: mcp-eu-sparql (live) · mcp-eu-compliance (offline corpus)
A prepared corpus of Polish and EU law with a citation graph: Repertorium
mcp-saos, mcp-nsa, mcp-isap, mcp-krs and mcp-eu-sparql share one structuredContent.citations
contract: each tool returns an array of {title, url, snippet?, ...metadata}
that legal agents can render directly in their citation panel.
See matematicsolutions/.github for the full org profile.
Available Tools
3 toolsget_judgmentARead-onlyIdempotent
Pobiera pelne orzeczenie z SAOS po jego numerycznym ID. Zwraca metadane (sygnatura, sad, data, sklad, podstawy prawne), streszczenie (jesli dostepne) oraz pierwsze 2000 znakow tresci. ID orzeczenia pochodzi z wynikow narzedzia 'search' lub 'search_by_case'. Bledy: missing_arg (brak id), not_found (id poza baza), upstream_error.
Inputs: id (required).
searchARead-onlyIdempotent
Przeszukuje baze orzeczen sadow polskich w SAOS (System Analizy Orzeczen Sadowych). Pokrycie obejmuje takze orzeczenia biezace (lata 2024-2026 sa dobrze reprezentowane), ale jest nierowne wg typu sadu. Sady administracyjne (WSA/NSA) NIE sa indeksowane. Daty bywaja znieksztalcone przez OCR - weryfikuj sygnature i date w zrodle. Przydatny do: analizy linii orzeczniczej, precedensow, wyszukiwania po tresci / sygnatuze / sedzim / podstawie prawnej. Bledy: invalid_court_type (zly enum), upstream_error (HTTP/timeout API).
Inputs: all, dateTo, dateFrom, pageSize, +6 more.
search_by_caseARead-onlyIdempotent
Skrot: szuka orzeczenia po sygnaturze akt (np. 'I ACa 772/13', 'IV CSK 123/15', 'KIO/UZP 100/12'). Odpowiednik search z parametrem caseNumber. Jesli sygnatura nie znajdzie sie w SAOS, sprawa moze byc z sadu administracyjnego (WSA/NSA - nieindeksowane) lub jeszcze nieopublikowana w bazie. Bledy: missing_arg (brak caseNumber), upstream_error.
Inputs: caseNumber (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct operation: retrieving a judgment by ID, general search, and search by case number. There is no overlap in functionality.
Tool names mostly follow a verb_noun or verb_preposition_noun pattern, but 'search' is just a verb while 'get_judgment' uses get. However, 'search_by_case' is descriptive and consistent with 'search'.
Three tools are appropriate for a focused database query server. Each tool serves a clear purpose without redundancy.
Core operations (search and retrieve) are present, but there are gaps: no pagination for search results, and full judgment text is limited to 2000 characters. Missing features like listing courts or fetching full text could hinder some workflows.
Maintenance
Related MCP Connectors
Poland public procurement MCP — official e-Zamówienia notice feed (keyless).
Polish and EU law: statutes, rulings, UODO/UOKiK/KNF, EU regulations, citation checks. Free tier.
Semantic search over Polish law and case law, citing the exact in-force article.
EUR-Lex MCP — official EU law, article-level.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides access to Polish court judgments from the SAOS database. Enables search and retrieval of judgments with full-text search, filtering, and detailed case information.320 npm1Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for Polish administrative case-law (NSA + regional administrative courts, CBOSA) with ECLI and verifiable citations.3111 npmMIT
- AlicenseAqualityCmaintenanceMCP server for Polish legislation (ISAP / Sejm) — search acts (Dz.U., M.P.) and fetch full texts with ELI identifiers and verifiable citations.3103 npm1MIT
- AlicenseAqualityBmaintenanceMCP server for Polish public-procurement rulings (KIO / Krajowa Izba Odwoławcza) with verifiable citations.562 PyPI2Apache 2.0