Skip to content

ryanRfox/mcp-typescript-sdk

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

MCP Weather Server - Production Deployment Guide

Deploy the MCP weather server to Render.com and integrate with Claude Web for live weather data in AI conversations.

Prerequisites

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)

Deployment Process

1. Push Weather Server to GitHub

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

2. Deploy to Render.com

Create New Web Service

  1. Go to Render.com and sign in
  2. Click "New +" β†’ "Web Service"
  3. Connect your GitHub repository: your-username/mcp-typescript-sdk
  4. Select branch: weather-render

Service Configuration

  • 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

Environment Variables (Optional)

The weather server uses sensible defaults, but you can customize:

  • NODE_ENV: production (automatically set by Render)
  • MCP_AUTH_PORT: Custom auth port (optional)

3. Verify Deployment

Health Check

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"]
  }
}

MCP Endpoint

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}

Claude Web Integration

Configure Weather Server Connector

  1. Navigate to Claude Web:

    • Go to https://claude.ai
    • Click Settings β†’ Connectors
  2. Add Custom Connector:

    • Click "Add custom connector" (bottom of Connectors section)
    • Server URL: https://your-weather-app.onrender.com/mcp
    • Click "Add"
  3. Test Connection:

    • Should show "Connected" status
    • Connector appears in your connectors list

Test Weather Tools with Claude Web

  1. Start New Conversation:

    • Click "Search and tools" button (lower left)
    • Enable your weather server connector
  2. 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?"
    
  3. 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)
    
  4. Test Error Handling:

    "Get weather alerts for London" (should explain US-only coverage)
    "Weather forecast for Paris, France" (coordinates outside US)
    

Expected Claude Web Behavior

Successful Weather Alerts

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...

Successful Weather Forecasts

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...

Production Considerations

Performance & Reliability

  • 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

Monitoring & Debugging

  • 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

Security & Best Practices

  • 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

Troubleshooting

Deployment Issues

  • 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

Claude Web Connection Issues

  • 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

Weather Data Issues

  • 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

Common Solutions

  • 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

Usage Examples

Real-World Claude Web Conversations

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]

About

The official TypeScript SDK for Model Context Protocol servers and clients

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.6%
  • JavaScript 1.4%