Open Economics

io.github.felipegambettadesouza6-jpgPublished by GitHub account felipegambettadesouza6-jpgv2.0.2Updated Oct 24, 2026

Discover, resolve, and query official Brazilian economic data with semantic search and provenance.

VerifiedStreamable HTTPWeb executableFinanceData & Analytics

Overview

AI-generated overview

Read-only MCP server that resolves Brazilian economic questions and returns official BCB, IBGE, SICONFI, Comex Stat, ANP, EPE, MTE, CVM and Tesouro data with…

What you can do
  • Search and resolve an economic concept to ranked official datasets, with confidence and coverage gaps
  • Inspect dataset and series metadata: publisher, units, periodicity, coverage, formulas and warnings
  • Retrieve observations from BCB SGS series and IBGE aggregates with explicit variables, periods and localities
  • Query fiscal and trade data: SICONFI reports, Comex Stat exports and imports, and Tesouro RTN accounts and RMD debt tables
  • Fetch fuel prices, electricity consumption, formal employment and investment-fund aggregates
When to use it
Useful when a question starts in plain language (Portuguese or English) about Brazilian macro, fiscal, trade, labor or market data and you need values tied to official sources. Less useful if you already know the exact publisher identifier and can call the source directly.
Requirements
Remote streamable HTTP endpoint; no authentication, environment variables or headers declared. Network access to the service is required. Running the project locally needs Node.js 22.13 or later.
Before you install
Read-only data retrieval, but the service is described as best-effort with no uptime SLA, and cached snapshots may be returned flagged as stale. Values come from third-party publishers, so check units, date semantics and sign conventions before reuse. BCB data is ODbL and IBGE data requires attribution, so preserve attribution and share-alike obligations when redistributing.

Installation

In SourceWeft

  1. Open Open Economics in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.felipegambettadesouza6-jpg%2Fopen-economics/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "open-economics": {
      "type": "http",
      "url": "https://open-economics-data.knbf982hkn.chatgpt.site/api/mcp"
    }
  }
}

README

Open Economics API

A free, read-only semantic routing layer for authoritative Brazilian economic data.

Run a real economic question → · Connect the MCP server →

Open Economics 2.0 starts with a real economic-information need, resolves its meaning independently of current coverage, and then routes it to official data. Its synchronized catalog currently exposes 12,875 BCB SGS series and IBGE aggregates, plus direct SICONFI fiscal-report, MDIC Comex Stat, and ANP fuel-price access and versioned EPE electricity-consumption, MTE Novo Caged, CVM investment-fund, Tesouro RTN fiscal, and RMD Federal Public Debt data (12,886 official datasets in total). The 32 convenient v1 series IDs remain compatible.

Discovery, REST, the existing product, and MCP share one semantic core. A resolved concept is kept separate from availability, so an unsupported need is reported explicitly instead of being silently mapped to a nearby series. Units, dimensions, reference periods, source identifiers, raw values, methodology links, and retrieval provenance travel with the data.

Start with the economic need

bash
curl --fail --silent \  "https://open-economics-data.knbf982hkn.chatgpt.site/api/v2/search?q=desemprego%20desde%202015"
curl --fail --silent \  "https://open-economics-data.knbf982hkn.chatgpt.site/api/v2/datasets/ibge-aggregates%3A6381/schema"

For BCB, /api/v2/datasets/bcb-sgs:{code}/observations provides direct series access with authoritative frequency, unit, source, coverage, formula, and warning metadata. For IBGE, inspect /schema, then send explicit variable, periods, locality, and classification selections to /observations. SICONFI DCA, RREO, and RGF use the same dataset routes while retaining entity, reporting period, annex, account, column, and raw value. Official multidimensional structure is preserved instead of flattened away. Comex Stat preserves trade-flow dimensions and metrics. ANP fuel-price queries return period/geography/product aggregates calculated from official station observations, with source counts and the transformation disclosed while station identity and address fields are excluded. EPE and MTE serve compact, versioned snapshots of official workbooks: electricity retains geography/class/market, while adjusted Novo Caged stock and flows retain their separate national, region/state, or economic-activity breakdowns. CVM daily fund reports retain fund/class identity and quota values; classification aggregates sum only additive measures and identify incomplete filing dates. RTN retains its monthly account hierarchy and above-the-line cash/effective-payment conventions. RMD debt statistics keep composition, holder, maturity, and cost tables separate, with their official units, definitions, and publication vintage.

When to use Open Economics

