weather-mcp-server

weather-mcp-server

3.3

A lightweight, MCP-powered weather API service using `uv` for Python dependency management and Docker for containerized deployment.

The Weather Microservice with MCP + UV is designed to provide a seamless and efficient weather API service. It leverages the Model Context Protocol (MCP) for enhanced integration and development capabilities, while utilizing uv for managing Python dependencies. The service is containerized using Docker, making it suitable for both local development and scalable production deployments. It is also designed to integrate smoothly with Claude Desktop, offering a robust solution for developers looking to build and deploy weather-related applications. The service supports secure loading of secrets from environment variables or .env files, ensuring that sensitive information is handled appropriately.

Features

  • {'name': 'Fast local development', 'description': 'Utilizes uv and mcp for live reload and efficient local development.'}
  • {'name': 'Dockerized deployment', 'description': 'Supports containerized deployment for production or staging environments.'}
  • {'name': 'Claude Desktop integration', 'description': 'Ready for integration with Claude Desktop for enhanced functionality.'}
  • {'name': 'Secure secret management', 'description': 'Loads secrets securely from .env or environment variables.'}

Usage with Different Platforms

Development Mode

bash
uv run mcp dev server.py

Add dependencies

bash
uv run mcp dev server.py --with pandas --with numpy

Mount local code

bash
uv run mcp dev server.py --with-editable .

Claude Desktop Integration

bash
uv run mcp install server.py

Custom name

bash
uv run mcp install server.py --name "My Analytics Server"

Inject environment variables

bash
uv run mcp install server.py -v API_KEY=abc123 -v DB_URL=postgres://...
uv run mcp install server.py -f .env

Direct Execution

python
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("My App")

if __name__ == "__main__":
    mcp.run()

Run manually

bash
uv run python server.py
# or
uv run mcp run server.py

Build Docker Image

bash
docker build -t weather-service .

Run Docker Container

bash
docker run --env-file .env -p 6274:6274 weather-service