mcp-nsa
This server lets you search and retrieve Polish administrative court rulings (NSA and 16 WSAs) from the CBOSA database.
search(query, caseNumber?, court?, dateFrom?, dateTo?, pageNumber?, pageSize?)– full-text keyword search with optional filters by case number, court, and date range; returns top 5 full rulings with metadata and excerpts.get_judgment(doc_id)– fetch a complete ruling by its 10-character hex CBOSA doc_id, including metadata and first 2000 characters of the text.search_by_case(caseNumber)– quick lookup by case signature (e.g.III OSK 1377/23).All responses include
structuredContent.citationswith CBOSA URLs, case numbers, court, judgment date, decision type, snippets, and doc_ids for direct citation display.Covers over 2.39 million rulings from 1981 to today across administrative courts, including GDPR/UODO, tax, customs, and administrative decision cases.
mcp-nsa
Installation (one command)
Published on npm + the MCP Registry (io.github.matematicsolutions/mcp-nsa). Run without cloning:
npx -y @matematicsolutions/mcp-nsaMCP client configuration (stdio):
{ "mcpServers": { "mcp-nsa": { "command": "npx", "args": ["-y", "@matematicsolutions/mcp-nsa"] } } }(Building from source - below.)
MCP server for the case law of the Polish administrative courts -
Naczelny Sad Administracyjny / NSA (Supreme Administrative Court) + 16 Wojewodzkie Sady Administracyjne / WSA (regional administrative courts) - via CBOSA (Centralna Baza Orzeczen Sadow Administracyjnych - the administrative courts' central case-law database)
(orzeczenia.nsa.gov.pl).
Related MCP server: mcp-isap
Why
SAOS (the common-courts case-law analysis system) does not index the administrative courts. Yet that is exactly where the substantive case law lives:
GDPR / data protection - decisions of the President of UODO appealed to the WSA, cassation appeals to the NSA
Taxes - individual tax rulings, decisions of tax authorities
Customs and excise
Administrative permits, concessions
Review of public-administration activity
mcp-nsa closes this gap. Coverage: 2,390,000+ rulings (verified live 2026-07-08 across the full date range), from 1981 to today.
Tools
search(query, caseNumber?, court?, dateFrom?, dateTo?, pageNumber?)search by keyword, case number, court, date. Fetches the top 5 full rulings (case number, court, date, panel, keywords, legal basis, excerpt).
get_judgment(doc_id)- full ruling by 10-character hex doc_id (from the CBOSA URL, e.g.7E50984BB7).search_by_case(caseNumber)- shortcut: search by case number (e.g.III OSK 1377/23,I SA/Gl 659/22).
Every response contains structuredContent.citations with the fields:
title, url (CBOSA), case_number, court, judgment_date,
decision_type, snippet, doc_id. Patron reads this field automatically
and surfaces it in the UI panel as the section "Rulings from CBOSA (NSA / WSA - administrative courts)".
Stack
Node 18+
@modelcontextprotocol/sdkStdio transport
https+ regex HTML parser (zero external deps beyond the SDK)500 ms throttle between requests (2 req/s)
SSL:
rejectUnauthorized: false- the CBOSA chain is sometimes incomplete on some machines; public rulings, no PII, MITM risk negligible against the benefit. See: LDH issue #167.
Build + run
npm install
npm run build
node dist/index.js # starts the server on stdioWiring into Patron
In patron/backend/mcp-servers.json (alongside mcp-saos and mcp-eu-sparql):
{
"name": "nsa",
"transport": "stdio",
"command": "node",
"args": ["C:/Users/<YOUR-USERNAME>/mcp-nsa/dist/index.js"],
"enabled": true
}Smoke test
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"s","version":"0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search","arguments":{"query":"RODO art 6"}}}' \
| node dist/index.jsShould return ~1500 hits + the top 5 with Polish NSA/WSA case numbers + CBOSA URLs
structuredContent.citations.
Lineage
Implementation rewritten in TypeScript on the basis of the HTTP/HTML contract from
legal-data-hunter/sources/PL/NSA
(Python + BeautifulSoup, MIT). It does not import the source code - it reproduces the
query pattern and HTML parsing.
License
MIT.
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 · mcp-nsa (this repo) · 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 CBOSA po jego doc_id (10-znakowy hex). Zwraca metadane (sygnatura, sad, data, sklad, hasla tematyczne, podstawe prawna, typ orzeczenia) + pierwsze 2000 znakow tresci (sentencja + uzasadnienie). doc_id pochodzi z wynikow narzedzia 'search'.
Inputs: doc_id (required).
searchARead-onlyIdempotent
Przeszukuje Centralna Baze Orzeczen Sadow Administracyjnych (CBOSA) - Naczelny Sad Administracyjny + 16 wojewodzkich sadow administracyjnych. TU zyje merytoryczne orzecznictwo RODO/UODO, podatkowe, celne, kontrola decyzji administracji publicznej. SAOS NIE indeksuje tego pionu. Dla MVP zwraca top-N wynikow z pelnymi metadanymi (sygnatura, sad, data, sklad, hasla tematyczne, podst. prawna, fragment tresci). Max 5 dokumentow pobranych w jednym zapytaniu - kazda kolejna szczegolowa lektura przez get_judgment z konkretnym doc_id.
Inputs: query, caseNumber, court, dateFrom, +3 more.
search_by_caseARead-onlyIdempotent
Skrot: szuka orzeczenia po sygnaturze. Odpowiednik search z parametrem caseNumber. Jesli orzeczenie nie znajdzie sie - sygnatura moze byc z sadu powszechnego/SN/TK/KIO (uzyj wtedy saos__search_by_case).
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
Tools are mostly distinct: search for general queries, search_by_case for case number lookup, and get_judgment for full retrieval by ID. The only minor overlap is that search_by_case is described as a shortcut for search with a case number, which could cause slight confusion but is clearly documented.
All tool names use a consistent snake_case pattern with verbs (get, search) followed by nouns or qualifiers. The naming is uniform and predictable across the set.
With 3 tools covering search, retrieval, and case-specific lookup, the set is minimal but reasonable for a focused legal database. The scope is narrow (administrative courts), so no heavy tool count is needed.
The tools cover basic search and retrieval, but notable gaps exist: lack of filtering by date, court level, or other metadata in search, and get_judgment only returns the first 2000 characters, limiting full-text access. Agents may need workarounds for deeper queries.
Maintenance
Related MCP Connectors
Poland public procurement MCP — official e-Zamówienia notice feed (keyless).
Italian administrative courts MCP -- search and read the published rulings of the Consiglio di…
Experimental MCP exploring Polish administrative units and BDL statistics.
Slovak court decisions as MCP tools. 12,000+ decisions, GDPR-compliant, pseudonymized, SLA-backed.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for Polish case-law (SAOS) — Supreme Court, Constitutional Tribunal, common courts and KIO — with ECLI and verifiable citations.3125 npm2MIT
- 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
- AlicenseAqualityCmaintenanceUnified MCP server for Polish legal data, enabling search and retrieval across case law, legislation, company register, tax rulings, public procurement, and EU sources through four aggregated tools.4154 PyPI6Apache 2.0