Build a Local Weather MCP Server for Claude Desktop
What we'll build: A local MCP server that connects Claude Desktop to the US National Weather Service API — giving Claude the ability to fetch live weather alerts and 3-day forecasts for any US location. Free, no API key needed.
What is MCP?
Model Context Protocol (MCP) is an open standard that lets Claude connect to external tools and data sources running on your machine. Think of it as a plugin system — you write a small server, register it with Claude Desktop, and Claude can call your tools mid-conversation as if they were built-in capabilities.
In this post, we'll build a weather MCP server from scratch on Windows using Python and uv, and wire it directly into Claude Desktop.
Prerequisites:
You'll need Claude Desktop (latest version) and Python 3.10+. Install the uv package manager from PowerShell:
C:\Users\Admin>powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Setting up in five steps:
Step 1Create the project with uvStep 2Write the server codeStep 3Find your absolute pathStep 4Edit Claude Desktop configStep 5Restart & verify
Initialize the project and install dependencies:C:\Users\Admin>uv init weather C:\Users\Admin>cd weather C:\Users\Admin>weather>uv venv C:\Users\Admin>weather>.venv\Scripts\activate C:\Users\Admin>weather>uv add "mcp[cli]" httpx
Openweather.pyin Notepad (notepad weather.py) and add two tools — one for weather alerts by US state, and one for a 3-day forecast by coordinates. Both call the free National Weather Service API with no key required.
Note: You can get the Python script from web and is free opensource.The two tools you get:
get_alerts(state)get_forecast(lat, lon)get_alerts takes a two-letter US state code (like
TX) and returns any active National Weather Service alerts. get_forecast takes latitude and longitude and returns a plain-English 3-day forecast — the same data you'd see on weather.gov.Connecting to Claude Desktop:
Open the Claude Desktop config file from Claude Desktop -> Settings -> Developer -> Edit Config
Add the server entry, using double backslashes for Windows paths and the full path to
uv.exe(runwhere uvto find it). Here is the snapshot of mine:
Fully quit Claude Desktop from the system tray (right-click the tray icon → Quit), then relaunch it. We can see the Weather MCP server and here is a snapshot of mine.
Write a prompt in Claude and test the Weather MCP server functionality. Here is an example for it.