MCP US Weather Client/Server
@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 対応クライアントに追加してください。
{
"mcpServers": {
"Hands-on-MCP": {
"command": "uv",
"args": [
"run",
"mcp",
"dev",
"server/weather.py"
]
}
}
}ツール
ツールは検出されませんでした
ツールは 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
fastmcplibrary for MCP server implementation - Includes a client with conversation memory
- Integrates with Langchain for LLM interaction
- Provides a
get_alertstool andget_configresource - 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
FAQ from MCP US Weather Client/Server
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.
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.
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.
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.
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.
「開発者ツール」の他のコンテンツ
JetBrains MCP Proxy Server
JetBrainsA model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio
MCP-Bridge
SecretiveShellA middleware to provide an openAI compatible endpoint that can call MCP tools
Burp Suite MCP Server Extension
PortSwiggerMCP Server for Burp
Deepwiki MCP Server
regenrek📖 MCP server for fetch deepwiki.com and get latest knowledge in Cursor and other Code Editors
Hello World MCP Server (Reference Extension)
anthropicsDesktop Extensions: One-click local MCP server installation in desktop apps
コメント