Gov Stats MCP Server - 提供中国国家统计局数据查询的 MCP 服务
Project description
Gov Stats MCP Server
提供中国国家统计局数据查询的 MCP 服务。
功能特性
- 🔍 查询国家统计局各类经济指标数据
- 📊 支持价格指数、工业数据、宏观经济等多类指标
- 🌍 支持全国、分省、分城市数据查询
- 📅 支持月度、季度、年度数据
- 🚀 批量查询支持
安装
pip install data-wise-gov-stats-mcp-server
使用方法
作为 MCP 服务器运行
uvx data-wise-gov-stats-mcp-server
在 Kiro 中配置
在 .kiro/settings/mcp.json 中添加:
{
"mcpServers": {
"gov-stats": {
"command": "uvx",
"args": ["data-wise-gov-stats-mcp-server"]
}
}
}
可用工具
1. query_stats - 查询统计数据
查询单个指标的统计数据。
参数:
zbcode(必需): 指标代码,如 "A010101"datestr(必需): 查询日期- 月度: YYYYMM (如 "202401")
- 季度: YYYYQ1-4 (如 "2024Q1")
- 年度: YYYY (如 "2024")
dbcode(可选): 数据库代码,默认 "hgyd" (宏观月度数据)regcode(可选): 地区代码,如 "110000" (北京市)
示例:
{
"zbcode": "A010101",
"datestr": "202401",
"dbcode": "hgyd"
}
2. batch_query_stats - 批量查询
批量查询多个指标数据(最多100个)。
参数:
zbcodes: 指标代码列表datestr: 查询日期dbcode: 数据库代码(可选)regcode: 地区代码(可选)
示例:
{
"zbcodes": ["A010101", "A0D0101"],
"datestr": "202401"
}
3. list_indicators - 列出指标
列出所有可用的指标代码及其描述(共591个指标)。
4. list_dbcodes - 列出数据库代码
列出所有可用的数据库代码及其描述。
5. list_regions - 列出地区代码
列出所有可用的省级地区代码及其名称(共31个省级行政区)。
6. list_cities - 列出城市代码
列出所有可用的主要城市代码及其名称(共71个主要城市)。
常用指标代码
价格指数
A010101: 全国居民消费价格分类指数(上年同月=100)A010801: 工业生产者出厂价格指数(上年同月=100)
宏观经济
A0D0101: 货币供应量(M2)A0D0103: 货币供应量(M1)A0D0105: 货币供应量(M0)
工业数据
A020101: 工业增加值增长速度A020201: 按经济类型分工业增加值增长速度
数据库代码
hgyd: 宏观月度数据hgjd: 宏观季度数据hgnd: 宏观年度数据fsyd: 分省月度数据fsjd: 分省季度数据fsnd: 分省年度数据csyd: 城市月度数据csjd: 城市季度数据csnd: 城市年度数据
依赖
- fastmcp >= 2.14.1
- cn-stats >= 0.1.0
注意: cn-stats 包的导入名称为 cnstats(使用下划线),但 pip 安装时使用 cn-stats(使用连字符)。
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file data_wise_gov_stats_mcp_server-1.1.0.tar.gz.
File metadata
- Download URL: data_wise_gov_stats_mcp_server-1.1.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bab59851c49a593a6a521b5b1a18b25a87885d7c790f390a6ba32ebfa609384c
|
|
| MD5 |
7e46fa7ee2231e6907ffee012a655cf4
|
|
| BLAKE2b-256 |
275b0c68d3ca368428e57c5975e7a183d650a4a66694c4a6f0b2d95115da89f0
|
File details
Details for the file data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl.
File metadata
- Download URL: data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3326dd5d580147f39ecb4d5f633085d20fdf9db07d09b0399ac9d8d3373dc626
|
|
| MD5 |
37b2b95cf31cc7fedb35827bce8d3c2a
|
|
| BLAKE2b-256 |
0926f0571541f2f58abe01a03b3820773c9083e7087ecde4c585b23d78a7b201
|