rhr-mcp
RHR MCP
MCP server that gives AI agents structured access to Public Procurement Registry data. Query procurements, awards, buyers, and winning suppliers using natural language through any MCP-compatible client.
Tech Stack
Runtime — Bun >= 1.4.0
Language — TypeScript 7
Database — PostgreSQL
Query builder — Kysely
Validation — Zod
Tooling — Oxfmt and Oxlint
Prerequisites
Download open data
Download the public datasets from:
https://riigihanked.riik.ee/rhr-web/#/open-data
Place the unzipped files directly in the data/ folder at the project root. For example, a full year looks like:
HT_2025_1.xmlHT_2025_2.xmlHT_2025_3.xmlHT_2025_4.xmlHT_2025_5.xmlHT_2025_6.xmlHT_2025_7.xmlHT_2025_8.xmlHT_2025_9.xmlHT_2025_10.xmlHT_2025_11.xmlHT_2025_12.xmlHLST_2025_1.xmlHLST_2025_2.xmlHLST_2025_3.xmlHLST_2025_4.xmlHLST_2025_5.xmlHLST_2025_6.xmlHLST_2025_7.xmlHLST_2025_8.xmlHLST_2025_9.xmlHLST_2025_10.xmlHLST_2025_11.xmlHLST_2025_12.xml
HT_*.xml files are contract notices. HLST_*.xml files are contract award notices. Add any year the same way (HT_2024_1.xml, HT_2027_1.xml, and so on) — ingest picks up every matching file in data/.
Getting Started
git clone https://github.com/margusliinev/rhr-mcp.git
cd rhr-mcp
cp .env.example .env
bun install
docker compose up -d
bun run migrate
bun run ingest
bun run devThe MCP endpoint is available at http://localhost:3002/mcp.
Use with Cursor
With the server running, add this to your Cursor MCP config (.cursor/mcp.json):
{
"mcpServers": {
"RHR": {
"url": "http://localhost:3002/mcp"
}
}
}Then restart MCP / reload Cursor so the RHR server shows up.
Available tools
Tool | Description |
| Get an organization by id or registry code |
| Get a procurement with buyers, lots, and award summaries |
| Get an award with suppliers, lot, and procurement summary |
| List procurements where an organization is a buyer |
| List awards where an organization is a winning supplier |
| List lots for a procurement, with award summaries linked by lot id |
| Search organizations by name or registry code |
| Search and filter procurements by text, status, CPV, value, and more |
| Search awards by amount, date, CPV, result, and supplier |
Scripts
Command | Description |
| Start development server |
| Start production server |
| Apply database migrations |
| Load RHR data from |
| Format code |
| Lint code |
| Typecheck |
License
MIT