MCPTutorial Weather Server
by SageChisanga
This project demonstrates how to create a simple weather server using FastMCP. It provides a basic example of setting up a server, installing dependencies, and retrieving weather data.
View on GitHub
Last updated: N/A
#STEP 1: install uv
#curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a new directory for our project
uv init weather
cd weather
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Install dependencies
uv add "mcp[cli]" httpx
# Create our server file
touch weather.py
from typing import Any
import httpx
from mcp.server.fastmcp import FastMCP
# Initialize FastMCP server
mcp = FastMCP("weather")
# Constants
NWS_API_BASE = "https://api.weather.gov"
USER_AGENT = "weather-app/1.0"
#Add this file