Skip to main content
Glama

japan-gov-mcp

Japanese government API integration for MCP (Model Context Protocol). 36 APIs through 14 tools with intelligent code resolution, data joining, and contextual analysis.

日本の中央省庁APIを統合するMCPサーバー。36のAPIを14ツール・78アクションで操作可能。

Features

  • 14 tools / 78 actions — government statistics (e-Stat), corporate data, weather, legislation, geospatial, academic resources, and more

  • Code resolution — natural language "東京の出生率" auto-resolves to API parameters

  • Data joining — multiple sources joined on time/area axis with unit normalization

  • Contextual analysis — "this value is in the Nth percentile over the past 30 years"

  • AI suggestions — context-aware next-step recommendations

  • 1,918 municipalities + 10,669 EDINET entities built-in static dictionaries

  • 663 tests / 0 FAIL — including Codex AI user simulation tests

Related MCP server: MCP Statistics Server

Quick Start

Install

git clone https://github.com/Rei02061986/japan-gov-mcp.git
cd japan-gov-mcp
npm install
npm run build

Environment Variables

# Required (enables core statistics features)
export ESTAT_APP_ID=your_estat_app_id    # https://www.e-stat.go.jp/api/

# Optional (enable additional APIs as needed)
export HOUJIN_APP_ID=...     # Corporate number API
export GBIZ_TOKEN=...        # gBizINFO
export EDINET_API_KEY=...    # EDINET financial filings
export MLIT_DPF_API_KEY=...  # MLIT Data Platform
export REALESTATE_API_KEY=...# Real estate information
export HELLOWORK_API_KEY=... # HelloWork job listings

Many tools work without any API keys: weather, legislation, geospatial, academic search, BOJ statistics, NDB health data, and more.

Claude Desktop Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "japan-gov": {
      "command": "node",
      "args": ["/path/to/japan-gov-mcp/build/index.js"],
      "env": {
        "ESTAT_APP_ID": "your_estat_app_id"
      }
    }
  }
}

Tools

Data Retrieval (Tools 1-9)

#

Tool

Description

Key APIs

1

estat

Government statistics search/retrieval

e-Stat API

2

stats

Economic indicators, BOJ, NDB health

Statistics Dashboard, BOJ, NDB

3

corporate

Corporate information

Corporate Number, gBiz, EDINET

4

weather

Weather and disaster prevention

JMA, J-SHIS, flood/river data

5

law

Legislation and parliamentary records

e-Laws, Diet minutes, public comments

6

geo

Geospatial data

GSI geocoding, PLATEAU 3D city models

7

academic

Academic and cultural resources

NDL, J-STAGE, CiNii, JapanSearch

8

opendata

Open data catalogs

data.go.jp, G-space

9

misc

Other government data

Travel safety, procurement, real estate, land prices, jobs

Analysis Layer (Tools 10-14)

#

Tool

Description

Key Actions

10

resolve

Code resolution and ID bridging

code_lookup, entity_bridge, area_bridge, time_bridge

11

navigate

Data catalog exploration

recommend, schema, coverage

12

join

Data joining and normalization

fetch_aligned, normalize, fill_gaps

13

context

Contextual analysis and suggestions

percentile, peers, trend_context, annotate, suggest

Usage Examples

Declining Birthrate Analysis (4 steps)

1. navigate.recommend("少子化")
   → Recommends: birthrate, marriage rate, childcare waiting lists

2. resolve.area_bridge(all prefectures)
   → Unified area codes across APIs

3. join.fetch_aligned([birthrate, land_prices])
   → Joined table for 47 prefectures

4. context.annotate(joined_table)
   → Tokyo: worst rank, Okinawa: #1, alerts for historic lows + next-step suggestions

Cross-API Corporate Lookup

resolve.entity_bridge("トヨタ自動車")
→ { corporateNumber: "2180001...", edinetCode: "E02144", gbizAvailable: true }

Historical Context for a Statistic

