Skip to main content
Glama
przemonides

CRU MCP Server

by przemonides

rejestr-umow-mcp-server

Serwer MCP (Model Context Protocol) do wyszukiwania umów w Centralnym Rejestrze Umów jednostek sektora finansów publicznych (CRU JSFP), publicznie dostępnym pod rejestrumow.gov.pl. Dzięki niemu asystent AI może wyszukiwać i pobierać umowy (strony, przedmiot, wartość, daty, status, finansowanie z UE) zamiast ręcznego przeszukiwania strony.

Czym jest Centralny Rejestr Umów

CRU to publiczna baza umów zawieranych przez instytucje sektora finansów publicznych (ministerstwa, urzędy, samorządy, szkoły, szpitale itd.), uruchomiona 1 lipca 2026 r. Każdy może sprawdzić strony, przedmiot i wartość umowy bez składania wniosku o dostęp do informacji publicznej.

Ministerstwo Finansów udostępnia też API integracyjne (CRU API JSFP) z autoryzacją nagłówkiem X-API-KEY, które oprócz publikacji i aktualizacji umów przez jednostki obowiązane pozwala też na wyszukiwanie zestawień już opublikowanych dokumentów oraz pobieranie ich szczegółów. Dokumentacja integracyjna:

Related MCP server: mcp-krs

Status weryfikacji API (ważne!)

Sesja, w której powstał ten kod, działa w środowisku z ograniczoną polityką sieciową, która blokuje połączenia do domen *.gov.pl (potwierdzone na poziomie proxy — gateway answered 403 to CONNECT (policy denial) dla jsfp.rejestrumow.gov.pl i rejestrumow.gov.pl). W efekcie nie było możliwe:

  • pobranie strony dokumentacji integracyjnej (api.html) i odczytanie rzeczywistych ścieżek endpointów, nazw parametrów i kształtu odpowiedzi,

  • sprawdzenie publicznej wyszukiwarki na rejestrumow.gov.pl pod kątem ewentualnego (nieudokumentowanego) endpointu JSON używanego przez UI,

  • zweryfikowanie, czy indywidualny/jednoosobowy wniosek o klucz API zostanie w ogóle rozpatrzony pozytywnie (API wygląda na adresowane przede wszystkim do jednostek JSFP publikujących własne umowy).

Co z tego wynika dla tego kodu: ścieżki żądań w src/constants.ts / .env.example (CRU_SEARCH_PATH, CRU_CONTRACT_PATH) oraz nazwy parametrów zapytania w src/tools.ts (np. fraza, dataOd, numerStrony) to przypuszczenia oparte na typowej konwencji REST, a nie potwierdzone fakty z dokumentacji. Kod jest skonstruowany tak, by łatwo je poprawić (jedna zmienna środowiskowa / jedno miejsce w kodzie), ale przed pierwszym realnym użyciem trzeba je zweryfikować względem oficjalnej dokumentacji (dostępnej z przeglądarki bez ograniczeń tej sesji) i w razie potrzeby skorygować.

Dwie ścieżki dalszej pracy

  1. Oficjalne API CRU JSFP (zaimplementowane w tym folderze). Wymaga zgłoszenia się po klucz X-API-KEY do Ministerstwa Finansów. Najbardziej stabilne i "legalne" rozwiązanie długoterminowo, ale nieznany czas/warunki przyznania dostępu dla podmiotu spoza JSFP.

  2. Publiczna wyszukiwarka na rejestrumow.gov.pl (nie zaimplementowane). Strona nie wymaga logowania dla obywatela, więc teoretycznie dałoby się zbudować "agregator" odpytujący jej wewnętrzny endpoint JSON — ale wymaga to podejrzenia ruchu sieciowego w przeglądarce (Network tab) przez kogoś z dostępem do domeny, nie jest udokumentowane, i może naruszać regulamin serwisu. Rekomendacja: sprawdzić robots.txt i regulamin serwisu, zanim ktokolwiek pójdzie tą drogą.

Rekomendacja: zacznij od ścieżki 1 — wyślij zapytanie o dostęp na wsparcie.cru.jsfp@mf.gov.pl, a po otrzymaniu klucza i realnej dokumentacji popraw CRU_SEARCH_PATH/CRU_CONTRACT_PATH oraz mapowanie pól w src/tools.ts i src/format.ts na rzeczywisty kształt odpowiedzi.

