CNBS MCP Server
Supports deployment on Cloudflare Workers platform with authentication token configuration via Wrangler CLI and Cloudflare dashboard secrets for secure serverless operation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CNBS MCP Servershow me China's GDP trend over the last 5 years"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CNBS MCP Server
MCP server for querying China National Bureau of Statistics data.
Installation
Use with npx (Recommended)
npx @icen.ai/mcp-cnbsUse with HTTP transport
npx @icen.ai/mcp-cnbs --port 12345Install globally
npm install -g @icen.ai/mcp-cnbs
mcp-cnbsMCP 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)
Streamable HTTP (recommended):
{
"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 |
| GET | Legacy SSE mode |
| POST | Legacy SSE messages |
Tools
Data Query
Tool | Description |
| Search by keyword, returns latest data value |
| Get category tree nodes |
| Get indicator list for a dataset |
| Get time series data |
| Recursively get all leaf nodes |
| Batch search multiple keywords |
| Compare data across regions or time periods |
Reference Data
Tool | Description |
| Get available region codes and names |
| Get all data category information |
Utilities
Tool | Description |
| Get usage guide |
| Get cache statistics |
| Format numbers |
| Unit conversion |
| 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/LAST18Monthly:
202401MM, range["202301MM-202412MM"]
Region Codes
Region codes follow GB/T 2260 standard. Use cnbs_get_regions to get the full list.
Examples:
Beijing:
110000000000Shanghai:
310000000000Guangdong:
440000000000
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm run start
# Development mode with watch
npm run devAuthentication
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 12345When authentication is enabled, requests must include:
Authorization: Bearer your-secret-tokenCloudflare 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
This server cannot be installed
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