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 分