MGM Radar
A clean, standalone API for Turkey's national radar composite: ingest the MGM image, turn it into calibrated rain data, and serve it to app developers and hobbyists.
Status: launched. Ingest, processing, live serving, access and metering, archive/exports, operations, tests, and deployment assets are in place and running in production. The design and specs live in
openspec/changes/archive/2026-11-20-bootstrap-mgm-radar-api/. The independent reference comparison is complete (report), as are the two-week soak (report) and the paid-listing decision (record); remaining follow-ups are tracked in the validation plan.
What it does
flowchart LR
SRC["MGM compmax1..15<br/>(10-min JPEG)"]
ING["Ingest<br/>raw + archive"]
PROC["Process<br/>dBZ, rain, confidence"]
SERVE["Serve<br/>live API + history"]
SRC --> ING --> PROC --> SERVE
- Ingest the full rolling set of MGM composite frames, not just the latest.
- Process each frame into a georeferenced reflectivity grid, a rain-rate grid, and an explicit confidence mask.
- Serve a versioned REST API: metadata, frames, images, snapshots, tiles, point queries, and historical series/exports.
- Archive every frame so history is queryable for forecasting and ML users.
What it is not
- Not a forecast model. It serves observations.
- Not a multi-source platform in this change. The source sits behind an adapter so it can be replaced later.
- Not a general-purpose weather UI. The product surface is the API, the account portal, and the documentation.
Architecture
flowchart TD
SRC["MGM compmax1..15 (HTTPS)"]
ING["INGEST<br/>poller → downloader → hash/dedupe → raw → index"]
PROC["PROCESS<br/>decode → georef → legend → classify → dBZ → rain<br/>→ confidence → derived store → render"]
SERVE["SERVE<br/>/v1: meta · frames · image · tiles · point · batch<br/>archive: series · exports · jobs · signed URLs<br/>edge: auth · quotas · rate limits · usage"]
SRC -- "conditional GET" --> ING
ING -- "new frame" --> PROC
PROC -- "indexed artifacts" --> SERVE
Repository layout
src/mgmradar/
ingest/ source adapter, poller, downloader, dedupe, raw storage
process/ decode, calibration, classification, rain rate, renders
store/ object storage and frame/export index
api/ FastAPI routes, schemas, auth, quotas
ops/ health, metrics, alerts
tests/ offline fixtures and golden-frame tests
deploy/ compose/runbook, CDN notes (image: root Dockerfile)
docs/ source, calibration, API, archive, operations, licensing
openspec/ proposal, specs, design, tasks
API at a glance
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/meta |
source, coverage, bounds, units, legend, versions (public on the first-party host) |
| GET | /v1/frames |
list frames |
| GET | /v1/frames/{scan_time} |
one frame's metadata |
| GET | /v1/frames/{scan_time}/image.png |
full-frame Web Mercator overlay |
| GET | /v1/frames/{scan_time}/tiles/{z}/{x}/{y}.png |
XYZ tile |
| GET | /v1/snapshot |
focused bbox/place radar snapshot |
| GET | /v1/frames/latest/image.png |
newest complete frame |
| GET | /v1/point |
one coordinate observation |
| POST | /v1/points |
bounded batch observations |
| GET | /v1/series |
one coordinate over time |
| POST | /v1/exports |
create a bbox/time export job |
| GET | /v1/exports/{id} |
export status + signed URL |
| GET | /v1/coverage.geojson |
radar footprint (public on the first-party host) |
| GET | /v1/status |
freshness and processing health (public on the first-party host) |
| GET | /v1/health |
liveness/readiness (no auth) |
| GET | /v1/health/ready |
503 unless dependencies and data are fresh |
| GET | /ops |
operations dashboard (Cloudflare Access SSO) |
| POST | /mcp |
remote MCP server (Streamable HTTP) |
/v1 uses X-API-Key. The five metered weather MCP tools are available from a
first-party local stdio package (uvx mgmradar-mcp, with the key in
MGM_API_KEY) and from the remote /mcp endpoint over Streamable HTTP. The
hosted endpoint also exposes the free, hosted-only get_profile account label,
which makes no /v1 read; the local package does not include it. The remote
server accepts the
same X-API-Key from header-capable clients, and OAuth 2.1 from OAuth-only hosts
such as ChatGPT, which discover the authorization server, register themselves,
and ask the customer to approve the radar:read scope. OAuth is accepted only
on /mcp, never on /v1. MCP place inputs resolve Turkish neighborhoods and
villages as well as provinces and districts, and every observation returns a
nullable tri-state answer (rain_detected, no_rain_detected, indeterminate)
with an explicit freshness band. See MCP server for setup and
troubleshooting, and MCP listings for the official
registry and developer directories that cover both the hosted and local
transports. The
evals/ directory holds the provider-independent
tool-selection benchmark.
Plans
The Basic tier is permanent and card-free: 5,000 requests per month, 150 per day, 1 request per second, and the newest frame only. It includes no timestamped images, tiles, batch requests, history, or exports.
| Plan | Price | Requests / month | History | Includes |
|---|---|---|---|---|
| Basic | $0 | 5,000 | live only | meta, frames, latest frame/image, point |
| Pro | $9 | 150,000 | 7 days | + images, batch, history |
| Ultra | $29 | 500,000 | 90 days | + tiles, exports (1/day) |
| Mega | $89 | 1,500,000 | full archive | + exports (10/day) |
| Enterprise | Custom | Custom | full archive | SLA, bulk export, dedicated support |
Rain threshold alerts are included in Pro and above with no per-alert charge in
version one. Basic has no alert rules. The configured limits match
config/plans.yaml:
| Plan | Alert rules | Deliveries / day | Deliveries / month |
|---|---|---|---|
| Basic | 0 | 0 | 0 |
| Pro | 10 | 100 | 2,000 |
| Ultra | 50 | 500 | 10,000 |
| Mega | 200 | 2,000 | 50,000 |
| Enterprise | 1,000 | 10,000 | 250,000 |
A downgrade disables rules above the new limit without deleting them and cancels their pending deliveries; an upgrade does not re-enable them automatically. See rain-alerts.md for the customer guide and runbook-rain-alerts.md for operations.
Sign up at /signup, verify the email, and the key is shown once. Paid plans
are self-serve through the portal; Polar handles checkout. There is no overage:
a quota rejection returns 429 until the reset or a plan change. See
pricing.md for the full rules.
Documentation
- Quickstart — the customer path from signup to the first call
- Self-hosting — install and run the service locally
- Architecture
- Source contract
- Calibration and confidence
- API reference and OpenAPI 3.1
- Rain alerts and the operator runbook
- Agent quickstart and the served
/llms.txt - MCP server
- MCP listings — registry and directory discovery surfaces
- Integration examples — MCP host, Home Assistant, and Python/JavaScript
- Authentication and plans
- Historical archive
- Operations, dashboard, and alerts
- Performance and freshness
- Accuracy and limitations
- Independent reference comparison
- Backup and retention
- Two-week soak report
- Paid-listing decision
- Release and deploy pipeline
- Pricing and plans
- Pricing decision
- Billing lifecycle, access policy, and the Polar account
- FAQ
- Ansible deployment
- Remaining validation plan
- Licensing and attribution
Known risks
- Upstream has no SLA. MGM can change the image layout, palette, cadence, or URL without notice. The service detects drift, quarantines bad frames, and reports staleness.
- Licensing. The source is publicly reachable but its terms assert all rights reserved. The owner has accepted the redistribution risk; the position is recorded in docs/licensing.md. This is not legal advice.
- Coarse product. The composite is roughly 2.4 km/px and column-maximum, not a surface rain measurement. The API must say so.
Naming
MGM Radar is the product name. The repository directory is mgm-radar; the
Python package, distribution, CLI command, environment-variable prefix, and
metric prefix use the single-token form mgmradar.
The name references the upstream source (MGM, the Turkish State Meteorological Service) but does not imply affiliation. MGM Radar is an independent product, not an official MGM service.
Development
python3.12 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
ruff check src tests
mypy src
pytest
Run the service with mgmradar serve, the ingest loop with mgmradar poll,
and the export worker with mgmradar export-worker --cleanup. See the
self-hosting guide and deployment runbook.
License
Proprietary. All rights reserved. The upstream data is subject to its own terms; see docs/licensing.md.
Metadata
Release files for mgmradar 0.41.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mgmradar-0.41.0.tar.gz | 3.6 MB | With provenance | Details for mgmradar-0.41.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mgmradar-0.41.0-py3-none-any.whl | Python 3 | none | any | Details for mgmradar-0.41.0-py3-none-any.whl |
Total release size: 5.5 MB
Release files / mgmradar-0.41.0.tar.gz
| Download URL | mgmradar-0.41.0.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee162b8b5abeeba1b6bfd260fe062974ee0af560d733e08b52dbe319be546993
|
|
BLAKE2b-256 checksum How to use checksums |
0a1d88c76c11cced8479bd308ad09956d38a0aa789ec6e56b74c8068142ef1d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / mgmradar-0.41.0-py3-none-any.whl
| Download URL | mgmradar-0.41.0-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7eec1c984850f689b8c5147bd9908fe148248e7775a1d4d63dc27f09dafdb9b1
|
|
BLAKE2b-256 checksum How to use checksums |
5ae9b04c8edbfed35b8a12885dcae68568542b01f2cbb3df67bc7ba81ab1c5c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for mgmradar 0.41.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mgmradar-0.41.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.