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 1
Create the project with uv
Step 2
Write the server code
Step 3
Find your absolute path
Step 4
Edit Claude Desktop config
Step 5
Restart & 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

Open
weather.py in 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 (run where uv to 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.




Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

Build Pega Applications with GitHub Copilot CLI, Pega Infinity AI Plugin & MCP — Branch-Based Agentic Authoring

itextpdf API to generate PDF doc from an image file using Pega PE