About mcp-nsa
mcp-nsa is an MCP server for searching Polish administrative court rulings from CBOSA, covering the NSA and 16 regional WSA courts. It provides case search and complete rulings with structured case details and citations for legal research.
Key features
- 01Search NSA and WSA rulings
- 02Filter by case number, court, or date
- 03Retrieve full rulings by document ID
- 04Return structured CBOSA citations
Use cases
- 01Research Polish administrative case law
- 02Find rulings on data protection or tax matters
- 03Retrieve a ruling from its case number
MCP support
Exposes search, case-number lookup, and full-ruling retrieval as tools for MCP clients. Responses include structured citation fields linking to CBOSA.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
3Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| court | enum | No | Court name (full). Defaults to all administrative courts.Naczelny Sąd Administracyjny | Wojewódzki Sąd Administracyjny w Białymstoku | Wojewódzki Sąd Administracyjny w Bydgoszczy | Wojewódzki Sąd Administracyjny w Gdańsku | Wojewódzki Sąd Administracyjny w Gliwicach | Wojewódzki Sąd Administracyjny w Gorzowie Wielkopolskim | Wojewódzki Sąd Administracyjny w Kielcach | Wojewódzki Sąd Administracyjny w Krakowie | Wojewódzki Sąd Administracyjny w Lublinie | Wojewódzki Sąd Administracyjny w Łodzi | Wojewódzki Sąd Administracyjny w Olsztynie | Wojewódzki Sąd Administracyjny w Opolu | Wojewódzki Sąd Administracyjny w Poznaniu | Wojewódzki Sąd Administracyjny w Rzeszowie | Wojewódzki Sąd Administracyjny w Szczecinie | Wojewódzki Sąd Administracyjny w Warszawie | Wojewódzki Sąd Administracyjny we Wrocławiu |
| query | string | No | Keywords (the 'wszystkieSlowa' field in CBOSA), e.g. 'RODO art 6' or 'tajemnica skarbowa'. |
| dateTo | string | No | Decision date to (YYYY-MM-DD). |
| dateFrom | string | No | Decision date from (YYYY-MM-DD). |
| caseNumber | string | No | Sygnatura akt, e.g. 'III OSK 1377/23' (NSA) or 'I SA/Gl 659/22' (WSA). |
| pageNumber | number | No | Numer strony (od 1). CBOSA zwraca stale 10 wynikow na strone. Do paginacji. |
Details
From the project READMEmcp-nsa
Installation (one command)
Published on npm + the MCP Registry (io.github.matematicsolutions/mcp-nsa). Run without cloning:
npx -y @matematicsolutions/mcp-nsa
MCP 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).
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/sdk- Stdio 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 stdio
Wiring 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.js
Should 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.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.