Weather-MCP FastAPI MCP server

Weather-MCP FastAPI MCP server

weather_mcp•bybrunolnetto

A FastAPI server that exposes weather alert and forecast tools through the MCP protocol, built with FastMCP and Pydantic AI.

License: MIT License•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Fetches active weather alerts for a specified U.S. state.
  • •Retrieves the weather forecast for given geographic coordinates.
  • •Allows natural language interaction through Pydantic AI agents connected to the MCP server.

BEST FOR

  • •Querying U.S. weather alerts for a specific state via natural language.
  • •Getting location-specific forecasts by latitude and longitude.

ABOUT WEATHER_MCP

Weather-MCP FastAPI MCP server is cataloged as an MCP server attributed to brunolnetto. A FastAPI server that exposes weather alert and forecast tools through the MCP protocol, built with FastMCP and Pydantic AI. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Weather-MCP FastAPI MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What transport does the Weather-MCP server expose?

The README states the server is accessible at an SSE endpoint on localhost port 8000.

Upstream README

View this exact version on GitHub

README.md · cd06611858e2 · Fetched 2026-11-13 12:48:19 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

🌦️ Weather-MCP

Weather-MCP is a FastAPI server that integrates with FastMCP and Pydantic AI to provide real-time weather alerts and forecasts. Users can interact with the server through natural language prompts, enabling seamless access to weather information.


📋 Table of Contents


🚀 Features

  • Fetch active weather alerts for U.S. states.
  • Retrieve detailed weather forecasts based on geographic coordinates.
  • Natural language interaction powered by Pydantic AI.
  • Extensible toolset via FastMCP.

🛠️ Installation

Prerequisites

  • Python 3.8 or higher
  • An OpenAI API key (OPENAI_API_KEY): To obtain an OpenAI API key, please visit the OpenAI API Keys page

Ensure you have these prerequisites in place before proceeding with the setup.

Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/weather-mcp.git
    cd weather-mcp
    
  2. Create and activate a virtual environment:

    pip install uv
    uv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    uv sync
    
  4. Set the OpenAI API Key

To securely use OpenAI services, set the OPENAI_API_KEY environment variable.([DEV Community][1])

On Unix/Linux/macOS:

export OPENAI_API_KEY="your-api-key-here"

To make this change permanent, add the above line to your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc) and reload the shell:([Hacker News][2])

source ~/.bashrc  # or source ~/.zshrc

On Windows (Command Prompt):

setx OPENAI_API_KEY "your-api-key-here"

After setting the variable, restart your Command Prompt to apply the changes.

On Windows (PowerShell):

$env:OPENAI_API_KEY = "your-api-key-here"
  1. Start the server:

    python weather_server.py
    

The server will be accessible at http://localhost:8000/sse.


💡 Usage

Interacting via Pydantic AI

You can interact with the server using natural language prompts through Pydantic AI.([YouTube][1])

Example:

import asyncio
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerHTTP

# Define the MCP server connection
mcp_server = MCPServerHTTP(url="http://localhost:8000/sse")

# Create the Pydantic AI agent
agent = Agent(
    model="openai:gpt-4o-mini",
    mcp_servers=[mcp_server],
    system_prompt="You are a helpful assistant that provides weather information."
)

async def main():
    prompt = "Are there any weather alerts for California?"
    async with agent.run_mcp_servers():
        result = await agent.run(prompt)
        print(result.output)

if __name__ == "__main__":
    asyncio.run(main())

Direct Tool Invocation

Alternatively, you can directly invoke the tools using FastMCP's client.

Example:

import asyncio
from fastmcp import Client

async def main():
    async with Client("http://localhost:8000/sse") as client:
        tools = await client.list_tools()
        print("Available tools:")
        for tool in tools:
            print(f"- {tool.name}: {tool.description}")

        # Call the get_weather_alerts tool
        state_code = "CA"
        alerts_result = await client.call_tool("get_weather_alerts", {"state": state_code})
        print(f"\nWeather alerts for {state_code}:\n{alerts_result[0].text}")

        # Call the get_weather_forecast tool
        latitude = 34.05
        longitude = -118.25
        forecast_result = await client.call_tool("get_weather_forecast", {
            "latitude": latitude,
            "longitude": longitude
        })
        print(f"\nWeather forecast for ({latitude}, {longitude}):\n{forecast_result[0].text}")

if __name__ == "__main__":
    asyncio.run(main())

📡 API Endpoints

The server exposes the following tools via the MCP protocol:

  • get_weather_alerts(state: str) -> str Fetches active weather alerts for the specified U.S. state.

  • get_weather_forecast(latitude: float, longitude: float) -> str Retrieves the weather forecast for the given geographic coordinates.


🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Make your changes and commit them: git commit -m 'Add feature'.
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request.([GitHub][2])

For major changes, please open an issue first to discuss what you would like to change.([Make a README][3])


📄 License

This project is licensed under the MIT License.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Weather-MCP FastAPI MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/weather_mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research