# Testing Guide for Weather MCP Server
This guide explains how to test all 5 MCP tools on your deployed Render server.
## ๐ Deployed Server
**URL:** https://weather-mcp-server-67ou.onrender.com
## ๐ ๏ธ Available Tools
1. **get_current_weather** - Real-time weather conditions
2. **get_weather_forecast** - Multi-day forecasts (1-16 days)
3. **get_weather_alerts** - Weather warnings and alerts
4. **get_growing_conditions** - Agricultural data (GDD, soil metrics)
5. **get_historical_weather** - Historical weather statistics
---
## ๐ Test Methods
### Method 1: Browser Testing (Recommended) ๐
**File:** `test-sse.html`
**How to use:**
1. Open `test-sse.html` in your browser
2. The page automatically connects to your Render server
3. Use the buttons to test each tool:
**Available Tests:**
- โ๏ธ **Current Weather** - Get real-time weather for any city
- ๐
**7-Day Forecast** - Get week-long weather forecast
- โ ๏ธ **Weather Alerts** - Check for weather warnings
- ๐ **Historical Data** - Get past weather data (up to 10 years)
- ๐พ **Growing Conditions** - Get agricultural metrics (GDD, soil data)
**Example: Test Historical Weather for Manila (3 years)**
1. City: `Manila`
2. Month: Leave empty (uses current month) or enter `10` for October
3. Years back: `3`
4. Click "Historical Data"
---
### Method 2: Node.js Testing ๐ป
**File:** `test-render.js`
**Run:**
```bash
node test-render.js
```
**What it tests:**
1. โ
Health Check
2. โ
Server Info
3. โ
Current Weather (Manila)
4. โ
7-Day Forecast (Manila)
5. โ
Weather Alerts (Manila)
6. โ
Growing Conditions (Manila, base temp 10ยฐC)
7. โญ Historical Weather (Manila, current month, 3 years)
**Sample Output:**
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weather MCP Server Test - Render Deployment
URL: https://weather-mcp-server-67ou.onrender.com
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. Health Check
Testing server connectivity...
โ Success
Status: ok
Transport: SSE
Active Connections: 0
...
7. Historical Weather (Manila, 3 years) โญ
Tool: get_historical_weather
Parameters: month=10 (October), years_back=3
โ Success
Location: Manila, PH
Month: October
Years Retrieved: 3
Year 2024:
Avg Temperature: 27.5ยฐC
Max Temperature: 32.1ยฐC
Min Temperature: 24.2ยฐC
Total Precipitation: 245.3 mm
Avg Wind Speed: 12.4 km/h
Days in Month: 31
```
---
### Method 3: Bash/cURL Testing ๐ง
**File:** `test-render.sh`
**Run:**
```bash
chmod +x test-render.sh
./test-render.sh
```
**What it does:**
- Tests health check endpoint
- Tests server info endpoint
- Shows example cURL commands for all tools
- Provides instructions for full testing
---
## ๐งช Manual Testing with cURL
### Test 1: Current Weather
```bash
curl -X POST "https://weather-mcp-server-67ou.onrender.com/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_current_weather",
"arguments": {
"city": "Manila",
"country": "PH"
}
}
}'
```
### Test 2: Weather Forecast (7 days)
```bash
curl -X POST "https://weather-mcp-server-67ou.onrender.com/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_weather_forecast",
"arguments": {
"city": "Manila",
"country": "PH",
"days": 7
}
}
}'
```
### Test 3: Weather Alerts
```bash
curl -X POST "https://weather-mcp-server-67ou.onrender.com/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_weather_alerts",
"arguments": {
"city": "Manila",
"country": "PH"
}
}
}'
```
### Test 4: Growing Conditions
```bash
curl -X POST "https://weather-mcp-server-67ou.onrender.com/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "get_growing_conditions",
"arguments": {
"city": "Manila",
"country": "PH",
"base_temp": 10
}
}
}'
```
### Test 5: Historical Weather (Manila, October, 3 years) โญ
```bash
curl -X POST "https://weather-mcp-server-67ou.onrender.com/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "get_historical_weather",
"arguments": {
"city": "Manila",
"country": "PH",
"month": 10,
"years_back": 3
}
}
}'
```
---
## ๐ Understanding the Responses
### Historical Weather Response Structure
```json
{
"location": "Manila, PH",
"timezone": "Asia/Manila",
"month": "October",
"years_retrieved": 3,
"historical_data": [
{
"year": 2024,
"month": "October",
"statistics": {
"avg_temperature": "27.5ยฐC",
"max_temperature": "32.1ยฐC",
"min_temperature": "24.2ยฐC",
"total_precipitation": "245.3 mm",
"avg_wind_speed": "12.4 km/h"
},
"days_in_month": 31
}
// ... more years
]
}
```
### Growing Conditions Response Structure
```json
{
"location": "Manila, PH",
"timezone": "Asia/Manila",
"current_conditions": {
"air_temperature": "28.5ยฐC",
"relative_humidity": "75%",
"soil_temperature": "26.2ยฐC",
"soil_moisture": "0.35 mยณ/mยณ"
},
"growing_metrics": {
"growing_degree_days": "18.50 GDD (base 10ยฐC)",
"avg_solar_radiation": "245.67 W/mยฒ",
"description": "Conditions favorable for plant growth"
},
"measured_at": "2024-10-15T10:00:00"
}
```
---
## ๐ Troubleshooting
### SSE Session Required Error
If you get a "Session not found" error with cURL:
- This is expected for SSE transport
- **Solution:** Use the browser test (`test-sse.html`) which properly handles SSE connections
- Or use the Node.js test (`test-render.js`)
### Connection Timeout
If the request times out:
- The Render free tier may spin down after inactivity
- First request might take 30-60 seconds to wake up the server
- Subsequent requests will be fast
### CORS Errors (Browser)
- The server has CORS enabled with `Access-Control-Allow-Origin: *`
- If you still get CORS errors, check that you're using HTTPS (not HTTP)
---
## โ
Quick Start
**For the fastest testing experience:**
1. **Browser Test (Visual):**
```
Open test-sse.html in your browser
```
2. **Node.js Test (Comprehensive):**
```bash
node test-render.js
```
3. **Bash Test (Quick Check):**
```bash
./test-render.sh
```
---
## ๐ Notes
- All tests use Manila, Philippines as the default city
- Historical weather uses the current month by default
- Growing conditions use 10ยฐC as the default base temperature
- All timestamps are in the location's local timezone
- Weather codes are automatically translated to human-readable descriptions
Happy testing! ๐