{
  "markdown": "# mcp-krs\n\n## Installation (one command)\n\nPublished on npm + MCP Registry (`io.github.matematicsolutions/mcp-krs`). Run without cloning:\n\n```bash\nnpx -y @matematicsolutions/mcp-krs\n```\n\nMCP client configuration (stdio):\n\n```json\n{ \"mcpServers\": { \"mcp-krs\": { \"command\": \"npx\", \"args\": [\"-y\", \"@matematicsolutions/mcp-krs\"] } } }\n```\n\n(Building from source - below.)\n\n[![MCP](https://img.shields.io/badge/MCP-Server-blue)](https://modelcontextprotocol.io) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) [![Node](https://img.shields.io/badge/Node-18%2B-brightgreen)](https://nodejs.org)\n\nMCP server for the **Krajowy Rejestr Sadowy / KRS (National Court Register)** via the official, free\nMinisterstwo Sprawiedliwosci (Ministry of Justice) API (`api-krs.ms.gov.pl/api/krs`).\n\n## Why\n\nA law firm asks about a counterparty -> Patron returns full register data:\nname, legal form, NIP, REGON, address, share capital, **board composition, representation\nrules, commercial proxies (prokurenci)**, primary PKD code, status (active / liquidation /\nbankruptcy). Plus a URL to the Ministry of Justice search tool.\n\nCritical for contract work: the question \"can this person sign this contract\nfor company X on their own\" reduces to **two moves** -\n`krs__get_board` with the KRS number, then comparing the representation rules\nagainst the signing party.\n\n## Tools\n\n- **`get_entity(krs, rejestr?)`** - current extract (full entity data).\n- **`get_entity_full(krs, rejestr?)`** - full extract (with entry history).\n- **`get_board(krs, rejestr?)`** - short form: representation only\n  (rules + composition) + commercial proxies (prokurenci).\n\nParameters:\n- `krs` - 1-10 digits, leading zeros padded automatically\n  (`28860` -> `0000028860`).\n- `rejestr` - `P` (entrepreneurs register, default) or `S` (associations register).\n\nEvery response contains `structuredContent.citations` with fields:\n`title`, `url` (Ministry of Justice search), `krs`, `nazwa`, `nip`, `regon`,\n`forma_prawna`, `status`, `miejscowosc`, `sad_rejestrowy`, `rejestr`.\n\nPatron reads the field automatically and renders it in the UI panel as a\n**\"Krajowy Rejestr Sadowy (KRS - MS)\"** section.\n\n## Stack\n\n- Node 18+ (built-in `fetch`)\n- `@modelcontextprotocol/sdk`\n- Stdio transport\n- Throttle 500 ms (2 req/s) - the Ministry of Justice API is tolerant, but be polite\n\n## Build + run\n\n```bash\nnpm install\nnpm run build\nnode dist/index.js\n```\n\n## Wiring into Patron\n\nIn `patron/backend/mcp-servers.json`:\n\n```json\n{\n  \"name\": \"krs\",\n  \"transport\": \"stdio\",\n  \"command\": \"node\",\n  \"args\": [\"C:/Users/<YOUR-USER>/mcp-krs/dist/index.js\"],\n  \"enabled\": true\n}\n```\n\n## Smoke test\n\n```bash\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"s\",\"version\":\"0\"}}}\n{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}\n{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"get_board\",\"arguments\":{\"krs\":\"28860\"}}}' \\\n  | node dist/index.js\n```\n\nShould return ORLEN SA, representation rules \"two board members\nacting jointly\", board composition, commercial proxies (prokurenci) + URL.\n\n## GDPR notes\n\nThe Ministry of Justice API returns **masked** personal data of board members\nin its responses (asterisks in surnames after the 2023 amendment). Patron passes\nthis through raw and does not unmask it. For full surnames, the law-firm user\nopens the Ministry of Justice link in a browser after logging in.\n\n## Lineage\n\nAPI contract from the official documentation\n[MS api-krs.ms.gov.pl](https://api-krs.ms.gov.pl). TypeScript implementation from scratch.\n\n## License\n\nMIT.\n\n## Part of the MateMatic legal stack\n\nThis server is one of five MCP connectors covering Polish jurisdiction +\nEU law, used by [Patron](https://github.com/matematicsolutions/patron)\n(AGPL-3.0) and any other MCP-aware legal AI agent.\n\n- **mcp-krs** (this repo) - Polish company registry (official MS API)\n- [mcp-saos](https://github.com/matematicsolutions/mcp-saos) - common courts, SN, TK, KIO\n- [mcp-nsa](https://github.com/matematicsolutions/mcp-nsa) - NSA + 16 WSA administrative courts\n- [mcp-isap](https://github.com/matematicsolutions/mcp-isap) - Polish legislation (Dz.U. + M.P.)\n- [mcp-eu-sparql](https://github.com/matematicsolutions/mcp-eu-sparql) - EU law + CJEU (EUR-Lex)\n\n\nAll five MCP servers share the same `structuredContent.citations`\ncontract: each tool returns an array of `{title, url, snippet?, ...metadata}`\nthat legal agents can render directly in their citation panel.\n\nSee [matematicsolutions/.github](https://github.com/matematicsolutions)\nfor the full org profile.\n",
  "bytes": 4634,
  "sha": "2514cbff54ea121fcd6d22e7a3e495b01a638de32875c4d560d4ad1c21b7196d",
  "repo_slug": "matematicsolutions/mcp-krs",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_matematicsolutions_mcp_krs_5c288a21/readme"
}