Narzędzia MCP

  • rejestr_umow_search_contracts — wyszukuje umowy po tekście, stronie umowy (nazwa/NIP), jednostce JSFP, zakresie dat i wartości, z paginacją.

  • rejestr_umow_get_contract — pobiera pełne szczegóły jednej umowy po identyfikatorze/numerze.

Oba narzędzia są tylko do odczytu (readOnlyHint: true) — serwer nie publikuje ani nie modyfikuje żadnych umów.

Instalacja i konfiguracja

cd rejestr-umow-mcp
npm install
cp .env.example .env
# uzupełnij CRU_API_KEY w .env po otrzymaniu klucza od MF
# zweryfikuj/popraw CRU_SEARCH_PATH i CRU_CONTRACT_PATH względem dokumentacji
npm run build

Uruchomienie

npm start

Serwer komunikuje się przez stdio — podłącz go do klienta MCP (np. Claude Desktop/Claude Code) w konfiguracji serwerów MCP, wskazując node dist/index.js w katalogu rejestr-umow-mcp i przekazując zmienną środowiskową CRU_API_KEY.

Struktura projektu

rejestr-umow-mcp/
├── package.json
├── tsconfig.json
├── .env.example
├── src/
│   ├── index.ts       # inicjalizacja serwera MCP (stdio)
│   ├── tools.ts        # definicje narzędzi (search / get)
│   ├── client.ts        # klient HTTP + obsługa błędów
│   ├── constants.ts     # konfiguracja z env (base URL, ścieżki, klucz)
│   ├── format.ts        # formatowanie odpowiedzi na markdown
│   └── types.ts          # typy odpowiedzi API (celowo permisywne)
└── dist/                  # skompilowany kod (po `npm run build`)

Available Tools

2 tools
rejestr_umow_get_contractPobierz szczegóły umowy z Centralnego Rejestru UmówA
Read-onlyIdempotent

Pobiera pełne szczegóły pojedynczej umowy z Centralnego Rejestru Umów JSFP (rejestrumow.gov.pl) po jej identyfikatorze/numerze.

Wymaga skonfigurowanego klucza CRU_API_KEY (patrz README.md). Operacja tylko do odczytu.

⚠️ Ścieżka zapytania (CRU_CONTRACT_PATH) jest niezweryfikowanym przypuszczeniem — patrz README.md, sekcja "Status weryfikacji API".

Args:

  • contract_id (string, wymagany): identyfikator lub numer umowy zwrócony przez rejestr_umow_search_contracts

  • response_format ('markdown' | 'json', domyślnie 'markdown')

Returns: pełne dane umowy (strony, przedmiot, wartość, okres obowiązywania, status, finansowanie UE).

ParametersJSON Schema
NameRequiredDescriptionDefault
contract_idYesIdentyfikator lub numer umowy w CRU.
response_formatNoFormat odpowiedzi: 'markdown' (czytelny) lub 'json' (surowe dane).markdown

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint, idempotentHint, destructiveHint), the description adds critical behavioral details: requires a configured CRU_API_KEY, warns that the query path is an unverified assumption, and specifies the return format options (markdown or json).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, starting with the main action, then requirements, a warning, args, and returns. Every sentence provides value, though the structure could be slightly more streamlined.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple retrieval tool with no output schema, the description sufficiently explains the required API key, the return content (pages, subject, value, etc.), and its relationship to the sibling tool. No gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%. The description adds context: contract_id is expected to come from search, response_format has a default of 'markdown' and can be 'json'. This is incremental value over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves full details of a single contract from the Central Contract Register by its identifier. It distinguishes from the sibling tool rejestr_umow_search_contracts, which returns a list of contracts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage after obtaining a contract ID from rejestr_umow_search_contracts, providing clear context. It does not explicitly state when not to use it, but the usage scenario is well-defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rejestr_umow_search_contractsSzukaj umów w Centralnym Rejestrze UmówA
Read-onlyIdempotent

