MCP Weather Server
MCP用の SSE ベースのサーバーとクライアント
これは、SSEベースのMCPサーバーと、それらのツールを使用するスタンドアロンMCPクライアントの動作パターンを示しています。こちらでの元の議論に基づいています。
使用法
注意: ANTHROPIC_API_KEYを.envまたは環境変数として必ず指定してください。
uv run weather.py
uv run client.py http://0.0.0.0:8080/sseInitialized SSE client...
Listing tools...
Connected to server with tools: ['get_alerts', 'get_forecast']
MCP Client Started!
Type your queries or 'quit' to exit.
Query: whats the weather like in Spokane?
I can help you check the weather forecast for Spokane, Washington. I'll use the get_forecast function, but I'll need to use Spokane's latitude and longitude coordinates.
Spokane, WA is located at approximately 47.6587° N, 117.4260° W.
[Calling tool get_forecast with args {'latitude': 47.6587, 'longitude': -117.426}]
Based on the current forecast for Spokane:
Right now it's sunny and cold with a temperature of 37°F and ...Related MCP server: Weather MCP Server
なぜ?
つまり、MCPサーバーは、エージェント(クライアント)がいつでもどこでも接続、使用、切断できる実行中のプロセスとして機能します。言い換えれば、SSEベースのサーバーとクライアントは、分離プロセス(場合によっては分離ノード上)として機能します。これは、クライアント自身がサーバーをサブプロセスとして生成するSTDIOベースのパターンとは異なり、「クラウドネイティブ」なユースケースに適しています。
Smithery経由でインストール
Smithery経由で Claude Desktop 用の SSE ベースのサーバーとクライアントを自動的にインストールするには:
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claudeサーバ
weather.pyは、SSE ベースの MCP サーバーで、国立気象局 API に基づいたツールを提供しています。MCP ドキュメントのSTDIO サーバー実装例を参考にしています。
デフォルトでは、サーバーは 0.0.0.0:8080 で実行されますが、次のようなコマンドライン引数で構成可能です。
uv run weather.py --host <your host> --port <your port>クライアント
client.py 、SSE ベースの MCP サーバーに接続し、そのツールを使用する MCP クライアントです。MCP ドキュメントのSTDIO クライアント実装例を参考にしています。
デフォルトでは、クライアントは次のようにコマンドライン引数で指定された SSE エンドポイントに接続します。
uv run client.py http://0.0.0.0:8080/sseTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
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
- FlicenseBqualityDmaintenanceAn MCP server that provides weather information and alerts for US locations using the National Weather Service API, enabling retrieval of weather forecasts and active weather alerts.2-
- FlicenseNot gradedqualityDmaintenanceProvides weather information tools based on the National Weather Service APIs through an SSE-based MCP server that can run as a standalone process or Docker container.-
- AlicenseNot gradedqualityDmaintenanceAn SSE-based MCP server for retrieving real-time weather data for a specified location, supporting current conditions and forecasts.7MIT
- AlicenseBqualityDmaintenanceMCP server that integrates the National Weather Service API to fetch weather alerts for US states and forecasts for coordinates.25 npm1MIT