Python Weather Server

Python Weather Server is an MCP server that provides weather forecasts and alert data from the National Weather Service API, protected by OAuth 2.1 authentication. It connects AI assistants and MCP clients to official United States meteorological data while using Microsoft Entra ID (Azure AD) for enterprise-grade security. Software developers, system architects, and AI engineers use this server as a production-ready reference architecture for deploying authenticated remote MCP applications. The server enables client applications to fetch active US weather alerts by state and pull detailed forecasts for specific geographical coordinates. Built with FastAPI, it implements dynamic client registration, mandatory Proof Key for Code Exchange (PKCE) validation with S256, authorization server metadata discovery, and JSON Web Token (JWT) verification. The codebase is configured for deployment to Azure App Service using the Azure Developer CLI, providing a complete framework for testing and running remote Model Context Protocol services with strict protocol version header compliance.

Category: Maps, Weather & Local Data

Tags: fastapi, nws, oauth, weather

Visit Python Weather Server

How to install and configure Python Weather Server

  1. Clone the repository and install dependencies in a virtual environment: bash git clone https://github.com/Azure-Samples/remote-mcp-webapp-python-auth-oauth cd remote-mcp-webapp-python-auth-oauth python -m venv venv pip install -r requirements.txt 2. Configure your environment variables in .env with your Azure OAuth credentials following AUTH_SETUP.md. 3. Start the server locally with uvicorn main:app --host 0.0.0.0 --port 8000. 4. Visit http://localhost:8000/mcp_oauth_test.html in your browser to complete the OAuth 2.1 flow and obtain a JWT token. 5. Register the HTTP server in your MCP client configuration: json { "mcpServers": { "weather-mcp-server-local": { "transport": { "type": "http", "url": "http://localhost:8000/", "headers": { "Authorization": "Bearer <your-jwt-token>" } } } } }

What you can do with Python Weather Server

  • Fetching active weather alerts for any US state using the get_alerts tool during automated assistant interactions. - Querying detailed localized forecasts for specific coordinate sets through the National Weather Service API. - Testing MCP OAuth 2.1 implementations including PKCE and dynamic client registration using the built-in web interface. - Serving as an enterprise reference implementation for hosting secured remote MCP servers on Azure App Service.

Key facts

  • Open Source
  • https://github.com/Azure-Samples/remote-mcp-webapp-python-auth-oauth
  • Maps, Weather & Local Data
  • fastapi, nws, oauth, weather

Part of MCP Servers

Related MCP servers

  • MCP Weather Server — MCP Weather Server is an MCP server that connects AI assistants to the AccuWeather API to provide real-time meteorological observations…
  • MCP Weather Server Demo — MCP Weather Server Demo is an MCP server that provides meteorological data by connecting to the Open-Meteo API and public…
  • MCP Weather — MCP Weather is an MCP server that enables Model Context Protocol clients, such as Claude Desktop, to retrieve real-time weather…
  • Node.js OpenWeather MCP — mcp-nodejs is an MCP server that connects AI assistants to the OpenWeather API using a Node.js runtime. Built as a…
  • MCP-Weather — MCP-Weather is an MCP server that retrieves regional Japanese meteorological forecasts by connecting to a Japan Meteorological Agency compatible weather…
  • Michelin MCP — Michelin MCP is an MCP server that provides access to structured data from the Michelin Guide dataset for large language…

What can Python Weather Server do?

Python Weather Server connects MCP clients to the National Weather Service API to retrieve real-time US weather alerts and detailed regional forecasts. It also handles end-to-end OAuth 2.1 authentication flows, including dynamic client registration, authorization server metadata discovery, and JWT token validation.

How do I install Python Weather Server?

Clone the Azure-Samples repository, set up a Python 3.8+ virtual environment, and install dependencies from requirements.txt. Configure your Azure AD credentials in the environment file, launch the FastAPI server with uvicorn, and retrieve a JWT token via the included test interface before configuring your MCP client.

Which MCP clients work with Python Weather Server?

Any MCP-compatible client that supports HTTP remote transport and authorization headers can connect to this server. It can be tested using the MCP Inspector by setting the transport to HTTP, specifying the server URL, and including the Bearer token in the header configuration.

Is Python Weather Server open source?

Yes, Python Weather Server is an open-source project hosted on GitHub under the Azure-Samples organization. You can inspect the source code, modify it for custom implementations, or deploy it directly to your Azure infrastructure.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories