Weather MCP Tool
Claudeデスクトップ用天気MCPツール
Claude Desktop 用に特別に設計された、OpenWeatherMap API を使用してリアルタイムの気象データ、予報、気象履歴情報を提供する MCP (Model Context Protocol) ツールです。
チュートリアル
このツールの設定と使用に関する詳細なガイドについては、包括的な Medium チュートリアルをご覧ください: チュートリアル: Claude Desktop と Weather MCP ツールを使って世界中のリアルタイム気象データにアクセスする
Related MCP server: weather-mcp-server
特徴
あらゆる場所のリアルタイムの気象状況
天気予報(最大5日間)
過去の気象データ(過去5日間)
大気質情報
気象警報と注意報
場所検索機能
設定
Python 3.10以降がインストールされていることを確認してください
依存関係をインストールします:
pip install -r requirements.txtOpenWeatherMapからAPIキーを取得する(無料版あり)
注: 新しいAPIキーが有効になるまでに最大24時間かかる場合があります
API キーの環境変数を設定します (推奨方法):
プロジェクトディレクトリに
.envファイルを作成するAPIキーをファイルに追加します: GXP2
機密データのコミットを防ぐために、
.gitignoreファイルに.envを追加します。
環境変数を使用するように
main.pyを更新します。# Add these imports at the top import os from dotenv import load_dotenv # Load environment variables load_dotenv() # Replace the API_KEY line with API_KEY = os.getenv("OPENWEATHER_API_KEY")
Claude Desktopとの統合
次の内容を MCP 構成に追加して、Claude Desktop で MCP 設定を構成します。
{
"mcpServers": {
"weather-mcp": {
"command": "py",
"args": ["-3.13", "C:\\Path\\To\\Your\\Weather-MCP-ClaudeDesktop\\main.py"]
}
}
}パスをmain.pyファイルへのフルパスに置き換えます。
次を使用してサーバーを実行します。
py -3.13 main.pyClaude Desktop の使用中はサーバーを実行したままにしてください
利用可能なツール
1. 現在の天気を取得する
特定の場所のリアルタイムの気象状況を取得します。
{
"location": {
"name": "New York",
"country": "US",
"lat": 40.7128,
"lon": -74.006
},
"temperature": {
"current": 25.6,
"feels_like": 26.2,
"min": 23.4,
"max": 27.8
},
"weather_condition": {
"main": "Clear",
"description": "clear sky",
"icon": "01d"
},
"wind": {
"speed": 3.6,
"deg": 220
},
"clouds": 5,
"humidity": 65,
"pressure": 1015,
"visibility": 10000,
"sunrise": "2025-03-16T06:12:34",
"sunset": "2025-03-16T18:04:23",
"timestamp": "2025-03-16T14:30:00"
}2. 天気予報を取得する
特定の場所の天気予報を取得します。
{
"location": {
"name": "London",
"country": "GB",
"lat": 51.5074,
"lon": -0.1278
},
"forecast": [
{
"datetime": "2025-03-16T15:00:00",
"temperature": {
"temp": 18.2,
"feels_like": 17.8,
"min": 17.5,
"max": 19.1
},
"weather_condition": {
"main": "Rain",
"description": "light rain",
"icon": "10d"
},
"wind": {
"speed": 4.2,
"deg": 180
},
"clouds": 75,
"humidity": 82,
"pressure": 1010,
"visibility": 8000,
"pop": 0.4
}
// ... more forecast items
],
"days": 5
}3. 空気の質を調べる
特定の場所の空気質データを取得します。
{
"location": {
"name": "Beijing",
"country": "CN",
"lat": 39.9042,
"lon": 116.4074
},
"air_quality_index": 3,
"air_quality_level": "Moderate",
"components": {
"co": 250.34,
"no": 0.5,
"no2": 15.2,
"o3": 140.8,
"so2": 5.1,
"pm2_5": 8.2,
"pm10": 12.3,
"nh3": 0.7
},
"timestamp": "2025-03-16T14:30:00"
}4. 過去の天気を取得する
特定の日付の過去の気象データを取得します。
{
"location": {
"name": "Paris",
"country": "FR",
"lat": 48.8566,
"lon": 2.3522
},
"date": "2025-03-14",
"temperature": {
"temp": 20.3,
"feels_like": 19.8
},
"weather_condition": {
"main": "Clouds",
"description": "scattered clouds",
"icon": "03d"
},
"wind": {
"speed": 2.8,
"deg": 150
},
"clouds": 45,
"humidity": 60,
"pressure": 1012,
"visibility": 10000,
"sunrise": "2025-03-14T06:30:45",
"sunset": "2025-03-14T18:15:22",
"timestamp": "2025-03-14T12:00:00"
}5. 検索場所
名前で場所を検索:
{
"results": [
{
"name": "Tokyo",
"state": "",
"country": "JP",
"lat": 35.6762,
"lon": 139.6503
},
{
"name": "Tokyo",
"state": "Tokyo",
"country": "JP",
"lat": 35.6895,
"lon": 139.6917
}
// ... more results
]
}6. 天気予報を取得する
特定の場所の天気警報を取得します。
{
"location": {
"name": "Miami",
"country": "US",
"lat": 25.7617,
"lon": -80.1918
},
"alerts": [
{
"sender": "NWS Miami",
"event": "Heat Advisory",
"start": "2025-03-16T12:00:00",
"end": "2025-03-16T20:00:00",
"description": "Heat index values between 105 and 110 expected",
"tags": ["Extreme temperature value"]
}
// ... more alerts if any
],
"alert_count": 1
}サンプルクエリ
Claude Desktop に次のような質問をすることができます:
「ニューヨークの現在の天気はどうですか?」
「ロンドンの5日間天気予報を見せて」
「今日の北京の空気の質はどうですか?」
「3月14日のパリの天気はどうでしたか?」
「「東京」という名前の場所を検索」
「マイアミに気象警報はありますか?」
「シカゴ、マイアミ、シアトルの現在の天気を比較する」
「北京、ロサンゼルス、デリーの空気の質の比較を見せてください」
エラー処理
すべてのツールには適切なエラー処理が組み込まれており、何か問題が発生した場合にはエラー メッセージを返します。
{
"error": "Failed to fetch current weather for InvalidLocation: Location not found"
}トラブルシューティング
Claude Desktop で MCP サーバーが動作していない場合:
サーバーが実行中であることを確認してください。スクリプトを開始すると出力が表示されます。
設定のパスが正しく絶対パスであることを確認してください
Python 3.10+がシステムPATHにあることを確認してください
すべての依存関係がインストールされていることを確認する
Claude Desktopを再起動してみてください
ログにエラーメッセージがないか確認する
一般的なAPIの問題
APIキーの有効化: 新しいOpenWeatherMap APIキーの有効化には最大24時間かかる場合があります
無効なAPIキーエラー: 401エラーが発生した場合は、APIキーが正しくアクティブであることを確認してください。
レート制限: 無料枠では 1 分あたり最大 60 回の通話が許可されますが、使用量が多すぎると超過する可能性があります。
レート制限
このツールはOpenWeatherMap APIを使用していますが、レート制限があります。無料プランでは1分あたり最大60回の呼び出しが許可されており、個人利用には十分です。ただし、リクエスト頻度が高すぎる場合は、APIによって処理が制限される場合がありますのでご注意ください。
ライセンス
MITライセンス
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Global weather via Open-Meteo: forecast, ERA5 archive, marine, air quality, geocoding, elevation.
Current weather and forecasts for any coordinates, backed b… — paid per call (x402/credits), 1 tools
Real-time weather conditions and multi-day forecasts via Open-Meteo — free, no API key required
Global weather API: forecasts, historical data, marine, ski, astronomy and timezone.
Related MCP Servers
- AlicenseAqualityDmaintenanceIntegrates the OpenWeather API with Claude to provide real-time weather updates, 5-day forecasts, and air quality data. It enables users to query current conditions, pollution levels, and coordinate-based weather information directly within their conversations.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Desktop to query real-time weather information, forecasts, and history via the OpenWeatherMap API.1398MIT
- FlicenseNot gradedqualityDmaintenanceEnables real-time weather queries via Claude Desktop using OpenWeatherMap API, providing current conditions and 24-hour forecasts for any city.22-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to query real-time weather information for specified regions using the OpenWeatherMap API.13MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SaintDoresh/Weather-MCP-ClaudeDesktop'
If you have feedback or need assistance with the MCP directory API, please join our Discord server