Skip to main content
Glama
jp-statistics-mcp

jp-statistics-mcp

by koizumikento

jp-statistics-mcp

統計ダッシュボードの指標と、日本銀行の時系列統計を調べるMCPサーバーです。MCP、CLI、Pythonライブラリから同じ機能を使えます。

準備 · MCP登録 · CLI · Python · 移行手順

準備

Python 3.12以上、uv、Gitが必要です。

git clone https://github.com/koizumikento/jp-statistics-mcp.git
cd jp-statistics-mcp
uv sync --locked

APIキーは不要です。

Related MCP server: estat-mcp

MCPクライアントに登録する

設定例の /absolute/path/to/jp-statistics-mcp をクローン先の絶対パスに置き換えます。Windowsでは C:/projects/jp-statistics-mcp のように書けます。

Codex

codex mcp add jp-statistics-mcp -- uv --directory "/absolute/path/to/jp-statistics-mcp" run --locked jp-statistics-mcp
codex mcp list

新しいセッションで /mcp を開いて接続状態を確認します。

Claude Desktop / Cursor

Claude DesktopはOSに応じて次のファイルに設定します。

  • Windowsは %APPDATA%/Claude/claude_desktop_config.json

  • macOSは ~/Library/Application Support/Claude/claude_desktop_config.json

Cursorはプロジェクト内の .cursor/mcp.json を使います。mcpServers に次の項目を追加し、クライアントを再起動してください。

{
  "mcpServers": {
    "jp-statistics-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/jp-statistics-mcp",
        "run",
        "--locked",
        "jp-statistics-mcp"
      ]
    }
  }
}

uv が見つからない場合は、command に実行ファイルの絶対パスを指定してください。

ツール

データごとの入力条件、結果、出典と利用条件は、表のリンク先に記載しています。

ツール

データと操作の説明

search_indicators

統計ダッシュボード

get_indicator_data

統計ダッシュボード

search_regions

統計ダッシュボード

search_terms

統計ダッシュボード

search_social_events

統計ダッシュボード

search_surveys

統計ダッシュボード

search_series

日本銀行の時系列統計

get_series_data

日本銀行の時系列統計

get_multiple_series_data

日本銀行の時系列統計

get_series_data_by_layer

日本銀行の時系列統計

CLIで使う

クローン先で実行します。取得結果はUTF-8のJSONとして標準出力に書き出します。

uv run jp-statistics-mcp dashboard search-indicators --query 総人口 --limit 3
uv run jp-statistics-mcp boj search-series --database fm08 --query ドル --limit 3

引数の説明は、各サブコマンドに --help を付けて確認できます。

Pythonで使う

自分のPythonプロジェクトの依存関係に追加します。

uv add "git+https://github.com/koizumikento/jp-statistics-mcp.git@main"

次のコードを example.py に保存し、uv run python example.py で実行します。

import asyncio

from jp_statistics_mcp import search_indicators

result = asyncio.run(search_indicators(query="総人口", limit=3))
print(result)

ツールと同じ名前の非同期関数を利用できます。すでにイベントループがある場合は、直接 await してください。

出典と利用条件

コードはMITライセンスです。データは実行時に各提供元から取得します。取得データには、データ別の説明に記載した提供元の利用条件が適用されます。

開発

uv sync --locked
uv run ruff check .
uv run ty check
uv run pytest
uv build

Available Tools

10 tools
get_indicator_dataC
Read-onlyIdempotent

Get series data. Cycles: 1 month, 2 quarter, 3 calendar year, 4 fiscal year.

Inputs: indicator_code (required), cycle, limit, offset, +1 more. Returns: object

get_multiple_series_dataB
Read-onlyIdempotent

Fetch up to 250 codes from one DB and one frequency. Resume from NEXTPOSITION.

Inputs: database (required), end_period (required), series_codes (required), start_period (required), +1 more. Returns: object

get_series_dataB
Read-onlyIdempotent

Fetch observations for one BOJ series. Periods are YYYY or YYYYMM by frequency.

Inputs: database (required), end_period (required), series_code (required), start_period (required), +1 more. Returns: object

get_series_data_by_layerC
Read-onlyIdempotent

Fetch observations by comma-separated layer path (e.g. '1,2,*'). Resume from NEXTPOSITION.

Inputs: layer (required), database (required), frequency (required), end_period (required), +2 more. Returns: object

search_indicatorsB
Read-onlyIdempotent

Find indicator codes by Japanese or English text in the indicator name.

Inputs: query (required), limit, offset. Returns: object

search_regionsA
Read-onlyIdempotent

Find region codes by name, kana reading or code. Omit query to browse.

Inputs: limit, query, offset. Returns: object

search_seriesB
Read-onlyIdempotent

Find series by Japanese name, English name or code within a BOJ database.

Inputs: query (required), database (required), limit, offset. Returns: object

search_social_eventsC
Read-onlyIdempotent

Find social events by name or code, with their periods and statistical categories.

Inputs: limit, query, offset. Returns: object

search_surveysA
Read-onlyIdempotent

Find statistical surveys by name or code, with agency, summary and reference link.

Inputs: limit, query, offset. Returns: object

search_termsB
Read-onlyIdempotent

Find statistical terms by name or code and read definitions and reference links.

Inputs: limit, query, offset. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 10 tools

    Disambiguation3/5

    The six search_* tools are cleanly separated by entity (indicator, region, term, social event, survey, series), but the data-fetch tools overlap: get_series_data, get_multiple_series_data, get_series_data_by_layer and get_indicator_data all sound like 'get time series data' and only the descriptions reveal that two are BOJ-series based and two are e-Stat layer/indicator based. The shared word 'series' across both e-Stat and BOJ tools invites misselection.

    Naming Consistency4/5

    All tools are snake_case with a verb_noun shape (search_*, get_*_data), so the pattern is predictable. Minor deviations: get_series_data_by_layer and get_multiple_series_data are longer qualified variants, and get_indicator_data lacks the 'series/indicator' symmetry with its siblings.

    Tool Count4/5

    Ten tools is a well-scoped count for a server spanning two data sources (e-Stat catalog entities plus BOJ series). Each tool maps to a distinct entity or fetch mode, with no obviously redundant entries.

    Completeness3/5

    There is search coverage for indicators, regions, terms, events, surveys and BOJ series plus data retrieval, but gaps remain: no tool to enumerate available databases/layers (the layer path required by get_series_data_by_layer and the 'one DB' required by get_multiple_series_data must come from outside the toolset), and no metadata/definition lookup for a BOJ series beyond the name search. Pagination via NEXTPOSITION is handled for only two of the fetch tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Enables access to Japan's official government statistics portal (e-Stat) API to search, retrieve, and analyze statistical data including census data, economic indicators, and demographic information across 17 statistical fields.
      13
      MIT
    • 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.
      39 PyPI
      10
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables searching Bank of Japan time-series statistics series by name or series code and retrieving time-series data for a specified series code and period through the official BOJ statistics API.
      MIT