Developer shares hard-won lessons from building an open-source financial data MCP server
A developer built and maintains bcb-br-mcp, an open-source MCP server that exposes Brazilian Central Bank public data — including Selic rates, IPCA inflation, and GDP figures — to AI agents via 17 tools. The project revealed that the upstream SGS API returns HTTP 200 with an HTML error page for invalid or failed requests, causing the server to misinterpret source hiccups as permanent data absence; the fix was to resolve ambiguity through repeated attempts rather than treating a single failure as a verdict. A separate bug caused price indexes like IPCA and IGP-M to be computed incorrectly as level changes rather than chained rates, producing wildly inflated figures that went unnoticed until a paid model evaluation flagged an obviously absurd answer. The developer also discovered that the API returns the 'last N observations' in inconsistent sort order depending on the series, requiring per-series normalization logic. The overarching lessons are to classify errors by response body shape, not status codes, and to ensure any numeric computation accounts for the domain semantics of the data it processes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in