Mcp Nsa

io.github.matematicsolutionsPublished by GitHub account matematicsolutionsv1.4.0Updated Oct 24, 2026

MCP server for Polish administrative court rulings (NSA/WSA) via CBOSA with citations.

Overview

AI-generated overview

Lets an assistant search Polish administrative court case law (NSA and WSA) in the CBOSA database and retrieve full rulings with citations.

What you can do
Provides three tools over the CBOSA database of Polish administrative courts: search by keyword, case number, court or date range; get_judgment to fetch a full ruling by its ten-character hex document id; and search_by_case as a shortcut for case-number lookups. Search returns the top five full rulings with case number, court, date, panel, keywords, legal basis and an excerpt. Every response includes structured citation fields (title, CBOSA URL, case number, court, judgment date, decision type, snippet, doc id).
When to use it
Useful when an assistant needs Polish administrative case law, for example GDPR and data-protection decisions appealed from UODO, tax rulings, customs and excise, permits and concessions, or review of public-administration activity. It fills the gap left by SAOS, which does not index the administrative courts.
Requirements
Runs locally as a stdio process via npx from the npm package @matematicsolutions/mcp-nsa; Node.js 18 or later is required. No accounts, API keys, environment variables or headers are declared. It needs network access to the CBOSA site (orzeczenia.nsa.gov.pl).
Before you install
The server queries a public court database live, so requests and queries leave the machine. It disables TLS certificate verification (rejectUnauthorized: false), which weakens transport security. It is read-only: it searches and fetches rulings and does not write, send or delete data.

Installation

In SourceWeft

  1. Open Mcp Nsa in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

mcp-nsa

Installation (one command)

Published on npm + the MCP Registry (io.github.matematicsolutions/mcp-nsa). Run without cloning:

bash
npx -y @matematicsolutions/mcp-nsa

MCP client configuration (stdio):

json
{ "mcpServers": { "mcp-nsa": { "command": "npx", "args": ["-y", "@matematicsolutions/mcp-nsa"] } } }

(Building from source - below.)

[MCP] [License: MIT] [Node]

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

bash
npm installnpm run buildnode dist/index.js   # starts the server on stdio

Wiring into Patron

In patron/backend/mcp-servers.json (alongside mcp-saos and mcp-eu-sparql):

json
{  "name": "nsa",  "transport": "stdio",  "command": "node",  "args": ["C:/Users/<YOUR-USERNAME>/mcp-nsa/dist/index.js"],  "enabled": true}

Smoke test

bash
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.

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.

Source: README.md at commit 6a7b1a6

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

2
  1. v1.4.0LatestOct 13, 2026
  2. v1.3.0Sep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts