For Server Developers
What we’ll be building
get-alerts
and get-forecast
. Then we’ll connect the server to an MCP host (in this case, Claude for Desktop):

Core MCP Concepts
1.
2.
3.
Prerequisite knowledge
System requirements
Set up your environment
uv
and set up our Python project and environment:powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uv
command gets picked up.# Create a new directory for our project
uv init weather
cd weather
# Create virtual environment and activate it
uv venv
.venv\Scripts\activate
# Install dependencies
uv add mcp[cli] httpx
# Create our server file
new-item weather.py
# Create a new directory for our project
uv init weather
cd weather
# Create virtual environment and activate it
uv venv
.venv\Scripts\activate
# Install dependencies
uv add mcp[cli] httpx
# Create our server file
new-item weather.py
Building your server
Importing packages and setting up the instance
weather.py
:
Helper functions
Implementing tool execution
Running the server
uv run weather.py
to confirm that everything’s working.Testing your server with Claude for Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
in a text editor. Make sure to create the file if it doesn’t exist.
code $env:AppData\Claude\claude_desktop_config.json
mcpServers
key. The MCP UI elements will only show up in Claude for Desktop if at least one server is properly configured.{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
"run",
"weather.py"
]
}
}
}
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\weather",
"run",
"weather.py"
]
}
}
}
You may need to put the full path to the uv
executable in thecommand
field. You can get this by runningwhich uv
on MacOS/Linux orwhere uv
on Windows.
Make sure you pass in the absolute path to your server.
1.
2.
uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather run weather.py
Test with commands
weather
server. You can do this by looking for the hammer 



What’s happening under the hood
1.
2.
3.
4.
5.
6.
Modified at 2025-03-12 06:34:35