Skip to content
Fantom Systems

Work

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.

Tools
ToolWhat it returns
belex_list_companiesInstruments listed on Belex
belex_get_company_profileProfile for one symbol
belex_get_quoteLatest quote: last, OHLCV, change
belex_get_historical_pricesDaily OHLCV bars across a date range
belex_get_indexBELEX15 and BELEXline current value
belex_get_index_constituentsIndex members and weights
belex_get_market_summaryEnd-of-day turnover, gainers, losers, most traded
nbs_list_currenciesCurrencies the NBS publishes
nbs_get_exchange_rateMid, buy and sell rate for a date
nbs_get_exchange_rate_seriesDaily mid-rates across a date range
nbs_get_reference_rateNBS key policy rate
nbs_get_inflationYear-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
Claude Desktop config
{
  "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.