mcp-krs
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-krs Check who can represent KRS 0000028860 and the signing rules"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-krs
Installation
Repository: github.com/pwasniowski/mcp-krs (npm package
name: @legal-link/mcp-krs). Requires Node 18+.
Run straight from GitHub (no npm release needed)
npx -y github:pwasniowski/mcp-krsnpx clones the repo, installs dependencies and builds dist/ via the prepare script, then
starts the stdio server. Pin a commit or tag with github:pwasniowski/mcp-krs#<ref>.
Claude Desktop
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\) and restart Claude Desktop:
{
"mcpServers": {
"krs": {
"command": "npx",
"args": ["-y", "github:pwasniowski/mcp-krs"]
}
}
}Once published to npm the same works with "args": ["-y", "@legal-link/mcp-krs"].
(Building from source - below.)
MCP server for the Krajowy Rejestr Sadowy / KRS (National Court Register) via the official, free
Ministerstwo Sprawiedliwosci (Ministry of Justice) API (api-krs.ms.gov.pl/api/krs).
Related MCP server: regon-pl
Why
A law firm asks about a counterparty -> Patron returns full register data: name, legal form, NIP, REGON, address, share capital, board composition, representation rules, commercial proxies (prokurenci), primary PKD code, status (active / liquidation / bankruptcy). Plus a URL to the Ministry of Justice search tool.
Critical for contract work: the question "can this person sign this contract
for company X on their own" reduces to two moves -
krs__get_board with the KRS number, then comparing the representation rules
against the signing party.
Tools
get_entity(krs, rejestr?)- current extract (full entity data).get_entity_full(krs, rejestr?)- full extract: the current state is computed from the entry history (only entries withoutnrWpisuWykr, latestnrWpisuWprow), plus former names and the number of entries. Full history is not formatted (status: "degraded"). Fields that cannot be determined print asbrak danych- never a guessed value; statusrozwiazana/likwidacja/upadlosconly from a current, non-struck entry in section 6.get_board(krs, rejestr?)- short form: representation body (rules + composition), supervisory bodies, commercial proxies (prokurenci).
Parameters:
krs- 1-10 digits, leading zeros padded automatically (28860->0000028860).rejestr-P(entrepreneurs register, default) orS(associations, foundations, SPZOZ); case-insensitive, any other value ->invalid_rejestr. Onnot_foundtry the other register.
Every response contains structuredContent.citations with fields:
title, url (Ministry of Justice search), krs, nazwa, nip, regon,
forma_prawna, status, miejscowosc, sad_rejestrowy, rejestr.
Patron reads the field automatically and renders it in the UI panel as a "Krajowy Rejestr Sadowy (KRS - MS)" section.
Stack
Node 18+ (built-in
fetch)@modelcontextprotocol/sdkStdio transport
Throttle 500 ms (2 req/s) - the Ministry of Justice API is tolerant, but be polite
Build + run
npm install
npm run build
node dist/index.jsWiring into Patron
In patron/backend/mcp-servers.json:
{
"name": "krs",
"transport": "stdio",
"command": "node",
"args": ["C:/Users/<YOUR-USER>/mcp-krs/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":"get_board","arguments":{"krs":"28860"}}}' \
| node dist/index.jsShould return ORLEN SA, representation rules "two board members acting jointly", board composition, commercial proxies (prokurenci) + URL.
GDPR notes / masked names
The Ministry of Justice API (api-krs.ms.gov.pl) itself returns masked personal data of
natural persons (board members, supervisory board, prokurenci): first letter + asterisks for
first names and surnames (e.g. J*** K*******), masked PESEL. The masking is done by the
source, not by this connector - the connector cannot unmask it. Whenever masked names are
detected, the tool output says so explicitly (and sets
structuredContent.dane_osob_zamaskowane_przez_zrodlo: true) and points to the official full
extract for KYC/AML: wyszukiwarka-krs.ms.gov.pl (free
current/full extract) or ekrs.ms.gov.pl.
Lineage
API contract from the official documentation MS api-krs.ms.gov.pl. TypeScript implementation from scratch.
License
MIT.
Origin
Forked from matematicsolutions/mcp-krs (MIT, original copyright retained in LICENSE); maintained at pwasniowski/mcp-krs by Legal Link. The upstream project is part of the MateMatic connector family:
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 · mcp-isap · mcp-krs (this repo) · 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_boardARead-onlyIdempotent
SKROCONA wersja: tylko sklad zarzadu + sposob reprezentacji + organy nadzoru + prokurenci. UWAGA: API KRS maskuje imiona i nazwiska osob fizycznych (pierwsza litera + gwiazdki) - pelne dane w oficjalnym odpisie na wyszukiwarka-krs.ms.gov.pl. Szybciej niz get_entity gdy potrzebujesz tylko 'kto reprezentuje X'. Bazuje na odpisie aktualnym.
Inputs: krs (required), rejestr.
get_entityARead-onlyIdempotent
Pobiera ODPIS AKTUALNY z Krajowego Rejestru Sadowego po numerze KRS. Zwraca pelne dane podmiotu: nazwa, forma prawna, NIP, REGON, adres, kapital zakladowy, reprezentacja (zarzad + sposob reprezentacji), prokurenci, glowny PKD, status (aktywny/likwidacja/upadlosc) + URL do wyszukiwarki KRS. Numer KRS uzupelnij zerami wiodacymi (lub podaj krotszy - zostanie wyrównany do 10 cyfr).
Inputs: krs (required), rejestr.
get_entity_fullARead-onlyIdempotent
Pobiera ODPIS PELNY z KRS i wylicza z historii wpisow stan biezacy (nazwa, NIP, REGON, status, adres, reprezentacja) + poprzednie nazwy i liczbe wpisow. Pelnej historii (dawne sklady organow) nie formatuje - po nia odeslij do wyszukiwarki KRS.
Inputs: krs (required), rejestr.
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 output shape: current odpis (get_entity), full odpis with derived history (get_entity_full), and board-only shortcut (get_board). The descriptions explicitly steer selection ('faster than get_entity when you only need who represents X'), though get_board is technically a subset of get_entity and could still attract misselection for users who don't notice the masking caveat.
All three use a consistent get_ prefix with a snake_case noun (entity, entity_full, board). The only deviation is the '_full' modifier, which describes depth rather than a distinct resource, making the pair slightly asymmetric but still readable and predictable.
Three read-only tools is on the thin side even for a focused KRS lookup server; the variations (full, board) feel like mode flags that could have been one tool with a parameter. It is borderline but defensible given the narrow domain.
Lookup works only by KRS number — there is no search by NIP, REGON, or company name, which are the most common entry points for registry queries. History is explicitly not formatted and full document retrieval is delegated to the external KRS site, leaving notable gaps an agent must route around.
Maintenance
Related MCP Connectors
Polish companies and people: KRS, CEIDG, financials, boards, VAT, sanctions. Free, no API key.
Polish company records from the official KRS register API, with alerts on new registry entries.
Polish company data from KRS: profiles, historical connections, financials, state aid.
Polish legal data for AI assistants: full-text search across 2.94M+ court rulings (common courts, Supreme Court, Constitutional Tribunal, KIO, NSA/WSA), statute text and version history from the official ELI register (164k+ acts), rulings citing a provision and citations between rulings, a citation verifier for case numbers, case-outcome and duration statistics, KIS tax interpretations, CJEU rulings applied in Poland, UODO decisions, KRS company lookup, court competence, official bank accounts and legal calculators. Works without an API key (daily limit).
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables querying the Polish National Court Register (KRS) to retrieve current and historical entity data.2262 npm4MIT
- AlicenseNot gradedqualityCmaintenanceEnables looking up Polish companies by NIP, REGON, or KRS number to retrieve their registered name, legal address, and entity type from Statistics Poland's official register.60 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to look up Polish company registry data from KRS, including registry profiles, current and historical board, shareholder and proxy connections with dates, change timelines, financial statements, state aid and public contracts. All tools are read-only and reachable over a remote Streamable HTTP endpoint, with the same data also exposed through a REST API.MIT
- AlicenseAqualityBmaintenanceEnables MCP-capable AI clients to search Polish companies in the National Court Register by name, KRS, NIP, or REGON, and retrieve official current or full registry extracts and board details.484 npm2MIT