Weather-MCP-Server

Krytons/Weather-MCP-Server

3.3

If you are the rightful owner of Weather-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Weather MCP Server is a proof of concept Model Context Protocol server that provides real-time weather information using the OpenWeatherMap API.

The Weather MCP Server is a versatile and extensible server designed to deliver real-time weather data for any city worldwide. Built with TypeScript, it leverages the OpenWeatherMap API to provide accurate and up-to-date weather conditions. The server supports dual transport modes, allowing it to function as both an MCP server using stdio and a standalone HTTP API. This flexibility makes it suitable for a wide range of applications and integration scenarios. The architecture is modular and follows best practices in software engineering, such as schema-driven development, service layer pattern, and dependency injection. This design ensures that the server is easy to extend and maintain, allowing developers to add new tools and services with minimal effort. Additionally, the server includes built-in support for API versioning, ensuring backward compatibility and smooth transitions between different API versions.

Features

  • Real-time Weather Data: Provides current weather conditions for any city worldwide.
  • Dual Transport Modes: Supports both MCP stdio and HTTP transport.
  • Extensible Architecture: Easy-to-extend pattern for adding new tools and services.
  • API Versioning: Built-in support for API versioning with Express.
  • Type Safety: Full TypeScript implementation with comprehensive type definitions.

Usages

usage with local stdio

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

usage with local subprocess

python
command='uv', args=['run', 'server.py']  # Launch using virtual environment

usage with remote sse

python
mcp.run(transport='sse', host="0.0.0.0", port=8000)  # Specify SSE endpoint

usage with remote http streamable

yaml
paths:
  /mcp:
    post:
      x-ms-agentic-protocol: mcp-streamable-1.0  # Copilot Studio integration

usage with ide plugin

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["weather.py"]
    }
  }
}

usage with github mcp server

{"command": "docker", "args": ["run", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]}

Tools

  1. getCurrentWeather

    Retrieves current weather information for a specified city.