belex-mcp
Open-source MCP server, on npm
Twelve typed tools over Belex and NBS data, installed with one npx line
The problem
Asking an LLM about Serbian markets meant one of two things: custom scraping written into each agent, or answers made up from stale training data. There was no standard way to hand Claude or Cursor the Belgrade Stock Exchange or the National Bank of Serbia figures.
What I built
A Node.js and TypeScript MCP server that exposes Belex and NBS data as tools with Zod input schemas. Every tool returns JSON with ISO 8601 timestamps in Europe/Belgrade and prices in RSD unless noted.
| Tool | What it returns |
|---|---|
| belex_list_companies | Instruments listed on Belex |
| belex_get_company_profile | Profile for one symbol |
| belex_get_quote | Latest quote: last, OHLCV, change |
| belex_get_historical_prices | Daily OHLCV bars across a date range |
| belex_get_index | BELEX15 and BELEXline current value |
| belex_get_index_constituents | Index members and weights |
| belex_get_market_summary | End-of-day turnover, gainers, losers, most traded |
| nbs_list_currencies | Currencies the NBS publishes |
| nbs_get_exchange_rate | Mid, buy and sell rate for a date |
| nbs_get_exchange_rate_series | Daily mid-rates across a date range |
| nbs_get_reference_rate | NBS key policy rate |
| nbs_get_inflation | Year-on-year and month-on-month CPI |
- HTTP layer with retries, exponential backoff with jitter, an in-process LRU cache and a budget of one request per second per host, so the server is polite to the sources it scrapes
- A fixture-backed unit test for every tool, strict TypeScript, linting and CI on each push
- Architecture decisions recorded as ADRs in the repository
- MIT licence; published to npm, listed in public MCP registries
{
"mcpServers": {
"belex": {
"command": "npx",
"args": ["-y", "belex-mcp"]
}
}
}Limitations
- Data comes from public pages of belex.rs and nbs.rs, so a layout change upstream can break a tool until its fixtures are updated
- Informational use only. For trading or settlement, use the authoritative source directly
- Runs over stdio today. A hosted endpoint, so a client can connect by URL instead of installing, is the next step
What this means for your project
The structure is the deliverable: typed tools, validation, caching, a test per tool and an install guide. A pilot MCP server over your PostgreSQL database, REST API or reporting tables follows the same shape.