VOOZH about

URL: https://glama.ai/mcp/servers/icen-ai/mcp-cnbs?locale=zh-CN

⇱ CNBS MCP 服务器 by icen-ai | Glama


CNBS MCP 服务器

MCP 服务器,用于查询中国国家统计局 (NBS) 数据及主要的国际统计数据库。所有数据均通过真实 API 获取 — 无模拟数据。

数据源

数据源

认证

覆盖范围

中国国家统计局 (data.stats.gov.cn)

月度 / 季度 / 年度 / 省级国内数据

世界银行 (api.worldbank.org)

200+ 国家 — GDP、CPI、贸易、人口、FDI、基尼系数等

IMF DataMapper

WEO 预测 — GDP 增长、通胀、政府债务、经常账户

OECD SDMX

成员国季度 GDP、就业、先行指标

BIS 统计数据

有效汇率、信贷缺口、房价、跨境银行数据

FRED (美联储)

X-Fred-Api-Key 请求头

美国利率、人民币/美元汇率、石油、黄金、标普 500、M2

国家统计局普查

人口普查 (2020)、经济普查 (2018)、农业普查 (2016)

国家统计局部门

财政、工业、贸易、农业、央行货币、社会保障、住房、能源

FRED API Key:https://fred.stlouisfed.org/docs/api/api_key.html 免费注册
通过 X-Fred-Api-Key 请求头(HTTP 模式)传递,或设置 FRED_API_KEY 环境变量(stdio 模式)。


Related MCP server: Stock Data MCP Server

安装

npx (推荐)

npx mcp-cnbs

HTTP 传输

npx mcp-cnbs --port 12345

全局安装

npm install -g mcp-cnbs
mcp-cnbs

MCP 客户端配置

stdio 模式 (npx)

支持的客户端: Claude Desktop, Cursor, Windsurf, Cherry Studio, Trae, Continue 以及所有兼容 MCP 的客户端。

{
 "mcpServers": {
 "cnbs": {
 "command": "npx",
 "args": ["mcp-cnbs"]
 }
 }
}

支持 FRED:

{
 "mcpServers": {
 "cnbs": {
 "command": "npx",
 "args": ["mcp-cnbs"],
 "env": {
 "FRED_API_KEY": "your_fred_api_key"
 }
 }
 }
}

HTTP 模式 (远程)

支持的客户端: Trae, Cherry Studio 以及其他支持 HTTP 传输的客户端。

ModelScope 免费演示(无 FRED):

{
 "mcpServers": {
 "cnbs": {
 "url": "https://mcp.api-inference.modelscope.net/c2ca6ece4e9946/mcp"
 }
 }
}

支持 FRED 的 HTTP 模式:

{
 "mcpServers": {
 "cnbs": {
 "url": "https://your-cnbs-server/mcp",
 "headers": {
 "X-Fred-Api-Key": "your_fred_api_key"
 }
 }
 }
}

由阿里云 ModelScope 提供免费公共演示。无需认证。
如需生产使用,请部署您自己的实例


HTTP 端点

端点

方法

描述

//mcp

POST

可流式传输的 HTTP — 初始化会话或发送请求

//mcp

GET

SSE 通知流(需要 Mcp-Session-Id 请求头)

//mcp

DELETE

终止会话(需要 Mcp-Session-Id 请求头)

/sse

GET

旧版 SSE 模式

/message

POST

旧版 SSE 消息


工具

国家统计局核心查询

工具

描述

cnbs_search

按关键词搜索,返回最新值 — 从这里开始

cnbs_batch_search

一次调用批量搜索多个关键词

cnbs_economic_snapshot

一次性获取 10 个关键中国宏观指标快照(GDP、CPI、PPI、PMI、失业率、工业增加值、零售额、固定资产投资、贸易、M2)

cnbs_compare

跨区域或跨时间段对比数据

cnbs_fetch_nodes

获取分类树节点 — 接受一个或多个分类

cnbs_fetch_metrics

获取指标列表 — 接受一个或多个 setIds

cnbs_fetch_series

获取时间序列数据

cnbs_fetch_end_nodes

递归获取所有叶子节点

国家统计局参考

工具

描述

cnbs_get_guide

完整工具指南(有助于 LLM 自我定位)

cnbs_get_regions

区域代码和名称 (GB/T 2260)

cnbs_get_categories

国家统计局分类代码

cnbs_list_data_sources

所有可用数据源及其工具映射

cnbs_fetch_data_from_source

从任何指定数据源获取数据

cnbs_get_source_categories

获取指定数据源的分类

cnbs_search_in_source

在特定数据源内搜索

世界银行

工具

描述

ext_world_bank

查询跨国家和年份的单个指标

ext_world_bank_multi

同时查询多个指标

ext_world_bank_indicators

列出所有支持的世界银行指标

IMF

工具

描述

ext_imf

查询 IMF WEO 数据 — 接受一个或多个指标

ext_imf_indicators

列出支持的 IMF 指标

ext_imf_all_indicators

完整的 IMF DataMapper 指标目录

OECD

工具

描述

ext_oecd

按数据集和键查询 OECD SDMX 数据

ext_oecd_datasets

列出支持的 OECD 数据集

BIS

工具

描述

ext_bis

查询 BIS 统计数据 — 接受一个或多个国家

ext_bis_datasets

列出支持的 BIS 数据集及键模板

FRED (美联储)

工具

描述

ext_fred

查询 FRED 系列 — 接受一个或多个系列

ext_fred_series

列出所有支持的 FRED 系列

中国扩展数据源

工具

描述

ext_cn_census

国家统计局普查数据(人口、经济、农业)

ext_cn_department

各部委的国家统计局部门统计数据

ext_cn_department_list

所有部门分类和指标关键词

跨源对比

工具

描述

ext_global_compare

同时查询世界银行 + IMF,对比跨国家的相同指标


快速示例

中国经济概览

// Full macro snapshot in one call
cnbs_economic_snapshot()

// Latest single indicator
cnbs_search(keyword="GDP")

// Batch indicators
cnbs_batch_search(keywords=["GDP", "CPI", "城镇化率", "出生率"])

// Regional comparison
cnbs_compare(keyword="GDP", regions=["北京", "上海", "广东"], compareType="region")

// Time series
cnbs_fetch_series(setId="...", metricIds=["..."], periods=["2015YY-2024YY"])

国际对比

// China GDP growth vs peers (World Bank)
ext_world_bank(indicator="GDP_GROWTH", countries=["CHN","USA","DEU","JPN","IND"], startYear=2015)

// Multiple indicators for China
ext_world_bank_multi(indicators=["GDP_GROWTH","CPI","UNEMPLOYMENT"], countries=["CHN"], startYear=2010)

// IMF: single indicator
ext_imf(indicators="GDP_GROWTH", countries=["CHN","USA","JPN"], periods=["2022","2023","2024","2025"])

// IMF: multiple indicators in one call
ext_imf(indicators=["GDP_GROWTH","CPI_INFLATION","GOVT_DEBT"], countries=["CHN","USA"], periods=["2020","2021","2022","2023","2024"])

// World Bank + IMF side-by-side
ext_global_compare(wbIndicator="GDP_GROWTH", imfIndicator="GDP_GROWTH", countries=["CHN","USA","DEU","JPN"])

BIS & FRED

// BIS: single country
ext_bis(dataset="EER", countries="CN", lastNObservations=36)

// BIS: multiple countries in one call
ext_bis(dataset="EER", countries=["CN","US","DE","JP"], lastNObservations=24)

// BIS: credit gap
ext_bis(dataset="CREDIT_GAP", countries=["CN","US"], lastNObservations=20)

// FRED: single series
ext_fred(series="OIL_PRICE_WTI", limit=100, sortOrder="desc")

// FRED: multiple series in one call
ext_fred(series=["FED_FUNDS","CNY_USD","OIL_PRICE_WTI","GOLD_PRICE"], limit=30, sortOrder="desc")

国家统计局普查与部门数据

// 2020 Population census
ext_cn_census(type="population")

// PBoC M2 monetary data
ext_cn_department(department="monetary", indicator="M2货币供应量")

// All finance ministry indicators
ext_cn_department(department="finance", fetchAll=true)

国家统计局分类代码

代码

分类

典型指标

1

月度

CPI, PPI, 工业增加值, PMI

2

季度

季度 GDP 增长

3

年度

GDP, 人口, 城镇化率

5

省级季度

省级季度 GDP

6

省级年度

省级年度 GDP, 人口

7

其他 / 调查

住户调查, 特殊调查

国家统计局时间格式

  • 年度: 2024YY, 范围 ["2020YY-2024YY"]

  • 季度: 2024A/B/C/D (A=Q1, B=Q2, C=Q3, D=Q4), 快捷方式 LAST6/LAST12/LAST18

  • 月度: 202401MM, 范围 ["202301MM-202412MM"]

国家统计局区域代码

遵循 GB/T 2260 标准。使用 cnbs_get_regions 获取完整列表。

区域

代码

全国

000000000000

北京

110000000000

上海

310000000000

广东

440000000000

浙江

330000000000

江苏

320000000000


认证

默认无需认证。可启用 Bearer Token 认证:

stdio / HTTP 模式

npx mcp-cnbs --port 12345 --auth-token your-secret-token
# or via env var
MCP_CNBS_AUTH_TOKEN=your-secret-token npx mcp-cnbs --port 12345

请求必须包含:

Authorization: Bearer your-secret-token

Cloudflare Workers

npx wrangler secret put MCP_CNBS_AUTH_TOKEN

开发

npm install
npm run build
npm run start

要求

  • Node.js >= 18.0.0

  • 网络访问权限: data.stats.gov.cn, api.worldbank.org, www.imf.org, sdmx.oecd.org, stats.bis.org, api.stlouisfed.org

许可证

MIT

A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/icen-ai/mcp-cnbs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server