If you already know the exact official identifier and source contract, calling the publisher directly remains the shortest path. Open Economics is useful when the need starts in human language, spans publisher conventions, requires explicit dimensions, or must retain one consistent provenance and error model.

One contract across official sources

The same observation envelope can retrieve BCB IBC-Br (SGS 24363) and IBGE real GDP growth (SIDRA 5932/6561), without maintaining two date and response parsers:

bash
curl --fail --silent "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-ibc-br/observations?start=2024-01-01"curl --fail --silent "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-gdp-real-yoy/observations?start=2024-01-01"

The runnable multi-source Python example uses both series and prints their official provenance and freshness state.

Start with the catalog

bash
curl --fail --silent "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1"curl --fail --silent "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators?q=ipca&source=ibge"curl --fail --silent "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-ipca-monthly"

GET /api/v1/indicators is the discovery endpoint. Its meta.available_filters field lists every canonical category, frequency, and source value. It accepts:

ParameterMeaning
qCase-insensitive search across IDs, names, aliases, and official codes
categoryA canonical category ID such as inflation or interest-rates
frequencydaily, monthly, quarterly, or annual
sourcebcb or ibge
limit1–500, default 100

Invalid filters are rejected with a structured problem response; they never silently become an empty result set.

Retrieve a series

bash
curl --fail --silent \  "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-ipca-monthly/observations?start=2024-01-01&end=2024-12-31"
curl --fail --silent \  "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-selic-target/observations?start=2025-01-01&order=desc&limit=12"
curl --fail --silent \  "https://open-economics-data.knbf982hkn.chatgpt.site/api/v1/indicators/br-selic-target/latest"

Observation requests accept start, end, order=asc|desc, limit=1..5000, and format=json|csv. Dates use YYYY-MM-DD and end cannot be in the future. Daily BCB requests are limited to ten years because SGS applies the same upstream limit.

All JSON series responses use the same envelope:

json
{  "data": [    {      "date": "2024-01-01",      "period": "2024-01",      "source_date": "202401",      "value": 0.42,      "raw_value": "0.42",      "status": "observed"    }  ],  "meta": {    "indicator": { "id": "br-ipca-monthly", "unit_symbol": "%" },    "provenance": { "upstream_url": "…", "retrieved_at": "…" },    "returned": 1,    "available": 1,    "truncated": false  }}

date is the normalized start date for the reference period; period is the frequency-aware identifier (YYYY-MM-DD, YYYY-MM, YYYY-QN, or YYYY). source_date and raw_value are retained exactly from the official publisher. Read meta.indicator.date_semantics before interpreting stock, flow, or moving-quarter series.

Use format=csv for a flat download. CSV rows repeat indicator_id, source_id, source_url, and upstream_url, so exported values retain their provenance outside the JSON envelope.

API surface

EndpointPurpose
GET /api/v1Machine-readable API discovery
GET /api/v1/indicatorsSearch and filter the indicator catalog
GET /api/v1/indicators/:idFull indicator metadata, units, semantics, and links
GET /api/v1/indicators/:id/observationsNormalized historical values
GET /api/v1/indicators/:id/latestLatest available observation
GET /api/v1/sourcesPublisher, attribution, and license metadata
GET /api/v1/openapi.jsonOpenAPI 3.1 description
GET /api/v1/healthRouter and catalog readiness (does not call publishers)

All endpoints support CORS and GET, HEAD, and OPTIONS. Successful and error responses include X-Request-Id; browser clients can also read cache, timing, and stale-response headers.

Errors and freshness

Errors use application/problem+json with a stable code, HTTP status, human-readable title, explanatory detail, and request_id. Common cases include INVALID_DATE, INVALID_CATEGORY, INDICATOR_NOT_FOUND, UPSTREAM_CONNECTION_ERROR, and UPSTREAM_TIMEOUT.

The API caches successfully normalized source responses in D1 when configured. If a refresh fails and a previous matching snapshot exists, it is returned with meta.stale: true, meta.cache: "stale", and HTTP Warning: 110. A cache read or write failure is treated as a cache bypass, never as a data failure.

The service is currently best-effort and has no uptime SLA. See RELIABILITY.md for the explicit availability, freshness, change-management, and incident-reporting policy.

