MCPTutorial

MCPTutorial

0

This project involves setting up a weather application using the FastMCP server framework. It interacts with the National Weather Service API to fetch weather data and is designed for easy setup and deployment.

#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

mkdir -p "~/Library/Application Support/Claude"

touch "~/Library/Application Support/Claude/claude_desktop_config.json"