Skip to main content
Glama
e-Stat MCP server
by cygkichi

e-Stat MCP server

Model Context Protocol (MCP) サーバーで、日本の政府統計ポータルサイト「e-Stat」のAPIにアクセスするための機能を提供します。言語モデルが統計データを検索・取得できるようになります。

ツール

このサーバーは以下のツールを提供しています:

  • search_e_stat_tables : キーワードと調査年で統計表を検索します

  • get_e_stat_meta_info : 統計表IDに対応するメタ情報を取得します

  • get_specific_e_stat_data : 統計表IDまたはデータセットIDに対応する統計データを取得します

  • get_e_stat_ref_dataset : データセットの絞り込み条件等を参照します

  • get_e_stat_data_catalog : 統計表ファイルおよび統計データベースの情報を取得します

Related MCP server: houjin-bangou-api-mcp

使い方

このサーバーを使用するには、e-Stat APIのアプリケーションIDが必要です。以下の手順で取得できます:

  1. e-Stat API機能にアクセス

  2. ユーザ登録を行う

  3. 利用規約に同意してアプリケーションIDを取得

Claude Desktop

  • On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

  • On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
    "mcpServers": {
        "e-stat": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/estat-mcp-server",
                "run",
                "server.py"
            ],
            "env": {
                "E_STAT_APP_ID": "YOUR_E_STAT_APP_ID"
            }
        }
    }
}
{
    "mcpServers": {
        "e-stat": {
            "command": "uvx",
            "args": [
                "estat-mcp-server"
            ],
            "env": {
                "E_STAT_APP_ID": "YOUR_E_STAT_APP_ID"
            }
        }
    }
}

使用例

接続後、Claudeに以下のような質問ができます:

  • "2023年の東京都の人口統計を検索して"

  • "アイスクリームの需要に関する統計を取得して"

  • "都道府県別の高齢化率を比較して"

ライセンス

このプロジェクトはMITライセンスの下で提供されています

  • 詳細はLICENSEファイルを参照してください。

Available Tools

5 tools
get_e_stat_data_catalogB
Retrieves the data catalog from the E-Stat API.
機能名:データカタログ情報取得
政府統計の総合窓口(e-Stat)で提供している統計表ファイルおよび統計データベースの情報を取得できます。
統計表情報取得機能同様に、リクエストパラメータの指定により条件を絞った情報の取得も可能です。


Args:
    search_word (str): Search keyword for statistics tables.
        Use "AND", "OR", or "NOT" to specify multiple words for search.
        Examples:
            - "東京 AND 人口"
            - "東京 OR 大阪"
    surveyYears (str): The survey years for the statistics tables.
        Must be in one of the following formats:
            - yyyy: Unified year.
            - yyyymm: Unified month.
            - yyyymm-yyyymm: Unified month range.
        Example: "2023" or "202301-202312" or "202301"
    startPosition (int, optional): Start position for the search results.
        Defaults to 1. For example:
            - To get the first 100 results, set startPosition to 1.
            - To get the next 100 results, set startPosition to 101.
    limit (int, optional): Maximum number of results to retrieve. Defaults to 100.
Example:
    search_word = "東京 AND 人口"
    surveyYears = "2023"
    startPosition = 1
    limit = 100

Returns:
    str: The response text from the E-Stat API.

Inputs: search_word (required), surveyYears (required), limit, startPosition.

get_e_stat_meta_infoA
Retrieves meta information from the E-Stat API.
機能名:メタ情報取得
指定した統計表IDに対応するメタ情報(表章事項、分類事項、地域事項等)を取得します。

Args:
    stats_data_id (str): The ID of the statistics data(統計表ID).
        Example: "0000010201".

Returns:
    str: The response text from the E-Stat API.

Inputs: stats_data_id (required).

get_e_stat_ref_datasetC
Retrieves the reference dataset from the E-Stat API.
機能名:データセット参照
登録されているデータセットの絞り込み条件等を参照します。
データセットIDが指定されていない場合は、利用者が使用できるデータセットの一覧が参照可能です。

Args:
    data_set_id (str): The ID of the dataset to retrieve(データセットID).

