Weather MCP Server
Provides real-time weather forecasts and alerts by fetching data from the National Weather Service API, allowing Claude to answer weather-related questions with up-to-date information.
README
Weather MCP Server
This project implements a Model Context Protocol (MCP) server that provides real-time weather forecasts and alerts. It is built using the Python MCP SDK and the National Weather Service (NWS) API. The server fetches data (forecasts, alerts, observations, etc.) from the NWS API and exposes them as MCP tools that AI assistants (e.g. Claude) can call. In short, it allows you to ask Claude questions like “What are the weather alerts in CA?” or “What’s the forecast for 37.77, -122.42?”, and the server will return up-to-date information.
Prerequisites
- Python 3.11 or higher. The Python MCP SDK requires a recent Python version.
- uv package manager. This lightweight tool manages Python dependencies and can run scripts. (Install it via
curl -LsSf https://astral.sh/uv/install.sh | shon macOS/Linux or using PowerShell on Windows, or viapipx install uv.) - MCP Python SDK and HTTP library. We'll install these with
uvbelow.
Setup / Installation
-
Clone the repository (or download the code):
git clone https://github.com/Danii2020/weather-mcp.git cd weather -
Install dependencies with
uv. In the project directory, run:uv add mcp[cli] httpxThis installs the Python MCP SDK (
mcp[cli]) and an HTTP client (httpx) used by the server. -
(Optional) If your project includes a
pyproject.tomlor other dependencies, you can install them similarly. But the above command covers the core libraries needed.
Running the Server
Start the weather MCP server by running:
uv run weather.py
This will launch the server (using uv to manage the environment). The terminal will print status messages. Keep this process running to serve requests.
Note: If you run into issues, make sure you have activated the correct Python environment and that
uvis in your PATH.
Configuring Claude for Desktop
To let Claude for Desktop use this weather server, you must add it as an MCP server in Claude’s config.
-
Platform support: Claude Desktop is available for macOS and Windows only (Linux is not supported).
-
Config file location: Find or create the file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Open
claude_desktop_config.jsonin a text editor. Add an entry under"mcpServers"for the weather tool. For example:{ "mcpServers": { "weather": { "command": "/full/path/to/uv", "args": ["run", "weather.py"], "cwd": "/full/path/to/weather" } } }- Replace
/full/path/to/uvwith the absolute path of theuvexecutable. You can find this by runningwhich uvon macOS or Linux, orwhere uvon Windows. - Replace
/full/path/to/weatherwith the full path to theweatherproject directory on your machine.
- Replace
-
Save the file and restart Claude for Desktop. In Claude, open the Developer settings and ensure the “weather” server appears under available MCP servers. You can now select it in your conversation.
Usage Examples
Once the server is running and Claude is configured, you can ask Claude to use the weather tools. For example:
- Weather Alerts: Ask “What are the current weather alerts in CA?” (the server’s
get_alertstool will fetch alerts from NWS). - Forecast: Ask “What’s the 5-day forecast for latitude 47.6, longitude -122.3?” (the server’s
get_forecasttool will retrieve the forecast).
Claude will display the results returned by the server. You can experiment with different state codes or coordinates as needed.
Video Tutorial
For a step-by-step walkthrough, watch the author’s YouTube tutorial “Learn MCP from Scratch and Build an MCP Server with Python!” at https://youtu.be/Pu5Q2dDwR9w. The video shows how to set up uv, code the server, and connect it to Claude Desktop.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。