mcp-cloud-server

datavtar/mcp-cloud-server

3.2

If you are the rightful owner of mcp-cloud-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Cloud Server is a Model Context Protocol server designed to provide comprehensive weather tools and resources using Server-Sent Events (SSE) for real-time communication, optimized for deployment on Google Cloud Run.

Tools
16
Resources
0
Prompts
0

MCP Cloud Server

A Model Context Protocol (MCP) server built with FastMCP that exposes comprehensive weather tools, resources, and prompts via Server-Sent Events (SSE). Designed for deployment on Google Cloud Run.

Features

  • US Weather (NWS): Alerts, forecasts, hourly forecasts, current conditions, radar stations, hurricane tracking
  • Global Weather (Open-Meteo): Worldwide forecasts, air quality, UV index, marine conditions
  • Geocoding (Nominatim): Convert addresses to coordinates and vice versa
  • Utilities: Sunrise/sunset times, weather comparison, comprehensive summaries
  • MCP Resources: Weather glossary, station lists, national alert summaries
  • MCP Prompts: Travel weather, severe weather analysis, clothing recommendations, outdoor activity suitability
  • SSE Transport: Uses Server-Sent Events for real-time MCP communication
  • Cloud Run Ready: Configured for Google Cloud Run deployment

Quick Start

Local Development

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run server
python server.py

The server starts on http://localhost:8080 by default. Set the PORT environment variable to change it.

Docker Deployment

# Build image
docker build -t mcp-cloud-server .

# Run container
docker run -p 8080:8080 mcp-cloud-server

Google Cloud Run Deployment

Using the deploy script (recommended):

# Basic deployment
python gcp_deploy.py --project-id <PROJECT_ID>

# Custom region and service name
python gcp_deploy.py -p <PROJECT_ID> -r europe-west1 -s weather-mcp

# Redeploy without rebuilding
python gcp_deploy.py -p <PROJECT_ID> --skip-build

Or manually with gcloud:

# Build and push to Google Container Registry
gcloud builds submit --tag gcr.io/<PROJECT_ID>/mcp-server

# Deploy to Cloud Run
gcloud run deploy mcp-server \
    --image gcr.io/<PROJECT_ID>/mcp-server \
    --platform managed \
    --region <REGION> \
    --allow-unauthenticated

Replace <PROJECT_ID> with your GCP project ID and <REGION> with your preferred region (e.g., us-central1).

Testing with MCP Inspector

# Test local server
npx @modelcontextprotocol/inspector \
    npx -y @modelcontextprotocol/server-sse-client \
    --url http://localhost:8080/sse

# Test deployed server
npx @modelcontextprotocol/inspector \
    npx -y @modelcontextprotocol/server-sse-client \
    --url https://<SERVICE_URL>/sse

Replace <SERVICE_URL> with your Cloud Run service URL (e.g., mcp-server-xxxxx.us-central1.run.app).

MCP Tools

US Weather (NWS API)

ToolDescription
get_alertsGet weather alerts for a US state
get_forecastGet multi-day forecast for US location
get_hourly_forecastGet hourly forecast (next 24h)
get_current_conditionsGet current conditions from nearest station
get_radar_stationsList nearby radar stations
get_active_hurricanesGet active tropical storms/hurricanes

Global Weather (Open-Meteo)

ToolDescription
get_global_forecast7-day forecast (worldwide)
get_global_hourlyHourly forecast (worldwide)
get_air_qualityAir quality index and pollutants
get_uv_indexUV index current and forecast
get_marine_forecastWave height, direction, period

Geocoding (Nominatim)

ToolDescription
geocode_locationConvert place name/address to coordinates
reverse_geocodeConvert coordinates to address

Utilities

ToolDescription
get_sunrise_sunsetSunrise/sunset times for any date
compare_weatherCompare weather between two locations
get_weather_summaryComprehensive weather summary

MCP Resources

Resource URIDescription
weather://glossaryWeather terminology definitions
weather://stations/{state}List weather stations in a US state
weather://alerts/nationalSummary of all active US alerts

MCP Prompts

PromptDescription
travel_weatherTravel weather briefing between two locations
severe_weather_summarySevere weather analysis for a US state
clothing_recommendationWhat to wear based on weather
outdoor_activityIs weather suitable for an activity?

Client Integration

Claude Desktop App

Add to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse-client",
        "--url",
        "https://<SERVICE_URL>/sse"
      ]
    }
  }
}

Replace <SERVICE_URL> with your Cloud Run service URL, then restart Claude Desktop.

Python SDK

pip install mcp
import asyncio
from mcp.client.sse import sse_client
from mcp.client.session import ClientSession

SERVER_URL = "https://<SERVICE_URL>/sse"

async def main():
    async with sse_client(SERVER_URL) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()

            # List available tools
            tools = await session.list_tools()
            for tool in tools.tools:
                print(f"- {tool.name}: {tool.description}")

            # Call a tool
            result = await session.call_tool("get_global_forecast", {
                "latitude": 28.6139,
                "longitude": 77.2090
            })
            print(result.content[0].text)

asyncio.run(main())

TypeScript/Node.js SDK

npm install @modelcontextprotocol/sdk
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

const client = new Client({ name: "weather-client", version: "1.0.0" });
const transport = new SSEClientTransport(
  new URL("https://<SERVICE_URL>/sse")
);

await client.connect(transport);

// List tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool("geocode_location", {
  query: "Tokyo, Japan"
});

APIs Used

All APIs are free and require no API keys:

License

Proprietary - All rights reserved by Datavtar