MCP Weather
MCP 天気サーバー
AccuWeather API を使用して時間ごとおよび毎日の天気予報を提供するモデル コンテキスト プロトコル (MCP) サーバー。
クイックスタート
AccuWeather API キーが必要です (無料レベルあり)。
ここでサインアップしてアプリを作成し、キーを取得してください。
API キーを環境変数としてエクスポートします。
export ACCUWEATHER_API_KEY=your_api_key_here次に、次のコマンドで MCP Weather サーバーを直接実行します。
npx -y @timlukahorstmann/mcp-weatherまたは、スーパーゲートウェイ経由の HTTP/REST アクセスの場合:
npx -y supergateway --stdio "npx -y @timlukahorstmann/mcp-weather" \
--port 4004 \
--baseUrl http://127.0.0.1:4004 \
--ssePath /messages \
--messagePath /message \
--cors "*" \
--env ACCUWEATHER_API_KEY="$ACCUWEATHER_API_KEY"Related MCP server: Weather MCP Server
MCP サーバー設定例
Claude Desktop またはその他の MCP 互換クライアントと統合するには、これを構成に追加します (例: claude_desktop_config.json )。
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "@timlukahorstmann/mcp-weather"],
"env": {
"ACCUWEATHER_API_KEY": "your_api_key_here"
}
}
}
}概要
このMCPサーバーは、Claudeのような大規模言語モデルがリアルタイムの気象データにアクセスすることを可能にします。LLMと統合することで、モデルは以下のことが可能になります。
正確で最新の天気予報を取得します
今後12時間の1時間ごとの天気データを提供する
最大15日間の毎日の天気予報にアクセス
データをメートル法(°C)とヤードポンド法(°F)の両方で表示します
気温、天候、降水量情報、その他の天気の詳細を表示します
前提条件
Node.js ≥18
AccuWeather API キー (
.envまたはシェル経由で設定)
設定
このリポジトリをクローンします:
git clone https://github.com/TimLukaHorstmann/mcp-weather.git cd mcp-weather依存関係をインストールします:
npm installAccuWeather API キーを取得します。
AccuWeather APIに登録する
新しいアプリを作成し、APIキーを取得する
API キーを使用して
.envファイルを作成します。ACCUWEATHER_API_KEY=your_api_key_hereプロジェクトをビルドします。
npm run build
Claude Desktopでの使用
この MCP サーバーを使用するように Claude Desktop を構成します。
クロードデスクトップを開く
設定 > 開発者 > 設定の編集に移動します
claude_desktop_config.jsonに以下を追加します。
{ "mcpServers": { "weather": { "command": "npx", "args": ["-y", "@timlukahorstmann/mcp-weather"], "env": { "ACCUWEATHER_API_KEY": "your_api_key_here" } } } }Claudeデスクトップを再起動します
新しい会話で、プラグアイコンをクリックして「天気」を選択し、MCPサーバーを有効にします。
次のような天気予報をクロードに尋ねることができるようになりました。
「ニューヨーク市の1時間ごとの天気予報はどうですか?」
「ロンドンの5日間の天気予報をください。」
「今週の東京の天気は華氏でどうなりますか?」
「明日サンフランシスコは雨が降りますか?」
利用可能なツール
1時間ごとの天気予報
ツール名:
weather-get_hourly今後12時間の1時間ごとの予報を提供します
パラメータ:
sessionId(必須): セッションの一意の識別子location(必須): 市または場所の名前units(オプション): 「メートル法」(摂氏、デフォルト)または「帝国法」(華氏)
毎日の天気予報
ツール名:
weather-get_daily最大15日間の毎日の予報を提供します
パラメータ:
sessionId(必須): セッションの一意の識別子location(必須): 市または場所の名前days(オプション):予測日数(1、5、10、または15。デフォルトは5)units(オプション): 「メートル法」(摂氏、デフォルト)または「帝国法」(華氏)
発達
開発依存関係をインストール:
npm installコードをLintする:
npm run lintビルド:
npm run buildテストを実行:
npm test開発モードで起動:
npm run dev
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
将来の機能強化
MCP Weather Server は常に改善に取り組んでいます。今後のリリースで検討している機能は以下のとおりです。
拡張時間別予報: 12 時間を超える、たとえば 24 時間または 48 時間。
気象警報: AccuWeather の悪天候警報 API との統合。
**場所のオートコンプリート:**オートコンプリートの提案による場所の検索が改善されました。
**過去の気象データ:**過去の気象状況にアクセスできます。
他の機能についてのアイデアがある場合は、お気軽に問題を報告してください。
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。
Available Tools
2 toolsweather-get_dailyA
Get daily weather forecast for up to 15 days
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | The city or location for which to retrieve the weather forecast. | |
| days | No | Number of days to forecast (1, 5, 10, or 15). Default is 5. | |
| units | No | Temperature unit system (metric for Celsius, imperial for Fahrenheit). Default is metric. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the behavioral transparency burden. It communicates a read-only forecast lookup via 'Get' and adds the 15-day maximum, but it does not disclose response shape, potential errors, timezone behavior, or whether any authentication is needed. For a simple read operation this is acceptable but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words. It front-loads the verb and resource and immediately gives the key constraint of 15 days.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple weather lookup with three fully documented parameters, the description is largely complete and an agent can invoke the tool correctly. The only notable gap is that there is no output schema and the description does not hint at the shape of the returned forecast payload.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%: location, days, and units are all clearly documented in the input schema. The description adds no additional parameter meaning, which is acceptable because the structured schema already handles the documentation fully.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the action ('Get'), the resource ('daily weather forecast'), and the scope ('up to 15 days'). This clearly distinguishes it from the sibling tool weather-get_hourly without requiring any additional inference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The word 'daily' and the tool name imply that this is for day-level forecasts rather than hourly ones, which is useful context. However, the description does not explicitly state when to use this tool versus weather-get_hourly or provide any exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
weather-get_hourlyA
Get hourly weather forecast for the next 12 hours
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | The city or location for which to retrieve the weather forecast. | |
| units | No | Temperature unit system (metric for Celsius, imperial for Fahrenheit). Default is metric. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It states the scope (hourly, next 12 hours) and implies a read-only operation, but does not mention return format, error behavior, or data source limitations. It is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no filler. It front-loads the core action and scope, making it easy for an agent to process quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter tool, the description is largely complete: it states the forecast type, granularity, and time window. It does not describe the return payload, but no output schema exists and the tool's purpose is straightforward enough that an agent can infer expected weather data fields.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are already documented in the schema. The description adds no additional parameter-level details beyond what the schema provides, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Get') and resource ('hourly weather forecast') with a clear time bound ('next 12 hours'). This clearly distinguishes it from the sibling tool weather-get_daily, which is for daily forecasts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The time range and 'hourly' granularity imply when to use this tool, but the description never explicitly names the alternative or states when to choose it instead. The guidance is present by inference, not direct instruction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
- First observed
weather-get_daily - First observed
weather-get_hourly
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one provides daily forecasts for up to 15 days, while the other provides hourly forecasts for the next 12 hours. There is no overlap in functionality, and an agent can easily differentiate between them based on the time granularity and forecast duration.
Both tools follow a consistent naming pattern with a prefix 'weather-' followed by a verb_noun structure (get_daily, get_hourly). This pattern is predictable and enhances readability, making it easy for agents to understand the tool's purpose at a glance.
With only 2 tools, the server feels under-scoped for a weather domain. While the tools cover forecast retrieval, there are obvious gaps such as current weather conditions, historical data, or location-based searches, making the set too thin for comprehensive weather-related tasks.
The tool surface is severely incomplete for a weather server. It lacks essential operations like getting current weather, searching locations, or accessing historical data, which are core to weather applications. Agents will face dead ends when trying to perform basic weather queries beyond forecasts.
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.1-
- AlicenseBqualityCmaintenanceA Model Context Protocol server that provides weather information and forecasts based on user location or address input.612 npm8MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides real-time weather data and forecasts for any city.17 npmISC
- FlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that interfaces with OpenWeatherMap API to provide real-time weather information and forecasts for cities worldwide.-