Weather Microservice
by hightower9
A lightweight, MCP-powered weather API service using `uv` for Python dependency management and Docker for containerized deployment. It's built for seamless local development, Claude Desktop integration, and scalable deployment.
Last updated: N/A
๐ค๏ธ Weather Microservice with MCP + UV
A lightweight, MCP-powered weather API service using uv
for Python dependency management and Docker for containerized deployment. Built for seamless local development, Claude Desktop integration, and scalable deployment.
๐ Features
- ๐งช Fast local dev with live reload using
uv
andmcp
- ๐ณ Dockerized for production or staging environments
- ๐ง Claude Desktop integration-ready
- ๐ Loads secrets securely from
.env
or environment variables
โ๏ธ Running Your Server
๐งช Development Mode (with MCP Inspector)
Start your server in development mode with hot reloading:
uv run mcp dev server.py
Add dependencies on-the-fly:
uv run mcp dev server.py --with pandas --with numpy
Mount your local code as editable:
uv run mcp dev server.py --with-editable .
๐ง Claude Desktop Integration
Install your server to Claude Desktop:
uv run mcp install server.py
Custom name:
uv run mcp install server.py --name "My Analytics Server"
Inject environment variables:
uv run mcp install server.py -v API_KEY=abc123 -v DB_URL=postgres://...
uv run mcp install server.py -f .env
๐ง Direct Execution
For more control or advanced deployments:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("My App")
if __name__ == "__main__":
mcp.run()
Run it manually:
uv run python server.py
# or
uv run mcp run server.py
๐ณ Docker Support
๐จ Build Image
docker build -t weather-service .
โถ๏ธ Run Container
docker run --env-file .env -p 6274:6274 weather-service
๐ Project Structure
.
โโโ server.py
โโโ .env
โโโ pyproject.toml
โโโ uv.lock
โโโ Dockerfile
โโโ README.md
๐ Environment Variables
Create a .env
file:
API_KEY=your_api_key_here
DB_URL=your_database_url_here
๐ฆ Dependency Management
Use uv
to manage and sync dependencies:
uv pip install mcp
uv pip install pandas numpy
uv sync # sync dependencies based on uv.lock
๐ License
MIT License โ use freely, modify responsibly.