> ## Documentation Index
> Fetch the complete documentation index at: https://data.kushiro.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP endpoint

> read-only MCP server の最小利用メモ。

通常の HTTP 利用者は REST Reference と [Quickstart](quickstart) を使ってください。
LLM / agent client から公開データを読む用途として、read-only MCP endpoint も提供しています。

## Endpoint

```text theme={null}
POST https://data.kushiro.app/mcp
```

* Transport: Streamable HTTP
* Protocol: JSON-RPC 2.0
* Auth: なし
* Scope: read-only

## Tools

| Tool                | 用途                                                        |
| ------------------- | --------------------------------------------------------- |
| `list_sources`      | 公開中の source 一覧                                            |
| `get_source`        | 1 source の集計情報（metric ごとの件数・単位・期間範囲の内訳付き）                 |
| `query_metrics`     | 数値データの検索                                                  |
| `query_points`      | 施設・地点系データの検索                                              |
| `aggregate_metrics` | 数値データの facet 集計（町別・年齢別・期間別などの sum / avg / latest / delta） |
| `aggregate_points`  | 施設・地点系データの facet 集計（category / 属性ごとの件数）                   |
| `points_near`       | 中心座標から半径内の地点を距離順で検索（`distance_m` 付き、cross-source 可）       |

各 tool の引数は `tools/list` が返す `inputSchema` を参照してください。`query_metrics` / `aggregate_metrics` は `metric` / `metric_prefix` / `from` / `to` / `town` / `age` / `category_kind` / `category_code` で絞り込めます。`query_points` / `aggregate_points` は `category` / `attribute_filter` / `name_contains` / `address_contains` / bounding box で絞り込めます。`query_points` はこれに加えて `external_id` でも絞り込めます。

## tools/list example

```sh theme={null}
curl https://data.kushiro.app/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

## Prompts

`prompts` capability で、釧路市データ固有の分析テンプレートを配信しています。
client から `prompts/list` で一覧、`prompts/get` で本文（収集すべきデータ・分析観点・注意事項・出力形式）を取得できます。

| Prompt                                     | 用途                 |
| ------------------------------------------ | ------------------ |
| `analyze_population_decline_structure`     | 人口減少の構造分析          |
| `rank_town_population_decline`             | 町別の人口減少ランキング       |
| `analyze_tourism_covid_impact`             | 観光入込客数の COVID 影響分析 |
| `analyze_fishery_long_term_trend`          | 水産取扱量の長期トレンド       |
| `assess_emergency_infrastructure_coverage` | 防災インフラのカバレッジ評価     |
| `analyze_fiscal_health_trend`              | 財政健全性のトレンド         |

```sh theme={null}
curl https://data.kushiro.app/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"prompts/list"}'
```

MCP endpoint は REST API reference とは別プロトコルです。HTTP client から普通にデータを読む場合は `/api/v1/*` を使ってください。
