Skip to main content
Glama

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/sse
Initialized 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 ...

なぜ?

つまり、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/sse
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

この SSE ベースの MCP サーバーを使用すると、ユーザーは National Weather Service API に接続して対話し、気象警報や予報を取得できます。

  1. 使用法
    1. なぜ?
      1. Smithery経由でインストール
      2. サーバ
      3. クライアント

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      This is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)
      Last updated -
      Python
      • Linux
      • Apple
    • A
      security
      A
      license
      A
      quality
      An MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.
      Last updated -
      1
      Python
      MIT License
      • Linux
      • Apple
    • -
      security
      F
      license
      -
      quality
      An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
      Last updated -
      Python
      • Linux
      • Apple
    • -
      security
      A
      license
      -
      quality
      An MCP server that connects to OpenWeatherMap's API to provide current weather data and multi-day forecasts for locations worldwide in different measurement units.
      Last updated -
      12
      TypeScript
      MIT License

    View all related MCP servers

    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/sidharthrajaram/mcp-sse'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server