Node.js MCP Weather Server with Azure Deployment
A Model Context Protocol (MCP) server built with Express.js and Node.js that provides weather information using the National Weather Service API. Ready for deployment to Azure App Service with Azure Developer CLI (azd).
🌟 Features
- Express.js Framework: Fast, unopinionated web framework for Node.js
- MCP Protocol Compliance: Full support for JSON-RPC 2.0 MCP protocol
- HTTP Transport: HTTP-based communication for web connectivity
- Weather Tools:
get_alerts
: Get weather alerts for any US stateget_forecast
: Get detailed weather forecast for any location
- Azure Ready: Pre-configured for Azure App Service deployment
- Web Test Interface: Built-in HTML interface for testing
- National Weather Service API: Real-time weather data from official US government source
🚀 Quick Deploy to Azure
Prerequisites
- Azure CLI
- Azure Developer CLI (azd)
- Active Azure subscription
Deploy in 3 Commands
After deployment, your MCP server will be available at:
- Health Check:
https://<your-app>.azurewebsites.net/health
- MCP Capabilities:
https://<your-app>.azurewebsites.net/mcp/capabilities
- Test Interface:
https://<your-app>.azurewebsites.net/test
🧪 Test the Live Server
Once deployed, test the weather tools:
💻 Local Development
Prerequisites
- Node.js 22+ (or Node.js 18+)
- npm (Node Package Manager)
Setup & Run
- Clone and install dependencies:
- Start the development server:
- Access the server:
- Server: http://localhost:8000
- Health Check: http://localhost:8000/health
- Test Interface: http://localhost:8000/test
🏗️ Architecture
server.js
: Main Express application with MCP protocol implementationinfra/
: Azure Bicep templates for infrastructure as codeazure.yaml
: Azure Developer CLI configurationpublic/
: Static assets for the web test interface
⚙️ Configuration
The server uses these environment variables:
PORT
: Server port (default: 8000)NODE_ENV
: Environment mode (default: development)
Azure App Service automatically configures:
- Node.js 22 runtime
- Premium v3 (P0V3) App Service Plan
- Health check monitoring
🔌 MCP Integration
Connect to MCP Inspector
Use this configuration to connect to your deployed server:
For local development, use http://localhost:8000/mcp
.
🛠️ API Endpoints
- GET
/health
- Server health check - GET
/mcp/capabilities
- MCP server capabilities - POST
/mcp
- Main MCP JSON-RPC endpoint - GET
/test
- Web test interface
📖 Available Tools
get_alerts
Get weather alerts for any US state.
Parameters:
state
(string): Two-letter state code (e.g., "CA", "NY")
get_forecast
Get detailed weather forecast for any location.
Parameters:
latitude
(number): Latitude coordinatelongitude
(number): Longitude coordinate
🧪 Testing
Web Interface
Visit /test
endpoint for an interactive testing interface.
Command Line
🌦️ Data Source
This server uses the National Weather Service (NWS) API:
- Real-time weather alerts and warnings
- Detailed weather forecasts
- Official US government weather data
- No API key required
- High reliability and accuracy
� Development Scripts
📂 Project Structure
🤝 Contributing
This is a sample project demonstrating MCP server implementation with Azure deployment. Feel free to:
- Fork and customize for your needs
- Add new MCP tools
- Improve the Azure deployment template
- Submit issues and suggestions
Ready to deploy? Run azd up
and have your MCP weather server live on Azure in minutes! 🚀
� License
MIT License - feel free to use this project for your own applications.
This server cannot be installed
An MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.
Related MCP Servers
- -securityFlicense-qualityThis SSE-based MCP server allows users to connect and interact with National Weather Service APIs to retrieve weather alerts and forecasts.Last updated -90Python
- -securityFlicense-qualityThis is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)Last updated -Python
- AsecurityAlicenseAqualityAn MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.Last updated -1PythonMIT License
- -securityFlicense-qualityAn MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.Last updated -Python