Returns:
    str: The response text from the E-Stat API.

Inputs: data_set_id (required).

get_specific_e_stat_dataA
Retrieves specific statistics data from the E-Stat API.
機能名:統計データ取得
指定した統計表ID又はデータセットIDに対応する統計データ(数値データ)を取得します。

Args:
    data_set_id (str or None): The ID of the dataset(データセットID).
    stats_data_id (str or None): The ID of the statistics data(統計表ID).
    # Ensure that either data_set_id or stats_data_id is provided, but not both
    if not data_set_id and not stats_data_id:
        raise ValueError("Either 'data_set_id' or 'stats_data_id' must be provided.")
    if data_set_id and stats_data_id:
        raise ValueError("Only one of 'data_set_id' or 'stats_data_id' should be provided.")

    startPosition (int): The starting position for the search results.
        Defaults to 1. For example:
            - To get the first 100 results, set startPosition to 1.
            - To get the next 100 results, set startPosition to 101.
    limit (int): The maximum number of results to retrieve.
        Defaults to 100.

Returns:
    str: The response text from the E-Stat API.

Inputs: limit, data_set_id, startPosition, stats_data_id.

search_e_stat_tablesA
Retrieves a list of statistics tables from the E-Stat API.
名称:統計表情報取得
政府統計の総合窓口(e-Stat)で提供している統計表の情報を取得します。
リクエストパラメータの指定により条件を絞った情報の取得も可能です。

Args:
    search_word (str): Search keyword for statistics tables.
        Use "AND", "OR", or "NOT" to specify multiple words for search.
        Examples:
            - "東京 AND 人口"
            - "東京 OR 大阪"
    surveyYears (str): Survey years for the statistics tables.
        Must be in one of the following formats:
            - yyyy: Unified year.
            - yyyymm: Unified month.
            - yyyymm-yyyymm: Unified month range.
        Example: "2023" or "202301-202312" or "202301"
    startPosition (int, optional): Start position for the search results.
        Defaults to 1. For example:
            - To get the first 100 results, set startPosition to 1.
            - To get the next 100 results, set startPosition to 101.
    limit (int, optional): Maximum number of results to retrieve. Defaults to 100.
Example:
    search_word = "東京 AND 人口"
    surveyYears = "2023"
    startPosition = 1
    limit = 100

Returns:
    str: The response text from the E-Stat API.

Inputs: search_word (required), surveyYears (required), limit, startPosition.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation3/5

    Most tools have distinct purposes, but search_e_stat_tables and get_e_stat_data_catalog both accept similar search parameters and return resource information, which could cause confusion. The descriptions help somewhat, but the boundary between 'tables' and 'data catalog' is subtle.

    Naming Consistency4/5

    The naming follows a consistent verb_e_stat_noun pattern, e.g., search_e_stat_tables, get_e_stat_meta_info, get_e_stat_data_catalog. However, get_specific_e_stat_data inserts 'specific' in the middle, and get_e_stat_ref_dataset uses the abbreviation 'ref', breaking the pattern slightly.

    Tool Count5/5

    Five tools is a well-scoped count for an e-Stat API wrapper, covering the main read operations without unnecessary bloat. Each tool serves a clear step in the data discovery and retrieval workflow.

    Completeness3/5

    The set covers search, metadata, dataset reference, and data retrieval, but get_specific_e_stat_data lacks parameters for specifying classification codes or other conditions, which is a significant limitation when trying to extract precise data. Additionally, the overlap between search_e_stat_tables and get_e_stat_data_catalog could be consolidated.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for Japan's e-Stat (Government Statistics Portal). Search statistical datasets, retrieve data tables, and access metadata from official Japanese government statistics.
      55 PyPI
      10
      Apache 2.0
    • A
      license
      B
      quality
      B
      maintenance
      MCP server for the Japan National Tax Agency Corporate Number API, enabling corporate number lookup and search via local AI clients.
      3
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server for searching Japanese government procurement notices via the Kanpou API. Enables LLMs to search by date, keyword, or detailed criteria.
      3
      1
      MIT