context.percentile({ source: "estat", indicator: "出生率", value: 1.20, area: "13" })
→ { percentile: 3.2, rank: "46/47", alert: "過去最低水準", historicalRange: "1.20-2.14" }

API Coverage

No API Key Required

Category

APIs

Statistics

Statistics Dashboard, BOJ Time Series, NDB Health Data

Weather

JMA Forecast, Typhoon, AMeDAS, J-SHIS Seismic Hazard, Flood/River

Legislation

e-Laws, Diet Minutes, Public Comments

Geospatial

GSI Geocoding, Geoshape Boundaries, PLATEAU 3D

Academic

NDL, J-STAGE, CiNii, JapanSearch, AgriKnowledge

Science

Soramame Air Quality, Geological Survey, JAXA Satellite

Government

Travel Safety, Diet Minutes, Procurement

Catalog

data.go.jp, G-Space

API Key Required

API

Provider

Env Variable

Registration

e-Stat

Ministry of Internal Affairs

ESTAT_APP_ID

https://www.e-stat.go.jp/api/

Corporate Number

National Tax Agency

HOUJIN_APP_ID

https://www.houjin-bangou.nta.go.jp/webapi/

gBizINFO

METI

GBIZ_TOKEN

https://info.gbiz.go.jp/hojin/api

EDINET

FSA

EDINET_API_KEY

https://disclosure2.edinet-fsa.go.jp/

MLIT Data Platform

MLIT

MLIT_DPF_API_KEY

https://www.mlit-data.jp/

Real Estate

MLIT

REALESTATE_API_KEY

https://www.reinfolib.mlit.go.jp/

HelloWork

MHLW

HELLOWORK_API_KEY

https://www.hellowork.mhlw.go.jp/

All API keys are free to obtain.

Testing

npm test             # Unit tests (421)
npm run test:e2e     # E2E tests (242)
npm run test:all     # All tests (663)

Logging

All tool calls are automatically logged in JSONL format.

# Most called tools
cat ~/.japan-gov-mcp/logs/*.jsonl | jq -r .tool | sort | uniq -c | sort -rn

# Errors only
cat ~/.japan-gov-mcp/logs/*.jsonl | jq 'select(.status=="error")'

Disable logging: JAPAN_GOV_MCP_LOG=false

Specification

For the complete technical specification, see SPEC-v3.3.md. Pass this file to another AI to give it full understanding of all 14 tools and 78 actions.

Development

npm run build       # TypeScript compile
npm run typecheck   # Type check only
npm test            # Run tests
npm run inspect     # MCP Inspector GUI

Data Sources and Credits

This project integrates data from the following Japanese government APIs. All data usage complies with each provider's terms of service.

License Framework

Most Japanese government APIs use one of these standard licenses:

License

CC BY 4.0 Compatible

Commercial Use

政府標準利用規約(第2.0版)

Yes

Yes

公共データ利用規約 PDL 1.0

Yes

Yes

Required Credits

The following credit statements are required when using data from these APIs:

e-Stat: このサービスは、政府統計総合窓口(e-Stat)のAPI機能を使用していますが、サービスの内容は国によって保証されたものではありません。

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

BOJ時系列統計: このサービスは、日本銀行時系列統計データ検索サイトのAPI機能を使用しています。サービスの内容は日本銀行によって保証されたものではありません。

法人番号: このサービスは、国税庁法人番号システムWeb-API機能を利用して取得した情報をもとに作成しているが、サービスの内容は国税庁によって保証されたものではない。

不動産情報ライブラリ: このサービスは、国土交通省不動産情報ライブラリのAPI機能を使用していますが、提供情報の最新性、正確性、完全性等が保証されたものではありません。

MLIT DPF: このサービスは、国土交通データプラットフォームのAPI機能を使用していますが、最新のデータを保証するものではありません。

Data Providers

Provider

API

License

総務省

e-Stat, 統計ダッシュボード

政府標準利用規約2.0 / PDL 1.0

日本銀行

BOJ時系列統計

独自規約

厚生労働省

NDBオープンデータ

PDL 1.0

国税庁

法人番号

独自規約

経済産業省/デジタル庁

gBizINFO

政府標準利用規約2.0

金融庁

EDINET

PDL 1.0

気象庁

天気予報, 地震・津波

政府標準利用規約2.0

防災科研

J-SHIS

独自規約

国土地理院

ジオコーディング, 浸水ナビ

GSI利用規約 (CC BY互換)

日本道路交通情報センター

JARTIC交通量

CC BY 4.0

デジタル庁

e-Laws法令API

政府標準利用規約2.0

国立国会図書館

国会会議録, NDLサーチ

PDL 1.0

e-Gov

パブリックコメント

政府標準利用規約2.0

国交省

PLATEAU, 不動産, DPF

PDL 1.0 / 独自

JST

J-STAGE

独自規約

NII

CiNii, IRDB, Geoshape

独自 / CC BY 4.0

国立国会図書館/文化庁

ジャパンサーチ

CC0 / CC BY 4.0

外務省

海外安全情報

PDL 1.0

環境省

そらまめくん

PDL 1.0

産総研

地質図Navi

政府標準利用規約2.0

JAXA

JAXA Earth API

独自規約

農研機構

AgriKnowledge

独自規約(非営利のみ)

中小企業庁

ミラサポplus

PDL 1.0

For the complete terms of use analysis, see REPORT-api-terms.md.

Disclaimer

  • This project is not affiliated with or endorsed by the Japanese government or any of its agencies.

  • All data is retrieved from publicly available government APIs. Accuracy, completeness, and availability are not guaranteed.

  • Government APIs may change, rate-limit, or discontinue without notice.

  • This software is provided "as is" — see LICENSE for details.

  • Do not use government statistics as the sole basis for critical decisions without verifying against official sources.

  • Data from each API is subject to that provider's terms of use. Users of this MCP server are responsible for complying with applicable terms when using the retrieved data.

本プロジェクトは日本政府・各省庁とは無関係の非公式ツールです。取得データの正確性・完全性・可用性は保証しません。政府APIは予告なく変更・停止される場合があります。重要な意思決定には必ず公式情報源を確認してください。各APIのデータはそれぞれの提供元の利用規約に従います。

License

MIT

Contributing

Pull requests welcome. Bug reports and feature requests via Issues.

Available Tools

97 tools
amedas_data

【気象庁】アメダス観測データ取得

Inputs: pointId (required), date.

amedas_stations

【気象庁】アメダス全観測所一覧

Inputs: no named parameters.

boj_major_statisticsA

【日本銀行】主要統計一覧取得。よく使われる時系列統計のコード一覧(APIキー不要)

Inputs: no named parameters.

boj_timeseries

【日本銀行】時系列統計データ取得。マネーストック・物価指数・為替レート等(APIキー不要・2026/2/18開始)

Inputs: seriesCode (required), format, toYear, fromYear, +1 more.

dashboard_data

【統計ダッシュボード】指標の時系列×地域データ取得(登録不要)

Inputs: indicatorCode (required), timeCdTo, regionCode, timeCdFrom.

dashboard_indicatorsC

【統計ダッシュボード】約6,000系列の統計指標を検索(登録不要)

Inputs: indicatorCode.

edinet_documentsB

【EDINET/金融庁】指定日の開示書類一覧(有報/四半報等)

Inputs: date (required), type.

estat_browse_indicators

【e-Stat/SSDS】社会・人口統計体系の指標コードをブラウズ。テーブルID/セクション/キーワードで検索。C2107(旧)→C2108(推奨)のような同概念別コードの発見に使用

Inputs: keyword, section, tableId, recommendedOnly.

estat_check_availability

【自治体分析】指標の利用可能性を事前チェック。市区町村/都道府県/全国レベルでのデータ取得可否、利用可能年次、代替手段を返す

Inputs: metricIds (required), granularity.

estat_compare_municipalities

【e-Stat/SSDS】複数自治体のSSDSデータを取得し派生指標(構成比・人口あたり率・ランキング)を自動計算。自治体間の横並び比較に最適

Inputs: codes (required), indicators (required), year, tableId.

estat_correlationA

【自治体分析】複数自治体データの指標間相関分析。ピアソン相関係数・解釈(強い/中程度/弱い/無相関)を算出。恣意性排除のため全ペアを表示

Inputs: data (required), metricKeys (required).

estat_data

【e-Stat】統計データ取得。時間・地域・分類で絞込可能

Inputs: statsDataId (required), lang, limit, cdArea, +4 more.

estat_merger_checkB

【自治体分析】市区町村合併の境界検知。平成の大合併(1999-2010)を中心に、時系列データが合併境界を跨ぐかチェックし警告を生成

Inputs: codes (required), years, listAll.

estat_meta

【e-Stat】統計表のメタ情報(項目定義・分類コード一覧)を取得

Inputs: statsDataId (required), lang.

estat_session_init

【自治体分析】分析セッション初期化。合併チェック・指標利用可能性・推奨コード提案を一括実行するプリフライト。分析前に必ず実行推奨

Inputs: codes (required), years, granularity, requestedMetrics.

estat_time_series

【e-Stat/SSDS】自治体の時系列データを整列取得。調査周期が異なる指標(5年毎の国勢調査 vs 毎年の財政データ)を±3年フォールバックで整列

Inputs: code (required), indicators (required), yearTo, yearFrom.

flood_depth

【浸水ナビ/国土地理院】指定座標の洪水浸水想定深さ・ハザード情報取得

Inputs: lat (required), lon (required), groupType.

gbiz_detail

【gBizINFO/経産省】法人番号で詳細情報取得。届出認定・補助金・特許・調達・財務・表彰・職場情報の7種別(GBIZ_TOKEN必須)

Inputs: infoType (required), corporateNumber (required).

geology_at_pointC

【産総研】指定地点の地質情報取得(APIキー不要)

Inputs: lat (required), lon (required).

geology_legendB

【産総研】シームレス地質図 凡例一覧(APIキー不要)

Inputs: no named parameters.

geoshape_cityC

【Geoshape】市区町村境界GeoJSON取得

Inputs: code (required).

geoshape_pref

【Geoshape】都道府県境界GeoJSON取得

Inputs: prefCode (required).

geospatial_dataset

【G空間情報センター】データセット詳細

Inputs: id (required).

geospatial_organizations

【G空間情報センター】組織一覧

Inputs: no named parameters.

gov_api_catalog

全API・全ツール一覧(カテゴリ・タグ・使用例付き)。どのツールが利用可能か確認

Inputs: category, includeMetadata.

gsi_geocode

【国土地理院】住所から緯度経度を検索(APIキー不要)

Inputs: address (required).

gsi_reverse_geocodeA

【国土地理院】緯度経度から住所を取得(APIキー不要)

Inputs: lat (required), lon (required).

jaxa_collections

【JAXA】衛星観測データコレクション一覧(APIキー不要)

Inputs: limit.

jma_earthquake

【気象庁】最近の地震情報一覧取得(APIキー不要)

Inputs: no named parameters.

jma_forecastC

【気象庁】天気予報取得(APIキー不要)

Inputs: areaCode (required).

jma_forecast_week

【気象庁】週間天気予報(7日間)取得

Inputs: areaCode (required).

jma_overview

【気象庁】天気概況取得(APIキー不要)

Inputs: areaCode (required).

jma_tsunami

【気象庁】津波情報・警報一覧取得(APIキー不要)

Inputs: no named parameters.

jma_typhoon

【気象庁】現在の台風情報・進路予報取得

Inputs: no named parameters.

jshis_hazardC

【防災科研】地震ハザード情報取得(APIキー不要)

Inputs: lat (required), lon (required).

kokkai_meetings

【国立国会図書館】国会会議録の会議一覧検索(本文なし, APIキー不要)

Inputs: any, from, until, speaker, +5 more.

kokkai_speeches

【国立国会図書館】国会会議録の発言検索(本文あり, APIキー不要)

Inputs: any, from, until, speaker, +5 more.

law_dataB

【法令API V2】法令本文取得(JSON, APIキー不要)

Inputs: lawId (required).

mirasapo_categories

【ミラサポplus/中小企業庁】業種・課題・行政サービス・施策のカテゴリマスタ取得(APIキー不要)

Inputs: type (required).

mirasapo_detailA

【ミラサポplus/中小企業庁】事例IDで詳細取得(背景・課題・成果・連絡先等)(APIキー不要)

Inputs: id (required).

mirasapo_regions

【ミラサポplus/中小企業庁】地方区分・都道府県マスタ取得(APIキー不要)

Inputs: no named parameters.

mlit_dpf_catalog

【国交省DPF】データカタログ詳細取得

Inputs: id (required).

msil_featuresB

【海しる/海上保安庁】指定レイヤのGeoJSON取得(※APIキー登録必要・実装保留中)

Inputs: layerId (required), bbox.

msil_layers

【海しる/海上保安庁】利用可能レイヤ一覧取得(※APIキー登録必要・実装保留中)

Inputs: no named parameters.

ndb_areas

【NDBオープンデータ】都道府県・二次医療圏の一覧を取得(APIキー不要)

Inputs: type.

ndb_hub_proxy

【NDB Hub】外部MCPプロキシ。NDB OpenData Hub の独自エンドポイントに自然言語クエリを送信(APIキー不要)

Inputs: query (required), gender, ageClass, indicator, +1 more.

ndb_inspection_statsB

【NDBオープンデータ】特定健診の検査統計データ取得(BMI・血圧・血糖等)。地域・性別・年齢で絞り込み可能(APIキー不要)

Inputs: itemName (required), page, gender, perPage, +5 more.

ndb_items

【NDBオープンデータ】利用可能な検査項目一覧を取得(APIキー不要)

Inputs: no named parameters.

ndb_range_labelsA

【NDBオープンデータ】検査項目の値範囲ラベル取得(例: BMI「18.5未満」「18.5以上25未満」等)(APIキー不要)

Inputs: itemName (required), gender.

odpt_bus_timetable

【ODPT/公共交通】バス時刻表取得(※APIキー登録必要・実装保留中)

Inputs: operator, busstopPole, busroutePattern.

odpt_railway_timetable

【ODPT/公共交通】鉄道時刻表取得(※APIキー登録必要・実装保留中)

Inputs: railway, station, operator.

opendata_detail

【デジタル庁】オープンデータ詳細・ダウンロードURL

Inputs: id (required).

plateau_citygml

【PLATEAU/国交省】メッシュコード指定でCityGML 3D都市モデル情報取得(APIキー不要)

Inputs: meshCode (required).

plateau_datasetsB

【PLATEAU/国交省】3D都市モデルデータセット検索。都道府県・市区町村・データ種別で絞込可能(APIキー不要)

Inputs: city, type, prefecture.

pubcomment_list

【e-Gov】パブリックコメント(意見募集/結果公示)RSS取得(APIキー不要)

Inputs: type, categoryCode.

realestate_landpriceC

【国土交通省】地価公示・地価調査(APIキー必要)

Inputs: year (required), area, city.

realestate_transactionsC

【国土交通省】不動産取引価格情報(APIキー必要)

Inputs: year (required), quarter (required), area, city.

resas_cities

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(市区町村別統計)またはmlit_dpf_search(地域データ)を使用すること

Inputs: prefCode (required).

resas_finance

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: dashboard_data(地方財政指標)またはestat_search(地方財政統計)を使用すること

Inputs: matter (required), cityCode (required), prefCode (required).

resas_industryA

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(経済センサス・工業統計)またはmlit_dpf_search(産業データ)を使用すること

Inputs: sicCode (required), cityCode (required), prefCode (required), simcCode (required).

resas_patentsA

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: jstage_search(学術特許検索)またはcinii_search(CiNii特許情報)を使用すること

Inputs: cityCode (required), prefCode (required).

resas_population

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(人口統計・統計コード00200521)またはdashboard_data(人口系指標)を使用すること

Inputs: cityCode (required), prefCode (required).

resas_population_pyramid

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(国勢調査・統計コード00200521)を使用すること

Inputs: cityCode (required), prefCode (required), yearLeft (required), yearRight (required).

resas_prefectures

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(地域統計)またはdashboard_data(統計ダッシュボード)を使用すること

Inputs: no named parameters.

resas_tourism

【RESAS】⚠️ DEPRECATED: RESAS APIは2025-03-24に提供終了。代替: estat_search(観光統計)またはjapansearch_search(文化観光情報)を使用すること

Inputs: prefCode (required), purpose.

researchmap_achievements

【researchmap/JST】研究者の業績情報(論文・受賞・研究分野等)取得(APIキー不要)

Inputs: permalink (required), achievementType (required), limit, start.

river_level

【河川水位】リアルタイム河川水位情報取得

Inputs: stationId (required).

safety_overseasC

【外務省】海外安全情報(XML, APIキー不要)

Inputs: regionCode, countryCode.

scenario_academic_trend

【シナリオ】学術研究トレンド分析。NDL + J-STAGE + CiNii + ジャパンサーチ + AgriKnowledge を横断検索(APIキー不要)

Inputs: keyword (required), limit, includeAgri.

scenario_academic_trend_by_topics

【シナリオ】分野別学術トレンド比較。複数のキーワードで並列検索し、分野ごとの文献数を比較(APIキー不要)

Inputs: topics (required), limit.

scenario_corporate_intelligence

【シナリオ】企業情報統合分析。法人番号 + gBizINFO + EDINET を統合して企業の基本情報・補助金・開示書類を一括取得

Inputs: gbizToken, companyName, houjinAppId, edinetApiKey, +1 more.

scenario_disaster_risk_assessment

【シナリオ】地域防災リスク評価。住所または座標から地震ハザード・浸水深・河川水位を統合評価(APIキー不要)

Inputs: lat, lon, address.

scenario_labor_demand_supply

【シナリオ】労働市場 需給分析。ハローワーク求人 + e-Stat労働力調査を統合(APIキー必要)

Inputs: prefectureCode (required), appId, occupation.

scenario_national_economy_summary

【シナリオ】全国経済サマリー。統計ダッシュボードから全国の主要経済指標を一括取得(APIキー不要)

Inputs: no named parameters.

scenario_realestate_demographics

【シナリオ】不動産×人口動態分析。不動産取引価格 + 地価公示 + 人口統計を統合して地域市場を分析

Inputs: city, year, quarter, prefecture, +1 more.

scenario_regional_economy_full

【シナリオ】地域経済総合分析。統計ダッシュボードGDP + 日銀マクロ + e-Stat産業統計 + 国交省DPF を統合

Inputs: prefectureCode (required), year, estatAppId, mlitDpfApiKey.

scenario_regional_health_economy

【シナリオ】地域医療×マクロ経済 統合分析。NDB健診データ + 統計ダッシュボード人口 + 日銀マクロ指標を1コールで取得

Inputs: prefectureCode (required), year.

soramame_air

【環境省】大気汚染リアルタイムデータ(そらまめくん)(APIキー不要)

Inputs: stationCode.

traffic_volume

【国交省/JARTIC】指定地点周辺の道路交通量データ取得

Inputs: lat (required), lon (required), count, radius.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects AI agents to 28 Brazilian public APIs, providing over 200 tools to access data on economy, legislation, transparency, and the judiciary. It enables complex queries and cross-referencing of government datasets like IBGE, the Central Bank, and the National Congress through natural language.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query Japanese public data (laws, corporations, statistics) from official government APIs, returning normalized English metadata with source attribution.
      1
      MIT