Sources and correctness

  • IBGE Aggregates/SIDRA: prices, GDP, industry, retail, services, labor. The adapter requests the exact official period IDs required for each query; IBGE zero, suppression, availability, and quality symbols keep distinct status values.
  • BCB SGS: rates, FX, activity, credit, fiscal, external-sector, and commodity series. Rows are normalized, sorted, and de-duplicated because upstream ordering is not guaranteed.
  • Tesouro Nacional / SICONFI: annual accounts, budget execution, fiscal limits, personnel spending, debt, and the government-entity registry.
  • Tesouro Nacional / RTN: monthly current-value Government Central revenue, transfers, expenditure, and fiscal-result accounts from 1997 onward, in the official hierarchy and R$ million unit.
  • Tesouro Nacional / RMD: monthly Federal Public Debt composition, DPMFi holders, average maturity, and cost. Each official table keeps its own unit, coverage, definitions, footnotes, and publication vintage.
  • MDIC / Comex Stat: exports and imports by product, partner, state, transport mode, customs office, and international classifications.
  • ANP / Levantamento de Preços de Combustíveis: rolling four-week or monthly fuel and GLP station observations, aggregated by explicit period, product, and geography with calculation provenance.
  • EPE / Consumo Mensal de Energia Elétrica: monthly consumption and consumer counts from 2004 onward by UF, region, class, and captive/free market, with the official workbook version attached.
  • MTE / Novo Caged: adjusted monthly employment stock, admissions, dismissals, balance, and relative change from 2020 onward by national total, region/state, or economic activity, with the exact official workbook vintage attached and incompatible table dimensions kept separate.
  • CVM / Informe Diário de Fundos: daily portfolio value, net assets, subscriptions, redemptions, quota values, and reported holders. Queries can compare official classifications or resolve a latest fund/class report by CNPJ or name; quota values are never aggregated and holder totals are not represented as unique people.

There are 32 curated indicators across inflation, interest rates, currencies, activity, labor, credit, fiscal, external, and markets. Values are never fabricated, forward-filled, or silently sign-inverted. BCB NFSP fiscal series retain BCB's financing-requirement sign convention.

BCB catalog data is published under ODbL; preserve its attribution and share-alike obligations when distributing adapted databases. Attribute IBGE as IBGE/SIDRA and retain its source links and terms. Each indicator response has the authoritative URLs and license applicable to that series.

Run locally

Node.js 22.13+ is required.

bash
npm installnpm run devnpm run lintnpm testnpm run catalog:epe-syncnpm run catalog:mte-syncnpm run catalog:cvm-syncnpm run catalog:rtn-syncnpm run catalog:dpf-sync

Examples are available in examples/python.py, examples/multi_source_python.py, and examples/javascript.mjs. The D1 migration in drizzle/ is the deployment record for cache snapshots.

License

The API implementation is released under the MIT License. Upstream data remains governed by each publisher's own terms and licenses.

Source: README.md at commit d8ba0fc

Tools

19

search_official_data

Search Brazilian official economic data

Start here for a natural-language Brazilian economic-information need in Portuguese or English. Resolves the economic concept independently of current coverage, returns ranked official datasets, stable-series shortcuts, confidence, missing source integrations, and an explicit unresolved/partial state. Use this before any data query when the exact official dataset ID is unknown.

Parameterslimitqueryrequired

describe_official_dataset

Describe an official dataset

Get identity, publisher, collection, provenance links, query capability, and any stable Open Economics series shortcuts for an exact dataset ID returned by search_official_data. This does not fetch observations.

Parametersdataset_idrequired

get_bcb_series

Get observations from a BCB SGS series

Retrieve official observations and authoritative schema metadata for an exact BCB SGS dataset ID. Use only after search_official_data identifies the series. Dates, units, periodicity, source, and raw values are preserved; generic access does not guess transformations.

Parametersendlimitorderstartdataset_idrequired

get_bcb_schema

Inspect BCB series meaning and units

Fetch authoritative metadata for an exact BCB SGS series, including full name, subject hierarchy, periodicity, unit, source, coverage dates, decimals, formula, and warnings. Use when interpreting a BCB series without retrieving observations.

Parametersdataset_idrequired

get_ibge_schema

Inspect an IBGE aggregate's measures and dimensions

Fetch official metadata for an IBGE aggregate selected by search_official_data. Always use this before get_ibge_data unless the official variable, locality, and classification IDs are already known. It prevents guessing a measure or dimensional slice.

Parametersdataset_idrequired

get_ibge_data

Query multidimensional IBGE data

Retrieve an explicit slice of an IBGE aggregate after inspecting its schema. Returns variables containing classification selections, geographies, and observations; official suppression, missing, quality-flag, and zero states remain distinct.

Parametersperiodslocalityvariablerequireddataset_idrequiredclassification

