MCP-Weather

by takatoshi-miura

Not rated
GitHub

About

Provides weather information using the Japan Meteorological Agency API. No authentication required.

Details

Author
takatoshi-miura
Categories
Other, API

Setup

Install MCP-Weather in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/takatoshi-miura/MCP-Weather

Follow the installation instructions in the repository README, then restart your MCP client.

mcp-weatherは、気象庁の天気予報API(livedoor 天気互換)を使用して、日本各地の天気情報を取得するMCPサーバーです。OAuth 2.0認証を使用したセキュアなアクセス制御により、Cloudflare Workersでリモートサーバーとしてデプロイ可能です。

- OAuth 2.0認証: セキュアなアクセス制御とトークンベース認証
- 豊富な気象データ: 天気概況、降水確率、風速情報を提供
- 全国対応: 主要都市の天気データを取得可能
- リモート対応: Cloudflare Workersにデプロイしてリモートサーバーとして利用可能
- モバイル対応: 標準的なOAuthフローでモバイルアプリからも利用可能

- 時間帯別(0-6時、6-12時、12-18時、18-24時)の降水確率
- 今日・明日・明後日の予報

札幌、青森、盛岡、仙台、秋田、山形、福島、水戸、宇都宮、前橋、さいたま、千葉、東京、横浜、新潟、富山、金沢、福井、甲府、長野、岐阜、静岡、名古屋、津、大津、京都、大阪、神戸、奈良、和歌山、鳥取、松江、岡山、広島、山口、徳島、高松、松山、高知、福岡、佐賀、長崎、熊本、大分、宮崎、鹿児島、那覇

{ "mcp-weather-local": { "command": "node", "args": ["/path/to/MCP-Weather/dist/server/local/index.js"] } }
# プロジェクトディレクトリで実行 node src/utils/update-token.cjs

- src/client/mcp-weather-remote.cjsACCESS_TOKENを更新

{ "mcp-weather-remote": { "command": "node", "args": ["/path/to/MCP-Weather/src/client/mcp-weather-remote.cjs"] } }
export MCP_WEATHER_TOKEN="your-token-here"
{ "mcp-weather-remote-debug": { "command": "node", "args": ["/path/to/MCP-Weather/src/client/mcp-weather-debug.cjs"] } }

- Cursorのログを確認

- Cursor > View > Output > MCP

MCP-Weather/ ├── src/ │ ├── server/ # サーバーサイド実装 │ │ ├── local/ # ローカルサーバー │ │ │ └── index.ts # ローカルMCPサーバー │ │ └── remote/ # リモートサーバー │ │ ├── worker.ts # Cloudflare Workers実装 │ │ └── auth.ts # OAuth認証サービス │ ├── client/ # クライアントサイド実装 │ │ ├── mcp-weather-remote.cjs # メインのMCPクライアント │ │ └── mcp-weather-debug.cjs # デバッグ版 │ └── utils/ # ユーティリティ │ ├── get-token.cjs # トークン取得スクリプト │ └── update-token.cjs # トークン自動更新スクリプト ├── dist/ # ビルド出力 │ └── server/ │ ├── local/ # ローカルサーバーのビルド出力 │ └── remote/ # リモートサーバーのビルド出力 ├── node_modules/ # 依存関係 ├── package.json # プロジェクト設定 ├── package-lock.json # 依存関係のロック ├── tsconfig.json # TypeScript設定(リモート用) ├── tsconfig.local.json # TypeScript設定(ローカル用) ├── wrangler.toml # Cloudflare Workers設定 └── README.md
# ローカルサーバーのビルド npm run build:local # ローカルサーバーの開発モード npm run dev:local # ローカルサーバーの型チェック npm run type-check:local

- KVストレージの作成 OAuth認証データを保存するためのKVネームスペースを作成します:

# 本番環境用 npx wrangler kv:namespace create "OAUTH_KV" # 開発環境用 npx wrangler kv:namespace create "OAUTH_KV" --preview

-

wrangler.tomlのKV IDを更新 作成したKVネームスペースのIDをwrangler.tomlに設定してください。

# ビルド npm run build # デプロイ npx wrangler deploy
# 開発モードで起動 npx wrangler dev # ビルド npm run build

- 設定完了後、Cursorを再起動
- 天気情報の取得

- Cursorで「東京の天気を教えて」と入力
- 自動的に適切なツールが呼び出されます
- 天気情報の取得

- Cursorで「東京の天気を教えて」と入力
- 自動的に適切なツールが呼び出されます

- クライアント作成:POST /oauth/client
- 認証開始:GET /oauth/authorize
- トークン取得:POST /oauth/token
- MCP API:POST /(Bearer認証)

- iOS: SFSafariViewController, ASWebAuthenticationSession
- Android: Chrome Custom Tabs, WebView
- React Native: react-native-app-auth
- Flutter: flutter_appauth

詳細な実装例は、プロジェクトのサーバー側コード(src/)を参照してください。

本サーバーは「天気予報 API(livedoor 天気互換)」(https://weather.tsukumijima.net/)を使用しています。このAPIは気象庁が配信している天気予報データをJSON形式で提供しています。

- 認証コード: 10分間の有効期限
- アクセストークン: 1時間の有効期限
- PKCE対応: モバイルアプリでのセキュアな認証
- クライアントシークレット: 安全に管理し、公開しないでください
- リダイレクトURI: 信頼できるドメインのみを設定してください
- アクセストークン: 適切に保護し、HTTPSでのみ送信してください

- APIのレスポンスが予期しないデータになった場合、エラーが発生する可能性があります
- 気象庁HPのAPI構造が変更された場合、サービスが停止する可能性があります
- 連続したAPIアクセスは避け、適切な間隔を空けてご利用ください
- OAuth認証のトークンは適切に管理し、第三者に漏洩しないよう注意してください

Provides weather data using the Open-Meteo API.

Access meteorological data for Portugal from the IPMA public API using natural language.

Provides accurate Islamic prayer times for locations throughout Malaysia using the waktusolat.app API.

Provides real-time weather information and forecasts using the OpenWeatherMap API.

A production-clean MCP server for the free Open-Meteo weather API (geocoding, forecast, air quality) with SRE-grade rate limiting, backoff, and structured logging.

Provides current weather information using the Korea Meteorological Administration's short-term forecast API.

SkyLinkAPI MCP Server | Aviation Data MCP Server

Connect SkyLink API to Claude Desktop, Cursor, or any MCP client in under a minute. Ask about live flights, weather, NOTAMs, and ADS-B positions — your AI gets real data, not hallucinations.

A server for fetching weather information in Japan.

Provides current weather data and forecasts using the QWeather API.

An API for AI models to fetch weather data.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.