Deploy the MCP weather server to Render.com and integrate with Claude Web for live weather data in AI conversations.
Development:
- Node.js 18+ (tested with v22.17.1)
- npm or equivalent package manager
Deployment:
- Render.com account to host MCP Server (free tier available)
- GitHub repository (public) to host this code (accessed by Render)
Testing and Use:
- Claude Pro, Max, Team, or Enterprise plan (for custom connectors)
Ensure your weather-render
branch is pushed to GitHub:
git add -A
git commit -m "Add production configuration for weather server deployment"
git push origin weather-render
- Go to Render.com and sign in
- Click "New +" β "Web Service"
- Connect your GitHub repository:
your-username/mcp-typescript-sdk
- Select branch:
weather-render
- Name:
mcp-weather-server
(or your preferred name) - Root Directory: Leave blank
- Environment:
Node
- Region: Choose closest to your location
- Branch:
weather-render
- Build Command:
npm install && npm run build
- Start Command:
npm start
The weather server uses sensible defaults, but you can customize:
NODE_ENV
:production
(automatically set by Render)MCP_AUTH_PORT
: Custom auth port (optional)
Once deployed, verify at your Render URL:
https://your-weather-app.onrender.com/
Expected Response:
{
"status": "healthy",
"service": "mcp-weather-server",
"version": "1.0.0",
"transport": "streamable-http",
"endpoints": {
"mcp": "/mcp"
},
"weather": {
"source": "US National Weather Service",
"coverage": "United States",
"tools": ["get-alerts", "get-forecast"]
}
}
Your weather server MCP endpoint:
https://your-weather-app.onrender.com/mcp
Test with curl:
curl -X POST https://mcp-typescript-sdk.onrender.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}}'
Expected response:
event: message
id: 55b5fa4a-9c54-4356-bdec-d6e0345d9eef_1755831917468_eznt0ncr
data: {"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"prompts":{"listChanged":true},"completions":{},"resources":{"listChanged":true}},"serverInfo":{"name":"simple-streamable-http-server","version":"1.0.0"}},"jsonrpc":"2.0","id":1}
-
Navigate to Claude Web:
- Go to
https://claude.ai
- Click Settings β Connectors
- Go to
-
Add Custom Connector:
- Click "Add custom connector" (bottom of Connectors section)
- Server URL:
https://your-weather-app.onrender.com/mcp
- Click "Add"
-
Test Connection:
- Should show "Connected" status
- Connector appears in your connectors list
-
Start New Conversation:
- Click "Search and tools" button (lower left)
- Enable your weather server connector
-
Test get-alerts Tool:
"Are there any weather alerts for California?" "Check for severe weather warnings in Texas" "What weather alerts are active in Florida?"
-
Test get-forecast Tool:
"What's the weather forecast for San Francisco?" (37.7749, -122.4194) "Get the 7-day forecast for New York City" (40.7128, -74.0060) "Weather forecast for Denver, Colorado" (39.7392, -104.9903) "What's the weather like in Miami?" (25.7617, -80.1918)
-
Test Error Handling:
"Get weather alerts for London" (should explain US-only coverage) "Weather forecast for Paris, France" (coordinates outside US)
Claude should return formatted responses like:
πͺοΈ **Active Weather Alerts for CA** (3 alerts found)
π¨ **HIGH WIND WARNING**
π Area: Northeast Siskiyou and Northwest Modoc Counties
β° Effective: 1/15/2024, 10:00:00 AM PST
β Expires: 1/15/2024, 10:00:00 PM PST
π΄ Severity: Severe
π High Wind Warning until TUE 10 PM PST...
Claude should return formatted responses like:
π€οΈ **7-Day Weather Forecast**
π Location: 37.7749Β°N, 122.4194Β°W
π’ NWS Office: San Francisco Bay Area
**Today - Monday**
β
Partly Cloudy
π‘οΈ High: 72Β°F
π¨ Wind: W 10-15 mph
π Partly cloudy with temperatures in the low 70s...
**Tonight**
π Clear
π‘οΈ Low: 58Β°F
π¨ Wind: W 5-10 mph
π Clear skies with overnight lows in the upper 50s...
- Free Tier: May spin down after 15 minutes of inactivity
- Cold Start: First request after spin-down may take 30-60 seconds
- Uptime: Consider upgrading to paid plan for production use
- Rate Limiting: NWS API allows ~300 requests/hour
- Health Endpoint: Monitor
/
for service status - Render Logs: View weather server logs in Render dashboard
- API Errors: Weather tools include comprehensive error messages
- Network Issues: Tools handle timeouts and API unavailability
- HTTPS: Automatically provided by Render.com
- CORS: Configured to accept requests from
claude.ai
- API Keys: No API keys required (using public NWS API)
- Rate Limiting: Built-in request timeouts and error handling
- Build Failures: Check Node.js version (18+) and dependencies
- Start Failures: Verify
npm start
points to correct weather server file - Port Binding: Ensure server reads
process.env.PORT
correctly
- Connection Failed: Verify health check endpoint is accessible
- Tools Not Available: Check connector is enabled in conversation
- CORS Errors: Ensure server accepts requests from
claude.ai
domain
- No Alerts: Some states may have no active weather alerts (normal)
- Forecast Unavailable: Coordinates may be outside US coverage area
- API Timeouts: National Weather Service API may be temporarily slow
- 503 Service Unavailable: Weather server may be spinning up (free tier)
- Invalid Coordinates: Verify coordinates are within US (lat: 24-71Β°N, lon: 170-65Β°W)
- Connection Timeout: Try again after a few moments
Example 1: Travel Planning
User: "I'm planning a trip to San Francisco this weekend. What's the weather forecast?"
Claude: [Uses get-forecast tool with SF coordinates, returns 7-day forecast]
User: "Are there any weather alerts I should know about in California?"
Claude: [Uses get-alerts tool for CA, returns any active alerts]
Example 2: Emergency Preparedness
User: "Check for severe weather warnings in Florida and Texas"
Claude: [Uses get-alerts tool for both FL and TX, compares alerts]
User: "What's the weather forecast for Miami coordinates 25.7617, -80.1918?"
Claude: [Uses get-forecast tool, returns detailed Miami forecast]
Example 3: Multi-Location Comparison
User: "Compare weather forecasts for Denver and Seattle"
Claude: [Uses get-forecast tool for both cities, presents comparison]