get_siconfi_schema

Inspect a SICONFI fiscal report

Get the meaning and required selection fields for an exact SICONFI dataset returned by search_official_data. Use this before get_siconfi_data so entity, reporting period, report type, government branch, and annex are explicit rather than guessed.

Parametersdataset_idrequired

get_siconfi_data

Query official SICONFI fiscal data

Retrieve an explicit official SICONFI DCA, RREO, RGF, or entity-registry selection. First inspect the schema. This tool preserves account, column, annex, period, entity, raw value fields, and upstream provenance without aggregating or substituting concepts.

Parametersyearannexpowerentityperiodspheredataset_idrequiredperiodicityreport_type

get_comexstat_data

Query official Brazilian merchandise trade

Retrieve a bounded, explicit MDIC Comex Stat export or import slice from 1997 onward. Use comexstat:general only after search_official_data. Select period, dimensions, metrics, and optional official filter codes; partner, product, state, transport, classification, and raw metric fields remain attached to the result.

Parameterstorequiredflowrequiredfromrequireddetailsfiltersmetricslanguagedataset_idrequiredmonth_detail

get_anp_fuel_prices

Query official ANP fuel prices

Retrieve auditable fuel and GLP price statistics calculated from official ANP station observations. Omit year and month for the rolling latest four weeks, or provide both for a published monthly file from 2023 onward. Results retain period, product, geography, unit, sample count, source URL, and the disclosed aggregation method while excluding station identity and addresses.

Parametersyearlimitmonthstateperiodproductgeographydataset_idrequiredfuel_grouprequiredmunicipality

get_epe_electricity_consumption

Query official electricity consumption

Retrieve monthly EPE electricity consumption and consumer counts from 2004 onward. Select a bounded period, country/region/UF geography, consumption classes, and regulated/free market. The response identifies the exact synchronized official workbook version and discloses aggregation across source system rows.

Parameterstofromlimitstatesclassesmarketsregionsgeographydataset_idrequired

get_mte_formal_employment_schema

Inspect Novo Caged dimensions and measures

Inspect the official adjusted Novo Caged selection contract, source vintage, measure meanings, available industry IDs, and the constraint that geography and industry come from separate official tables. Use before an industry query.

Parametersdataset_idrequired

get_mte_formal_employment

Query official formal-employment stock and flows

Retrieve revised monthly Novo Caged stock, admissions, dismissals, balance, and relative change from 2020 onward. Select exactly one official breakdown: country, region, state, or economic activity. The response preserves the MTE workbook vintage and never synthesizes state-by-industry values.

Parameterstofromlimitstatesregionsbreakdowndataset_idrequiredindustries

get_cvm_investment_funds_schema

Inspect CVM investment-fund measures and dimensions

Inspect the synchronized CVM daily-report window, official classifications, fund-search contract, measure meanings, and aggregation constraints. Use before querying a fund by name or comparing classes.

Parametersdataset_idrequired

get_tesouro_rtn_schema

Inspect Government Central fiscal accounts

Inspect RTN table 1.2 account IDs, hierarchy, current-value unit, coverage, source vintage, and above/below-the-line constraints. Use before selecting revenue or expenditure categories.

Parametersdataset_idrequired

get_tesouro_rtn

Query Government Central revenue, expenditure, and result

Retrieve monthly current-value RTN accounts from 1997 onward. Defaults to total revenue, transfers, net revenue, total expenditure, and the above-the-line primary result; select exact account IDs or search account labels for detail.

Parameterstofromlimitqueryaccountsdataset_idrequired

get_tesouro_dpf_schema

Inspect Federal Public Debt statistics

Inspect the six versioned RMD annex tables, their distinct units and coverage, category IDs, holder definitions, source publication, and methodological constraints before selecting data.

Parametersdataset_idrequired

get_tesouro_dpf

Query Federal Public Debt statistics

Retrieve one official monthly RMD table at a time: debt composition, DPMFi holders, average maturity, average maturity by indexer, monthly cost, or twelve-month cost. Units remain table-specific and are never combined.

Parameterstofromlimitquerytablecategoriesdataset_idrequired

get_cvm_investment_funds

Query official CVM investment-fund reports

Retrieve daily CVM aggregates by official fund classification or resolve a fund/class latest report by CNPJ or name. Net assets and flows are additive; quota values stay fund-level; reported holder totals are not deduplicated people.

Parameterstofromfundslimitquerybreakdowndataset_idrequiredclassifications

Version history

1
  1. v2.0.2LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts