CNBS MCP Server
Enables querying China National Bureau of Statistics data including economic indicators, time series, and regional statistics. Supports natural language search, batch queries, comparisons, and analysis across monthly, quarterly, and yearly datasets.
README
CNBS MCP Server
MCP server for querying China National Bureau of Statistics data.
Installation
Use with npx (Recommended)
npx @icen.ai/mcp-cnbs
Use with HTTP transport
npx @icen.ai/mcp-cnbs --port 12345
Install globally
npm install -g @icen.ai/mcp-cnbs
mcp-cnbs
MCP Client Configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"cnbs": {
"command": "npx",
"args": ["@icen.ai/mcp-cnbs"]
}
}
}
Cursor / Windsurf
{
"mcpServers": {
"cnbs": {
"command": "npx",
"args": ["@icen.ai/mcp-cnbs"]
}
}
}
HTTP Mode (for remote access)
Free Demo on ModelScope (recommended):
{
"mcpServers": {
"cnbs": {
"type": "streamable_http",
"url": "https://mcp.api-inference.modelscope.net/86a1a6b0b08741/mcp"
}
}
}
Free, no authentication required. View on ModelScope
Self-hosted Streamable HTTP:
{
"mcpServers": {
"cnbs": {
"url": "http://cnbs.mcp.icen.ai"
}
}
}
Legacy SSE (for older clients):
{
"mcpServers": {
"cnbs": {
"url": "http://cnbs.mcp.icen.ai/sse"
}
}
}
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/ |
POST | Streamable HTTP (recommended) |
/ |
GET | SSE stream for notifications |
/sse |
GET | Legacy SSE mode |
/message |
POST | Legacy SSE messages |
Tools
Data Query
| Tool | Description |
|---|---|
cnbs_search |
Search by keyword, returns latest data value |
cnbs_fetch_nodes |
Get category tree nodes |
cnbs_fetch_metrics |
Get indicator list for a dataset |
cnbs_fetch_series |
Get time series data |
cnbs_fetch_end_nodes |
Recursively get all leaf nodes |
cnbs_batch_search |
Batch search multiple keywords |
cnbs_compare |
Compare data across regions or time periods |
Reference Data
| Tool | Description |
|---|---|
cnbs_get_regions |
Get available region codes and names |
cnbs_get_categories |
Get all data category information |
Utilities
| Tool | Description |
|---|---|
cnbs_get_guide |
Get usage guide |
cnbs_get_cache_stats |
Get cache statistics |
cnbs_format_number |
Format numbers |
cnbs_transform_unit |
Unit conversion |
cnbs_compute_stats |
Compute statistics |
Quick Examples
// Search GDP
cnbs_search(keyword="GDP")
// Search birth rate
cnbs_search(keyword="出生率")
// Batch search
cnbs_batch_search(keywords=["GDP", "CPI", "人口"])
// Compare regions
cnbs_compare(keyword="GDP", regions=["北京", "上海"], compareType="region")
// Get region codes
cnbs_get_regions(keyword="广东")
Notes
cnbs_search returns value field with data. cnbs_fetch_series may return empty value - this is an API limitation.
For latest values, use cnbs_search.
Category Codes
| Code | Category |
|---|---|
| 1 | Monthly |
| 2 | Quarterly |
| 3 | Yearly |
| 5 | Provincial Quarterly |
| 6 | Provincial Yearly |
| 7 | Other |
| 8 | Major Cities Yearly |
| 9 | Hong Kong/Macau/Taiwan Monthly |
| 10 | Hong Kong/Macau/Taiwan Yearly |
Time Format
- Yearly:
2024YY, range["2020YY-2024YY"] - Quarterly:
2024A/B/C/D, shortcutsLAST6/LAST12/LAST18 - Monthly:
202401MM, range["202301MM-202412MM"]
Region Codes
Region codes follow GB/T 2260 standard. Use cnbs_get_regions to get the full list.
Examples:
- Beijing:
110000000000 - Shanghai:
310000000000 - Guangdong:
440000000000
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm run start
# Development mode with watch
npm run dev
Authentication
By default, no authentication is required. You can enable authentication using Bearer token.
Local / HTTP Mode
# Using command line argument
npx @icen.ai/mcp-cnbs --port 12345 --auth-token your-secret-token
# Using environment variable
MCP_CNBS_AUTH_TOKEN=your-secret-token npx @icen.ai/mcp-cnbs --port 12345
When authentication is enabled, requests must include:
Authorization: Bearer your-secret-token
Cloudflare Workers
Set MCP_CNBS_AUTH_TOKEN in Cloudflare dashboard secrets:
# Deploy with secret
npx wrangler secret put MCP_CNBS_AUTH_TOKEN
# Enter your token when prompted
# Or use wrangler.toml
# (secrets cannot be set in wrangler.toml for security)
MCP Client Configuration with Auth
{
"mcpServers": {
"cnbs": {
"command": "npx",
"args": ["@icen.ai/mcp-cnbs", "--port", "12345", "--auth-token", "your-secret-token"]
}
}
}
Requirements
- Node.js >= 18.0.0
- Network access to
data.stats.gov.cn
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。