MCP.so
ログイン

MCP US Weather Client/Server

@ankitmishralive

基本情報

カテゴリ

開発者ツール

トランスポート

stdio

作者

ankitmishralive

MCP US Weather Client/Server について

A simple MCP (Model Context Protocol) server that provides weather alert information for US states, leveraging the National Weather Service (NWS) API. It also includes an example client application that demonstrates how to interact with the MCP server using the mcp_use library.

MCP US Weather Client/Server の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "Hands-on-MCP": {
      "command": "uv",
      "args": [
        "run",
        "mcp",
        "dev",
        "server/weather.py"
      ]
    }
  }
}

MCP US Weather Client/Server のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is MCP US Weather Client/Server?

This repository contains a simple MCP (Model Context Protocol) server that provides weather alert information for US states by leveraging the National Weather Service (NWS) API. It also includes an example client application demonstrating how to interact with the MCP server using the mcp_use library and Langchain.

How to use MCP US Weather Client/Server?

Clone the repository, install dependencies with uv add -r requirements.txt, and create a .env file with your Groq API key. Start the server with uv run mcp dev server/weather.py and the client with uv run server/client.py. At the client prompt, type queries such as "Get weather alerts for CA, NY or NJ" and use exit, quit, or clear to manage the conversation.

Key features of MCP US Weather Client/Server

  • Fetches active weather alerts for any US state
  • Built using the fastmcp library for MCP server implementation
  • Includes a client with conversation memory
  • Integrates with Langchain for LLM interaction
  • Provides a get_alerts tool and get_config resource
  • Uses the public National Weather Service API (api.weather.gov)

Use cases of MCP US Weather Client/Server

  • Query weather alerts for one or multiple US states via natural language
  • Learn how to build and run an MCP server with fastmcp
  • Explore MCP client integration with Langchain and conversation memory
  • Demonstrate a full MCP ecosystem with a real-world public API

よくある質問

1

What tools and resources does the server expose?

The server exposes a `get_alerts` tool for fetching weather alerts by state and a `get_config` resource. These are defined in both the `weather.py` file and the `weather.json` configuration file.

2

What are the prerequisites and dependencies?

Python 3.7+, `uv` for dependency management, a Groq API key for the client, and the `mcp_use` library. The server itself connects to the public NWS API with no required authentication.

3

How do I configure the server and client?

Create a `.env` file in the root directory with `GROQ_API_KEY=<your_key>`. Ensure the `server/weather.json` file matches the tool and resource definitions in `server/weather.py`.

4

How do I run the server and client?

Start the server with `uv run mcp dev server/weather.py` and the client with `uv run server/client.py`. The client runs in an interactive prompt.

5

What data does the server use and where does it come from?

All weather alert data is fetched live from the National Weather Service API (api.weather.gov). No data is stored locally by the server.

コメント

「開発者ツール」の他のコンテンツ