Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data_wise_gov_stats_mcp_server-1.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file data_wise_gov_stats_mcp_server-1.1.0.tar.gz.

File metadata

File hashes

Hashes for data_wise_gov_stats_mcp_server-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bab59851c49a593a6a521b5b1a18b25a87885d7c790f390a6ba32ebfa609384c
MD5 7e46fa7ee2231e6907ffee012a655cf4
BLAKE2b-256 275b0c68d3ca368428e57c5975e7a183d650a4a66694c4a6f0b2d95115da89f0

See more details on using hashes here.

File details

Details for the file data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for data_wise_gov_stats_mcp_server-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3326dd5d580147f39ecb4d5f633085d20fdf9db07d09b0399ac9d8d3373dc626
MD5 37b2b95cf31cc7fedb35827bce8d3c2a
BLAKE2b-256 0926f0571541f2f58abe01a03b3820773c9083e7087ecde4c585b23d78a7b201

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page