# maraboinavamshi/weather-mcp architecture

> Architecture diagram of the GitHub repository maraboinavamshi/weather-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maraboinavamshi/weather-mcp
- Repository: https://github.com/maraboinavamshi/weather-mcp

## Overview

Weather MCP serves current weather for configured Indian cities through REST, MCP, and a browser dashboard, with a one-tool-at-a-time CLI client. The main weather flow parses a city or question, resolves its configured coordinates, requests current conditions from Open-Meteo, and returns normalized weather data; city listing is a separate capability. The graph also includes configuration and the dashboard. Relationships are based on the shown source and README; the dashboard’s internal behavior is not shown.

Main entry points: [`app/main.py`](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/main.py) (REST API), [`app/weather.py`](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/weather.py) (Weather service), [`app/config.py`](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/config.py) (City configuration), [`app/city_parser.py`](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/city_parser.py) (City matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI client<br/>[client.py]"]
  node_rest_api["REST API<br/>[main.py]"]
  node_mcp_transport["MCP transport<br/>[main.py]"]
  node_dashboard["Browser dashboard<br/>[dashboard.html]"]
end

subgraph group_service["Weather service"]
  node_weather_logic["Weather service<br/>[weather.py]"]
  node_city_parser["City matching<br/>[city_parser.py]"]
end

subgraph group_configuration["City configuration"]
  node_city_config["City configuration<br/>[config.py]"]
  node_city_data["Default city data<br/>[cities.json]"]
end

node_weather_user(("Weather user"))
node_rest_caller(("REST caller"))
node_mcp_client(("MCP client"))
node_open_meteo["Open-Meteo"]

node_weather_user -->|"requests weather"| node_rest_api
node_rest_caller -->|"calls REST"| node_rest_api
node_rest_api -->|"calls weather"| node_weather_logic
node_rest_api -->|"lists cities"| node_city_config
node_rest_api -->|"loads page"| node_dashboard
node_mcp_client -->|"invokes tools"| node_mcp_transport
node_cli -->|"calls tool"| node_mcp_transport
node_mcp_transport -->|"exposes operations"| node_rest_api
node_weather_logic -->|"resolves city"| node_city_parser
node_weather_logic -->|"reads coordinates"| node_city_config
node_city_parser -->|"matches configured cities"| node_city_config
node_city_config -->|"loads defaults"| node_city_data
node_weather_logic -->|"requests conditions"| node_open_meteo

click node_cli "https://github.com/maraboinavamshi/weather-mcp/blob/main/client.py"
click node_rest_api "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/main.py"
click node_mcp_transport "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/main.py"
click node_dashboard "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/dashboard.html"
click node_weather_logic "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/weather.py"
click node_city_parser "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/city_parser.py"
click node_city_config "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/config.py"
click node_city_data "https://github.com/maraboinavamshi/weather-mcp/blob/main/app/cities.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_rest_api,node_mcp_transport,node_dashboard,node_weather_user,node_mcp_client toneBlue
class node_weather_logic,node_city_parser toneAmber
class node_city_config,node_city_data toneMint
class node_rest_caller,node_open_meteo toneIndigo
```

## Components

### User interfaces

- [CLI client](https://github.com/maraboinavamshi/weather-mcp/blob/main/client.py): `client.py`
- [REST API](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/main.py): `app/main.py`
- [MCP transport](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/main.py): `app/main.py`
- [Browser dashboard](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/dashboard.html): `app/dashboard.html`

### Weather service

- [Weather service](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/weather.py): `app/weather.py`
- [City matching](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/city_parser.py): `app/city_parser.py`

### City configuration

- [City configuration](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/config.py): `app/config.py`
- [Default city data](https://github.com/maraboinavamshi/weather-mcp/blob/main/app/cities.json): `app/cities.json`

### Other components

- **Weather user**
- **REST caller**
- **MCP client**
- **Open-Meteo**

## Connections

- Weather user → REST API: requests weather (evidence: `README.md`)
- REST caller → REST API: calls REST (evidence: `README.md`)
- REST API → Weather service: calls weather (evidence: `app/main.py`)
- REST API → City configuration: lists cities (evidence: `app/main.py`)
- REST API → Browser dashboard: loads page (evidence: `app/main.py`)
- MCP client → MCP transport: invokes tools (evidence: `README.md`)
- CLI client → MCP transport: calls tool (evidence: `client.py`)
- MCP transport → REST API: exposes operations (evidence: `app/main.py`)
- Weather service → City matching: resolves city (evidence: `app/weather.py`)
- Weather service → City configuration: reads coordinates (evidence: `app/weather.py`)
- City matching → City configuration: matches configured cities (evidence: `app/city_parser.py`)
- City configuration → Default city data: loads defaults (evidence: `app/config.py`)
- Weather service → Open-Meteo: requests conditions (evidence: `app/weather.py`)
