Mcp Server Weather Example
@aman-panjwani
Example project demonstrating how to deploy MCP Servers using Azure Container Apps with a weather data processing use case. This repo showcases best practices for containerizing, configuring, and deploying scalable MCP Servers on Azure for real-time data ingestion and analysis.
Overview
What is Mcp Server Weather Example?
Mcp Server Weather Example is a cloud-deployable Model Context Protocol (MCP) server that provides real-time weather data from the U.S. National Weather Service API. Built with FastAPI and Server-Sent Events (SSE), it allows AI agents like GitHub Copilot to query weather alerts and forecasts via secure API key authentication.
How to use Mcp Server Weather Example?
Clone the repository, set the API_KEYS environment variable, and deploy to Azure Container Apps with az containerapp up. Configure a .vscode/mcp.json file with the server’s SSE URL and API key, then connect from Visual Studio Code’s MCP extension. You can then query weather data through GitHub Copilot Chat in Agent mode.
Key features of Mcp Server Weather Example
- Two MCP tools:
get_alerts()andget_forecast() - Real-time communication via Server-Sent Events (SSE)
- API key authentication with
x-api-keyheader - Ready-to-deploy Docker image for Azure Container Apps
- Seamless integration with VS Code and GitHub Copilot
Use cases of Mcp Server Weather Example
- Query current weather alerts for any U.S. region
- Retrieve multi-day weather forecasts for a specific location
- Enable AI coding assistants to answer real-time weather questions
FAQ from Mcp Server Weather Example
What tools does Mcp Server Weather Example provide?
It provides two tools: get_alerts() for weather alerts and get_forecast() for weather forecasts, both backed by the U.S. National Weather Service API.
How is the server secured?
Requests are authenticated via an x-api-key header. API keys are set as environment variables (API_KEYS) and can be a single key or multiple comma-separated keys.
What are the deployment requirements?
Deployment uses Azure CLI’s az containerapp up command, which builds a Docker image (Python 3.13, uv web server) and deploys it to Azure Container Apps. The server exposes an SSE endpoint at /sse.
How do I connect the server to VS Code?
Create a .vscode/mcp.json file with the server’s URL (ending in /sse) and your API key. Then start the server entry from the MCP extension sidebar and enter the key when prompted.
Can I use this server with GitHub Copilot?
Yes, after connecting via VS Code’s MCP extension, you can ask GitHub Copilot Chat (in Agent mode) weather-related questions, and it will call the MCP tools to answer with live data.