datavtar/mcp-cloud-server
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.
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)
| Tool | Description |
|---|---|
get_alerts | Get weather alerts for a US state |
get_forecast | Get multi-day forecast for US location |
get_hourly_forecast | Get hourly forecast (next 24h) |
get_current_conditions | Get current conditions from nearest station |
get_radar_stations | List nearby radar stations |
get_active_hurricanes | Get active tropical storms/hurricanes |
Global Weather (Open-Meteo)
| Tool | Description |
|---|---|
get_global_forecast | 7-day forecast (worldwide) |
get_global_hourly | Hourly forecast (worldwide) |
get_air_quality | Air quality index and pollutants |
get_uv_index | UV index current and forecast |
get_marine_forecast | Wave height, direction, period |
Geocoding (Nominatim)
| Tool | Description |
|---|---|
geocode_location | Convert place name/address to coordinates |
reverse_geocode | Convert coordinates to address |
Utilities
| Tool | Description |
|---|---|
get_sunrise_sunset | Sunrise/sunset times for any date |
compare_weather | Compare weather between two locations |
get_weather_summary | Comprehensive weather summary |
MCP Resources
| Resource URI | Description |
|---|---|
weather://glossary | Weather terminology definitions |
weather://stations/{state} | List weather stations in a US state |
weather://alerts/national | Summary of all active US alerts |
MCP Prompts
| Prompt | Description |
|---|---|
travel_weather | Travel weather briefing between two locations |
severe_weather_summary | Severe weather analysis for a US state |
clothing_recommendation | What to wear based on weather |
outdoor_activity | Is 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:
- National Weather Service API - US weather data
- Open-Meteo - Global weather, air quality, marine data
- Nominatim - Geocoding (OpenStreetMap)
- Sunrise-Sunset.org - Sunrise/sunset times
License
Proprietary - All rights reserved by Datavtar