About Mcp Server Weather Example
Mcp Server Weather Example is a deployable weather MCP server and setup guide for teams using Azure Container Apps. It serves National Weather Service alerts and forecasts through an API-key-protected FastAPI app with SSE support.
Key features
- 01Retrieve NWS alerts and forecasts
- 02Serve tools through a FastAPI app
- 03Support Server-Sent Events
- 04Protect requests with API keys
- 05Deploy on Azure Container Apps
Use cases
- 01Deploy a remote weather MCP server
- 02Query current weather alerts
- 03Retrieve forecasts through an MCP client
- 04Connect the server from Visual Studio Code
MCP support
Exposes `get_alerts()` and `get_forecast()` to MCP clients. The example uses SSE and API-key authentication, with deployment instructions for Azure Container Apps.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDeploying & Connecting Your Remote MCP Weather Server
This project lets you deploy a cloud-based Model Context Protocol (MCP) server that delivers real-time weather data using the U.S. National Weather Service API. It’s built with FastAPI, supports Server-Sent Events (SSE) for real-time communication, and uses secure API key authentication.
This repository provides a ready-to-deploy Weather MCP server. You'll walk through the full setup from cloning the code, configuring authentication, deploying to Azure Container Apps, and finally connecting it inside Visual Studio Code using the MCP extension.
Clone the Repository
git clone https://github.com/your-username/mcp-weather-server.git
cd mcp-weather-server
Understand the Structure
Before deploying, familiarize yourself with the core components:
weather.py– Defines two tools:get_alerts()andget_forecast()using the U.S. National Weather Service API.main.py– Wraps the tools in a FastAPI app exposed at/sse, with support for SSE.api_key_auth.py– Implementsx-api-keyheader-based security for incoming requests.Dockerfile– Builds and packages the app using Python 3.13 and theuvweb server.
Configure API Key Authentication
Set your API key(s) securely via an environment variable:
export API_KEYS=<YOUR_API_KEY>
You can also supply multiple comma-separated keys. No need to hardcode secrets into the source code.
Build & Deploy to Azure Container Apps
Use the Azure CLI to build and deploy in a single step:
az containerapp up \
-g <RESOURCE_GROUP> \
-n weather-mcp \
--environment <CONTAINERAPPS_ENV_NAME> \
-l westus \
--env-vars API_KEYS=<YOUR_API_KEY> \
--source .
This command will:
- Build the image using the included Dockerfile.
- Deploy it to Azure Container Apps.
- Inject your API key(s) via
--env-vars.
Once deployed, Azure CLI will return a public URL this is the endpoint your MCP clients will use.

Connect from Visual Studio Code
With the server up, connect it inside VS Code:
- Create a
.vscode/mcp.jsonfile in your project:
{
"inputs": [
{
"type": "promptString",
"id": "weather-api-key",
"description": "Weather API Key",
"password": true
}
],
"servers": {
"weather-sse": {
"type": "sse",
"url": "https://weather-mcp.orangebush.westus.azurecontainerapps.io/sse",
"headers": {
"x-api-key": "${input:weather-api-key}"
}
}
}
}
- Open the MCP extension sidebar in VS Code.
- Click Start next to your server entry.
- Enter the API key when prompted.
You're now connected and ready to process real-time weather queries.
Try It with GitHub Copilot Chat (Agent Mode)
- Launch GitHub Copilot Chat in Agent mode.
- Ask something like:
"How's the weather forecast in Georgia?"
The agent will call your get_forecast tool behind the scenes and return a live forecast based on NWS data.

You're All Set!
Your MCP server is now:
- Cloud-hosted
- API-key protected
- Integrated with VS Code and GitHub Copilot
You can now build custom agents that interact with real-time weather data from anywhere.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.