Wyszukuje umowy opublikowane w Centralnym Rejestrze Umów JSFP (rejestrumow.gov.pl) przez API Ministerstwa Finansów.

Wymaga skonfigurowanego klucza CRU_API_KEY (patrz README.md). Nie wykonuje operacji zapisu — tylko odczyt/wyszukiwanie.

⚠️ Ścieżka zapytania (CRU_SEARCH_PATH) jest niezweryfikowanym przypuszczeniem — patrz README.md, sekcja "Status weryfikacji API".

Args:

  • query (string, opcjonalny): dowolny tekst do wyszukania

  • party_name_or_nip (string, opcjonalny): nazwa strony umowy lub NIP/REGON

  • jsfp_unit_name (string, opcjonalny): nazwa jednostki publikującej

  • date_from / date_to (YYYY-MM-DD, opcjonalne): zakres daty zawarcia

  • min_value / max_value (number, opcjonalne): zakres wartości umowy w PLN

  • page (number, domyślnie 0), page_size (number, domyślnie 20, max 100)

  • response_format ('markdown' | 'json', domyślnie 'markdown')

Returns: listę pasujących umów wraz z informacją o łącznej liczbie wyników.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoNumer strony wyników, licząc od 0.
queryNoDowolny tekst do wyszukania (np. fragment przedmiotu umowy).
date_toNoData zawarcia umowy do (YYYY-MM-DD).
date_fromNoData zawarcia umowy od (YYYY-MM-DD).
max_valueNoMaksymalna wartość umowy w PLN.
min_valueNoMinimalna wartość umowy w PLN.
page_sizeNoLiczba wyników na stronę (1-100).
jsfp_unit_nameNoNazwa jednostki sektora finansów publicznych publikującej umowę.
response_formatNoFormat odpowiedzi: 'markdown' (czytelny) lub 'json' (surowe dane).markdown
party_name_or_nipNoNazwa strony umowy albo jej NIP/REGON.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, etc. Description adds critical context: requires API key, notes unverified query path (readiness caveat), and confirms no write operations. This enriches transparency beyond annotations. Could detail error behavior or performance limits, but fine.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is efficiently structured: purpose first, then requirements/warning, then bullet-pointed parameter list. No redundant sentences, all information is relevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 10 parameters and no output schema, description covers all parameters, mentions return format, and adds operational caveats (API key, verification status). Lacks explicit info on pagination behavior or error handling, but sufficient for a search tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds grouping of related parameters (date range, value range), provides natural language explanations, and clarifies defaults. Offers some extra semantics over schema, but not deeply transformative.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool searches contracts in the Central Register of Contracts JSFP via API, distinguishes from sibling 'rejestr_umow_get_contract' by focusing on search versus retrieval, and specifies read-only operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides context for usage (requires API key, read-only) but does not explicitly indicate when to use this tool over the sibling or what alternatives exist. Implicit guidance from sibling name, but description lacks direct differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedrejestr_umow_get_contract
    • First observedrejestr_umow_search_contracts

TDQS

A4.4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one searches for contracts with various filters, the other retrieves full details of a specific contract. No overlap or ambiguity.

Naming Consistency5/5

Both tool names follow a consistent pattern: 'rejestr_umow_' prefix with a verb (search/get) followed by 'contracts' or 'contract'. The naming is predictable and unambiguous.

Tool Count4/5

With only 2 tools, the server is minimal but well-scoped for a read-only registry query domain. It feels slightly thin, but each tool serves a distinct purpose without unnecessary bloat.

Completeness5/5

For a read-only contract registry, the pair of search and get detail covers the essential functionality completely. No obvious gaps—users can find contracts and retrieve full information.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    MCP server that provides access to Polish individual tax interpretations (KIS) via the official EUREKA API, enabling search and retrieval of rulings with signatures, theses, and full text.
    4
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for the Polish company register (KRS) via the official Ministry of Justice API — entities, boards and shareholders with verifiable citations.
    3
    61
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for verifying Polish business entities from the National Court Register (KRS) and VAT White List. Allows querying by KRS, NIP, or REGON to retrieve official company data including name, address, board, and capital.
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for Polish company registries that enables looking up companies by NIP or KRS using public government APIs with no authentication required.
    2
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/przemonides/CRU_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server