
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 分