{
  "id": 10062337,
  "title": "Building an MCP server for financial data: lessons learned",
  "url": "https://urgent.news/2026/09/26/building-an-mcp-server-for-financial-data-lessons-learned",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-26T20:34:12.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sidneybissoli/building-an-mcp-server-for-financial-data-lessons-learned-24gi"
  },
  "original_language": "en",
  "account": "Building an MCP server for financial data: lessons learned\n\nThe open-source MCP server bcb-br-mcp provides Brazilian Central Bank's public data, such as SGS time series, market-expectations survey, and PTAX reference rates. It runs over stdio from npm and Streamable HTTP on Cloudflare Workers, with over 17 tools, 388 tests, and several thousand monthly npm downloads.\n\nThe hardest part was dealing with the data source, two transports, and the distinction between a correct-looking response and a truly correct one. Here are the main lessons learned:\n\n1. Source may lie with HTTP 200: Upstream APIs sometimes return a success code for a bad request. Instead of treating an HTML page as a verdict, resolve the suspicion by repeating the request.\n2. Compute variation correctly: For price indexes like IPCA, calculate the variation correctly by (last - first) / first instead of the naive (last - first). Test and identify the correct convention for different series.\n3. Ordering is not consistent: The ultimos/N endpoint returns series in different orders, and the date-window endpoint returns ascending order for most series. Sort the data by date before processing to avoid discrepancies.\n4. Single registry for tools: Maintain a single registry for tools, resources, and prompts, and ensure both the stdio client and the hosted endpoint use the same surface. This way, you can catch discrepancies between the two entry points.\n5. Use a consistent validator: Choose a validator that works consistently across all runtimes, such as a non-compiling validator for TypeScript that validates identically in both stdio and hosted environments.",
  "summary": "Originally published on Medium . I maintain bcb-br-mcp , an open-source MCP server that gives AI agents the Brazilian Central Bank's public data: the SGS time series (Selic, IPCA, exchange rates, GDP, credit), the Focus market-expectations survey and the PTAX reference rates. It runs over stdio from npm and over Streamable HTTP on Cloudflare Workers, has 17 tools, 388 tests, and serves a couple…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}