Skip to main content
Glama
e-stat-dashboard-mcp

e-stat-dashboard-mcp

by koizumikento
README.md
# e-stat-dashboard-mcp

統計ダッシュボードの公式APIを参照する読み取り専用のMCPサーバーです。Python 3.12以上とuv(0.13.4で検証)を使います。上流APIのキー設定は不要です。

## MCPクライアント設定

GitHubリポジトリへのアクセス権がある環境でクローンします。

```sh
git clone https://github.com/koizumikento/e-stat-dashboard-mcp.git
cd e-stat-dashboard-mcp
uv sync --locked
```

クライアントの設定に、クローン先の絶対パスを指定します。

```json
{
  "mcpServers": {
    "e-stat-dashboard-mcp": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/e-stat-dashboard-mcp", "run", "--locked", "e-stat-dashboard-mcp"]
    }
  }
}
```

## ツール

| ツール | 用途 |
| --- | --- |
| `search_indicators` | 指標名から系列コードを検索 |
| `get_indicator_data` | 系列コード、任意の地域・周期で統計値を取得 |

系列名を検索し、系列コードで数値を取得します。1回の返却件数は最大100件で、取得結果の続きはoffsetで指定します。

## CLI

```sh
uv run e-stat-dashboard-mcp search-indicators --query "総人口" --limit 1
uv run e-stat-dashboard-mcp get-indicator-data --indicator-code 0201010000000010000 --limit 1
```

結果は標準出力にUTF-8のJSONで出力します。コマンドの引数は `uv run e-stat-dashboard-mcp search-indicators --help` で確認できます。

## Pythonライブラリ

パッケージをインストールしたPython環境で、下記の非同期関数を直接呼び出せます。

```python
import asyncio

from e_stat_dashboard_mcp import search_indicators

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

公開関数 `search_indicators`、`get_indicator_data` を利用できます。イベントループがある環境では、関数を直接 `await` します。

## 出典と利用条件

コードはMIT Licenseです。取得するデータの権利と利用条件は、API提供元と各データ提供機関の定めに従います。[公式API仕様](https://dashboard.e-stat.go.jp/static/api) · [利用案内](https://dashboard.e-stat.go.jp/static/api)

このサービスは、統計ダッシュボードのAPI機能を使用していますが、サービスの内容は国によって保証されたものではありません。

## 開発

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

TDQS

B3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools serve clearly distinct purposes: one searches for indicator codes by text, the other fetches series data for a given indicator. There is no overlap in function, so misselection is unlikely.

Naming Consistency5/5

Both names follow a consistent verb_noun snake_case pattern (search_indicators, get_indicator_data). The terminology around 'indicator' is also consistent across both.

Tool Count3/5

Two tools is thin for a statistics dashboard server; search and data retrieval are covered, but discoverability or metadata tasks have no dedicated entry point. It is borderline rather than clearly mismatched, since the domain is narrow.

Completeness3/5

The core lookup-then-fetch workflow is covered, but there is no way to list available datasets, browse indicators without a text query, or retrieve metadata (units, definitions). These gaps are workable but notable for a data exploration server.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues