Japan Fuel Price Mcp

io.github.atushi1841v0.1.0Updated Oct 4, 2026

Japan fuel prices by prefecture (METI weekly data). Tools: current, history, cheapest.

VerifiedSTDIODesktop onlyData & AnalyticsFinance

Overview

AI-generated overview

Lets an assistant look up Japanese weekly retail fuel prices by prefecture, including latest prices, history and cheapest-prefecture rankings.

What it does
Provides official METI weekly retail price data for gasoline, diesel and kerosene across Japan's 47 prefectures and nationwide. Tools cover the latest weekly average with week-over-week change and gasoline tax breakdown, weekly history with min/max/average, a cheapest-to-most-expensive prefecture ranking, multi-product national trends, and a list of queryable regions, products and units. Prefecture names are accepted in kanji, romaji or with the 都/府/県 suffix. Prices are tax-inclusive, in yen per litre for gasoline and diesel and yen per 18 litres for kerosene.
When to use it
Useful when an assistant needs current or historical Japanese fuel price figures, for example comparing prefectures, tracking weekly price movements, or supplying fuel cost inputs for budgeting, travel cost or macro analysis. It is a read-only statistics source, not a live station-level price feed or a purchasing tool. Skip it if you need prices outside Japan or real-time pump prices rather than the weekly METI survey.
Requirements
Runs as a local process over stdio, distributed as an mcpb package; desktop only, no web executable. The README's local development path needs Python 3 with pip and the requirements.txt dependencies (openpyxl for parsing XLSX), and network access to fetch the weekly METI XLSX file with a browser user agent. No accounts, API keys or environment variables are declared in the manifest; the README's optional Apify Standby deployment uses an APIFY_TOKEN bearer credential.
Before you install
The README shows an Apify Standby deployment example that uses an Authorization Bearer token (APIFY_TOKEN); that token is a credential and should be supplied only through the environment or header, never pasted into shared files. The server reads public METI statistics and does not write, send or delete user data, and no payment or wallet access is involved. Note that the manifest declares no authentication and no environment variables for the packaged local build, while the README's hosted path

Installation

In SourceWeft

  1. Open Japan Fuel Price Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Japan Fuel Price MCP — METI Weekly Gasoline / Diesel / Kerosene

MCPサーバー: 日本のガソリン・軽油・灯油の週次小売価格を、資源エネルギー庁(METI)公式統計XLSXからAIエージェントに提供します。

  • データソース: 資源エネルギー庁 給油所小売価格調査 公式XLSX(毎週更新、1990年〜の全国・都道府県別平均現金価格)
  • 利用規約: 政府標準利用規約2.0(出典明示で商用利用可)
  • 単位: ガソリン・軽油 = 円/L、灯油 = 円/18L(消費税込み)

Tools

Tool説明
get_latest_fuel_price(prefecture, product)指定都道府県(または全国)の最新週平均価格 + 前週比 + ガソリン税内訳
get_fuel_price_history(prefecture, product, weeks)週次履歴(都道府県は直近260週、全国は1990年〜)+ min/max/avg
cheapest_prefectures(product, limit)47都道府県 最安〜最高値ランキング
national_fuel_trend(products, weeks)全国平均の複数製品トレンド(インフレ/マクロ指標用)
list_fuel_regions()照会可能な地域(漢字+ローマ字)・製品・単位のリスト

prefecture は漢字・ローマ字・「都/府/県」付きのいずれでも可(東京 / tokyo / 東京都)。北海道・沖縄はMETI調査の局単位データを都道府県として提供。

動作

  1. 初回呼び出しで最新 YYMMDDs5.xlsx を取得(ブラウザUA必須)、openpyxlでパースしJSONキャッシュ化
  2. 以後6時間はキャッシュから即答、TTL切れで新週ファイルをチェック
  3. METIのレート制限/障害時はビルド時同梱のシードキャッシュ(data/fuel_prices.json)にフォールバック — ツールが500になることはない

MCP接続

Apify Standby モード(streamable HTTP):

https://api.apify.com/v2/acts/<ACTOR_ID>/mcpAuthorization: Bearer <APIFY_TOKEN>

ローカル開発

bash
pip install -r requirements.txtpython3 -m pytest tests/ -q          # 14 tests, network-stubbed, seed cachePORT=3999 python3 -m src.main &      # shim経由でApify SDK不要python3 tests/http_smoke.py http://localhost:3999/mcp

シード更新(週1回、木曜の公開後):

bash
python3 scripts/refresh_seed.py          # METIから取得して data/fuel_prices.json 再生成python3 scripts/refresh_seed.py path/to/YYMMDDs5.xlsx   # 手元DL分から生成(レート制限回避)git add data/fuel_prices.json && git commit -m "data: seed refresh" && git push

Deploy

GitHub連携 Apify Actor(usesStandbyMode, webServerMcpPath=/mcp)。push後にビルドAPIを叩く:

bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/builds?version=0.1&tag=latest&token=$APIFY_TOKEN"

出典表記

Source: Agency for Natural Resources and Energy (METI), Petroleum Products Price Survey. Government Standard Terms of Use 2.0.

Source: README.md at commit 7b804f4

Tools

0
Tool metadata has not been indexed yet.

Version history

1
  1. v0.1.0LatestOct 4, 2026