Open Economics

io.github.felipegambettadesouza6-jpg由 GitHub 帳號 felipegambettadesouza6-jpg 發布v2.0.2更新於 Oct 24, 2026

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

已驗證Streamable HTTP可網頁執行金融資料與分析

概覽

AI 產生的概覽

唯讀 MCP 伺服器,把巴西經濟問題解析為官方資料集,並回傳 BCB、IBGE、SICONFI、Comex Stat、ANP、EPE、MTE、CVM 與 Tesouro 的資料及來源資訊。

可以做什麼
  • 以自然語言檢索並解析經濟概念,回傳排序後的官方資料集、信心程度與涵蓋缺口
  • 檢視資料集與序列的中繼資料:發布機關、單位、頻率、涵蓋期間、公式與警告
  • 取得 BCB SGS 序列與 IBGE 彙總資料,需明確指定變數、期間與地區
  • 查詢財政與貿易資料:SICONFI 報表、Comex Stat 進出口、Tesouro RTN 科目與 RMD 債務表
  • 取得燃油價格、電力消費、正式就業與投資基金彙總資料
適用情境
適合以葡語或英語的自然語言提問巴西總體、財政、貿易、就業或市場資料,且需要數值可追溯至官方來源的情境。若已知確切的發布機關識別碼並能直接呼叫原始來源,則幫助不大。
執行需求
遠端 streamable HTTP 端點;未宣告驗證、環境變數或請求標頭。需要能連線至該服務的網路。若要在本機執行專案,需要 Node.js 22.13 以上版本。
安裝前請注意
僅進行唯讀資料取得,但服務自稱盡力而為且無可用性 SLA,可能回傳標示為過期的快取快照。數值來自第三方發布機關,重複使用前應確認單位、日期語意與正負號慣例。BCB 資料採 ODbL 授權,IBGE 資料需標示出處,再散布時須遵守標示出處與相同方式分享的義務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Open Economics,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.felipegambettadesouza6-jpg%2Fopen-economics/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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.

來源:README.md,提交 d8ba0fc

工具

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.

輸入參數limitquery必填

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.

輸入參數dataset_id必填

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.

輸入參數endlimitorderstartdataset_id必填

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.

輸入參數dataset_id必填

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.

輸入參數dataset_id必填

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.

輸入參數periodslocalityvariable必填dataset_id必填classification

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.

輸入參數dataset_id必填

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.

輸入參數yearannexpowerentityperiodspheredataset_id必填periodicityreport_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.

輸入參數to必填flow必填from必填detailsfiltersmetricslanguagedataset_id必填month_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.

輸入參數yearlimitmonthstateperiodproductgeographydataset_id必填fuel_group必填municipality

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.

輸入參數tofromlimitstatesclassesmarketsregionsgeographydataset_id必填

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.

輸入參數dataset_id必填

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.

輸入參數tofromlimitstatesregionsbreakdowndataset_id必填industries

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.

輸入參數dataset_id必填

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.

輸入參數dataset_id必填

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.

輸入參數tofromlimitqueryaccountsdataset_id必填

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.

輸入參數dataset_id必填

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.

輸入參數tofromlimitquerytablecategoriesdataset_id必填

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.

輸入參數tofromfundslimitquerybreakdowndataset_id必填classifications

版本歷史

1
  1. v2.0.2最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分