weather
Provides an LLM with tools to retrieve US National Weather Service forecasts and active alerts, enabling natural-language answers about current conditions.
README
Weather Tool Calling with Cline and MCP
A small Python MCP server that lets an LLM fetch real weather data.
The user asks a weather question in Cline. The LLM decides whether to call a weather tool, generates the required arguments, and sends the request to this server. The server fetches data from the US National Weather Service (NWS), then the LLM uses the result to write the final answer.
How it works
User question
-> Cline sends the question and tool definitions to the LLM
-> The LLM selects a weather tool and generates its arguments
-> Cline calls the Python MCP server
-> The server fetches real data from api.weather.gov
-> The LLM turns the tool result into a natural-language answer
Tech stack
- Python 3.14
- MCP Python SDK
- Cline as the MCP client and LLM host
- OpenRouter with a DeepSeek model for the demo
- HTTPX
- US National Weather Service API
- uv
Tools
get_forecast
Gets the next five forecast periods for a US location.
{
"latitude": 40.7128,
"longitude": -74.006
}
get_alerts
Gets active weather alerts for a US state.
{
"state": "NY"
}
Setup
Requirements:
- Python 3.14
- uv
- Visual Studio Code with Cline
- An API key for a tool-capable LLM configured in Cline
Install the project:
git clone <https://github.com/yang648557392/weather-mcp-tool-calling.git>
cd weather
uv sync
Add the MCP server to Cline's MCP settings. Replace the path with the absolute path to this project:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/weather", "run", "weather.py"],
"disabled": false
}
}
}
Restart the MCP server in Cline. Cline should discover get_forecast and
get_alerts automatically.
If Cline cannot find uv, replace "uv" with the absolute path returned by:
which uv
Usage
Ask Cline a question such as:
What will the weather be like in New York tomorrow?
Are there any active weather alerts in California?
Cline will show the selected tool, its arguments, the tool result, and the LLM's final response.
Limitations
- The NWS API only supports locations covered by the United States weather service.
- The LLM is responsible for converting a location name into coordinates.
- Cline is required as the LLM host and MCP client.
- Provider API keys are stored in Cline and must not be committed to this repository.
Author
Mingzhe Yang
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。