Content
# Weather MCP Server
Real-time weather query MCP server, developed based on the HelloAgents framework.
## Features
- 🌤️ Real-time weather query
- 🌍 Supports 12 major cities
- 🔄 Uses wttr.in API (no key required)
- 🚀 Based on HelloAgents framework
## Installation
```bash
pip install hello-agents requests
```
## Usage
### Direct Run
```bash
python server.py
```
### Usage in Claude Desktop
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
```json
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}
```
### Usage in HelloAgents
```python
from hello_agents import SimpleAgent, HelloAgentsLLM
from hello_agents.tools import MCPTool
agent = SimpleAgent(name="Weather Assistant", llm=HelloAgentsLLM())
weather_tool = MCPTool(server_command=["python", "server.py"])
agent.add_tool(weather_tool)
response = agent.run("What's the weather like in Beijing today?")
```
## API Tools
### get_weather
Get the current weather for a specified city.
**Parameters:**
- `city` (string): City name (supports English and Chinese)
**Example:**
```json
{
"city": "Beijing"
}
```
**Return:**
```json
{
"city": "Beijing",
"temperature": 10.0,
"feels_like": 9.0,
"humidity": 94,
"condition": "Light rain",
"wind_speed": 1.7,
"visibility": 10.0,
"timestamp": "2025-10-09 13:25:03"
}
```
### list_supported_cities
List all supported cities.
**Return:**
```json
{
"cities": ["Beijing", "Shanghai", "Guangzhou", "Shenzhen", "Hangzhou", "Chengdu", "Chongqing", "Wuhan", "Xi'an", "Nanjing", "Tianjin", "Suzhou"],
"count": 12
}
```
### get_server_info
Get server information.
**Return:**
```json
{
"name": "Weather MCP Server",
"version": "1.0.0",
"tools": ["get_weather", "list_supported_cities", "get_server_info"]
}
```
## Supported Cities
Beijing, Shanghai, Guangzhou, Shenzhen, Hangzhou, Chengdu, Chongqing, Wuhan, Xi'an, Nanjing, Tianjin, Suzhou
Also supports querying global cities using English city names.
## License
MIT License
## Author
HelloAgents Team