使用说明
RIK MCP
MCP server that gives AI agents structured access to Estonian Business Registry data. Query company information, financial reports, ownership structures, and revenue breakdowns 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://avaandmed.ariregister.rik.ee/et/avaandmete-allalaadimine
Place the unzipped files directly in the data/ folder at the project root. Ingest expects these filenames:
ettevotja_rekvisiidid__lihtandmed.xmlettevotja_rekvisiidid__yldandmed.xmlettevotja_rekvisiidid__kaardile_kantud_isikud.xmlettevotja_rekvisiidid__kandevalised_isikud.xmlettevotja_rekvisiidid__osanikud.xmlettevotja_rekvisiidid__kasusaajad.xml1.aruannete_yldandmed_kuni_*.csv2.EMTAK_myygitulu_kuni_*.csv3.myygitulu_geograafiline_kuni_*.csv4.{year}_aruannete_elemendid_kuni_*.csv(one file per report year)
The kuni_* date suffix changes when RIK publishes a newer dump. Ingest automatically picks the latest matching file, so you can drop in updated CSVs without changing code.
Getting Started
git clone https://github.com/margusliinev/rik-mcp.git
cd rik-mcp
cp .env.example .env
bun install
docker compose up -d
bun run migrate
bun run ingest
bun run dev
The MCP endpoint is available at http://localhost:3001/mcp.
Use with Cursor
With the server running, add this to your Cursor MCP config (.cursor/mcp.json):
{
"mcpServers": {
"RIK": {
"url": "http://localhost:3001/mcp"
}
}
}
Then restart MCP / reload Cursor so the RIK server shows up.
Available tools
| Tool | Description |
|---|---|
get-company |
Get a company by id or registry code |
get-person |
Get a person by id or person hash |
get-annual-report |
Get an annual report with activity and market breakdowns |
list-company-roles |
List people and companies linked to a company |
list-person-roles |
List companies a person is linked to |
list-annual-reports |
List annual reports for a company |
search-companies |
Search and filter companies |
search-persons |
Search persons by name |
search-annual-reports |
Search annual reports by year, EMTAK, size, and revenue |
Scripts
| Command | Description |
|---|---|
bun run dev |
Start development server |
bun run start |
Start production server |
bun run migrate |
Apply database migrations |
bun run ingest |
Load RIK data from data/ into Postgres |
bun run format |
Format code |
bun run lint |
Lint code |
bun run typecheck |
Typecheck |
License
MIT