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
Metadata
Release files for data-wise-gov-stats-mcp-server 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| data_wise_gov_stats_mcp_server-1.1.0.tar.gz | 13.3 kB | Without provenance | Details for data_wise_gov_stats_mcp_server-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl |
Total release size: 29.2 kB
Release files / data_wise_gov_stats_mcp_server-1.1.0.tar.gz
| Download URL | data_wise_gov_stats_mcp_server-1.1.0.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bab59851c49a593a6a521b5b1a18b25a87885d7c790f390a6ba32ebfa609384c
|
|
BLAKE2b-256 checksum How to use checksums |
275b0c68d3ca368428e57c5975e7a183d650a4a66694c4a6f0b2d95115da89f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl
| Download URL | data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3326dd5d580147f39ecb4d5f633085d20fdf9db07d09b0399ac9d8d3373dc626
|
|
BLAKE2b-256 checksum How to use checksums |
0926f0571541f2f58abe01a03b3820773c9083e7087ecde4c585b23d78a7b201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for data-wise-gov-stats-mcp-server 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.