
Mcp Nbb
io.github.lacausecrypto由 GitHub 账号 lacausecrypto 发布v0.1.2更新于 Oct 24, 2026
MCP server for the National Bank of Belgium SDMX statistical API (221 dataflows).
概览
一个本地 MCP 服务器,让助手检索、描述并查询比利时国家银行的 SDMX 统计 API,覆盖 221 个数据流。
- 可以做什么
- 检索与描述数据流:在随包附带的 221 个数据流目录上做模糊搜索,支持四种语言,并给出含维度、代码表和键模板的完整说明,无需调用 API。获取数据:按原始 SDMX 键或维度筛选做通用查询,另有 18 个常见指标的快捷主题,如汇率、政策利率与房贷利率、通胀、GDP、失业率和政府债务。比较序列:将 2 至 5 条序列对齐到统一时间轴,并对更高频率做降采样。浏览资源:目录索引、单个数据流说明和按类别列出。查看状态:目录、缓存与 API 配置的诊断快照。
- 适用场景
- 适合在对话中获取比利时及欧元区的宏观经济或金融统计数据,例如查询汇率、比较 GDP 增长与失业率,或查找某个主题对应哪个数据流。
- 运行要求
- 以 Python 包形式通过 stdio 在本地运行(需 Python 3.11 及以上),通常用 uvx 或 pip 启动。需要网络访问 NBB 的 SDMX REST 端点。无需账号或 API 密钥;可选环境变量可调整 API 地址、超时、缓存、限流、重试和日志。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp Nbb,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-nbb
[CI] [PyPI version] [Python versions] [License: MIT] [MCP compatible]
MCP server for the National Bank of Belgium SDMX statistical API.
Exposes the 221 NBB dataflows (194 BE2 + 27 IMF/SDDS) as 6 LLM-friendly tools and 3 browsable resources, with a bundled enriched catalogue so the LLM can discover, describe, and query dataflows without redundant API calls.
- Upstream:
https://nsidisseminate-stat.nbb.be/rest(NSI Web Service v8) - Transport: stdio (standard MCP)
- Python: 3.11+
- Platforms: Linux, macOS, Windows
- 221 dataflows classified into 14 categories — see DATAFLOWS_CATALOG.md
Install
From PyPI (recommended)
From source
The package ships with the full enriched catalogue (~9 MB under
src/nbb_mcp/data/catalog/). No build step is required for regular use.
Claude Desktop configuration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json on
macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows, or the
equivalent on Linux.
Using uvx (recommended once published to PyPI)
From a local editable install
macOS / Linux:
Windows:
Restart Claude Desktop — the 6 nbb_* tools appear in the MCP panel.
Tools
nbb_quick topics
Resources
Example prompts in Claude
"What's the EUR/USD exchange rate over the last month?" →
nbb_quick("exchange_rate", currency="USD", frequency="D", last_n_observations=30)
"Compare Belgian GDP growth to the unemployment rate since 2020." →
nbb_compare([{dataflow_id:"DF_QNA_DISS",label:"GDP"}, {dataflow_id:"DF_UNEMPLOY_RATE",label:"Unemployment"}], start_period="2020-Q1")
"Find NBB dataflows about consumer credit." →
nbb_search("consumer credit")→nbb_describe(...)→nbb_query(...).
Configuration (environment variables)
All settings have sensible defaults; override via environment variables.
The default cache path resolves to:
- Linux:
~/.cache/mcp-nbb/ - macOS:
~/Library/Caches/mcp-nbb/ - Windows:
%LOCALAPPDATA%\mcp-nbb\Cache\
Refreshing the catalogue
The bundled src/nbb_mcp/data/catalog/ snapshot is regenerated by fetching
the DSD + codelists for each of the 221 dataflows:
Options:
--force— rebuild every fiche, ignoring existing ones.--limit N— only process the first N flows (debug).--only BE2/DF_EXR,BE2/DF_HICP_2025— rebuild specific flows.--concurrency 5— parallel DSD requests.
A full rebuild takes ~80 seconds against the live API. Catalogue footprint is capped at ~9 MB by truncating codelists to 200 codes per dimension (some IMF flows have 65 000+ codes).
A weekly GitHub Action (build-catalog.yml) rebuilds the catalogue and opens
a PR if drift is detected.
Troubleshooting
"WAF returned an HTML redirect"
The NBB API is behind a WAF that returns an HTML 200 redirect for any request
without a browser-like User-Agent and an Origin: https://dataexplorer.nbb.be
header. The client injects both by default. If you override NBB_USER_AGENT,
keep a genuine-looking browser string.
"HTTP 404 NoResultsFound" on a data query
The SDMX key didn't match any series. Use nbb_describe(dataflow_id) to see
valid codes, or pass filters={} / key="all" to retrieve everything and
then narrow via start_period/end_period.
"Too many observations, truncated"
Every data response is capped at max_observations=200 by default. Increase
via nbb_query(max_observations=1000) or narrow the query with a period
window.
Catalogue not found
If you run without the bundled src/nbb_mcp/data/catalog/, run
mcp-nbb-build-catalog once to populate it.
Development
See CONTRIBUTING.md for the full dev workflow. Short form:
CI runs on Linux, macOS and Windows with Python 3.11 and 3.12. See DATAFLOWS_CATALOG.md for the classified inventory.
Security
Please report vulnerabilities privately — see SECURITY.md.
License
MIT — see LICENSE for the full text.
Disclaimer
This project is not affiliated with or endorsed by the National Bank of
Belgium. It is an independent client of their public SDMX REST API. The
browser-like User-Agent and Origin headers are required by the upstream
WAF and used solely to access public statistical data. Users are responsible
for complying with NBB's terms of use.
来源:README.md,提交 8816b6b
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分