# OpenWeather API — how to use (mcp.ai)

Connect your OpenWeather API account and use 21 tools for developer tools straight from your AI agent. Connect with your own API key. Provides access to current weather data, forecasts, and historical weather data for any location worldwide.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_openweather_api?ms=1787295840000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `openweather_api_delete_weather_station`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/openweather_api`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/openweather_api/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/openweather_api/delete/weather/station` — Tool to delete a registered weather station. Use after identifying a station to remove. Returns confirmation message upon success.
  - body: { station_id: string }
- `POST https://api.mcp.ai/api/openweather_api/get/air/pollution/current` — Tool to fetch current air pollution data for a location. Use when you need real-time air quality details by latitude and longitude.
  - body: { lat: number, lon: number }
- `POST https://api.mcp.ai/api/openweather_api/get/air/pollution/forecast` — Tool to get forecasted air pollution data for a specific location. Use after confirming latitude and longitude. Forecast availability may be limited for remote or oceanic coordinates; verify response 
  - body: { lat: number, lon: number }
- `POST https://api.mcp.ai/api/openweather_api/get/air/pollution/history` — Tool to retrieve historical air pollution data. Use when you need past air quality levels for a specific latitude/longitude and time range.
  - body: { end: integer, lat: number, lon: number, start: integer }
- `POST https://api.mcp.ai/api/openweather_api/get/circle/city/weather` — Tool to search for current weather data in cities around a geographic point. Use when you need to fetch weather within a radius circle after confirming latitude and longitude.
  - body: { cnt?: integer, lat: number, lon: number, lang?: string, mode?: string, units?: string }
- `POST https://api.mcp.ai/api/openweather_api/get/current/weather` — Tool to retrieve current weather data for a location. Use when you need up-to-the-minute weather info. Exactly one location identifier must be provided per call: either `q`, `id`, `zip`, or the pair `
  - body: { q?: string, id?: integer, lat?: number, lon?: number, zip?: string, lang?: string, units?: string }
- `POST https://api.mcp.ai/api/openweather_api/get/geocoding/by/zip` — Tool to convert zip/post code into geographic coordinates. Use when you need latitude and longitude for a specific postal code.
  - body: { zip: string }
- `POST https://api.mcp.ai/api/openweather_api/get/geocoding/direct` — Tool to convert a location name into geographic coordinates. Use when you need latitude and longitude for a given location after confirming the precise name.
  - body: { q: string, limit?: integer }
- `POST https://api.mcp.ai/api/openweather_api/get/geocoding/reverse` — Tool to convert geographic coordinates into a location name. Use when you need city, state, and country info from latitude and longitude.
  - body: { lat: number, lon: number, limit?: integer }
- `POST https://api.mcp.ai/api/openweather_api/get/station/measurements` — Tool to retrieve aggregated measurements from a weather station with minute, hour, or day granularity. Use when you need historical weather data from a specific registered station.
  - body: { to: integer, from: integer, type: string, limit: integer, station_id: string }
- `POST https://api.mcp.ai/api/openweather_api/get/uv/index` — Tool to retrieve current UV index for a location. Use when you need up-to-the-minute UV index by latitude and longitude.
  - body: { lat: number, lon: number }
- `POST https://api.mcp.ai/api/openweather_api/get/uv/index/forecast` — Tool to retrieve UV index forecast for a specific location. Use when you need upcoming UV index values after confirming latitude and longitude. Returns up to 8 days of data. Data may be sparse or abse
  - body: { cnt?: integer, lat: number, lon: number }
- `POST https://api.mcp.ai/api/openweather_api/get/uv/index/history` — Tool to retrieve historical UV index data for a specified location and time range. Use when you need to analyze past UV exposure trends after confirming coordinates and time period.
  - body: { end: integer, lat: number, lon: number, start: integer }
- `POST https://api.mcp.ai/api/openweather_api/get/weather/map/tile` — Tool to fetch Weather Maps 2.0 tile images. Use when you need dynamic weather layers at specific zoom and coordinates with advanced styling options.
  - body: { x: integer, y: integer, z: integer, fill?: string, color?: string, layer: string, scale?: integer, format?: string, opacity?: number, palette?: string, fill_bound?: boolean }
- `POST https://api.mcp.ai/api/openweather_api/get/weather/station` — Tool to get information about a specific weather station by its ID. Use when you need details about a particular station.
  - body: { station_id: string }
- `POST https://api.mcp.ai/api/openweather_api/get/weather/stations` — Tool to list all weather stations added to your account. Use after setting up your OpenWeather API key.
- `POST https://api.mcp.ai/api/openweather_api/get/weather/triggers` — Tool to retrieve weather triggers for specific conditions. Use after defining trigger criteria.
  - body: { triggers: object[] }
- `POST https://api.mcp.ai/api/openweather_api/get5/day/forecast` — Tool to get a 5-day forecast every 3 hours (up to 40 UTC timestamps). Exactly one location identifier required per call: `q`, `id`, `zip`, or `lat`+`lon` pair. Use `city.timezone` offset to convert ti
  - body: { q?: string, id?: integer, lat?: number, lon?: number, zip?: string, lang?: string, mode?: string, units?: string }
- `POST https://api.mcp.ai/api/openweather_api/post/add/weather/station` — Tool to add a new weather station to your account. Use when you need to register a station before sending custom data.
  - body: { name: string, altitude: number, latitude: number, longitude: number, external_id: string }
- `POST https://api.mcp.ai/api/openweather_api/post/submit/station/measurements` — Tool to submit weather measurements from a registered station. Use when you need to send temperature, wind, pressure, humidity, or precipitation data for a station.
  - body: { measurements: object[] }
- `POST https://api.mcp.ai/api/openweather_api/update/weather/station` — Tool to update weather station details. Use when you need to modify the name, location, or external ID of an existing station.
  - body: { name?: string, altitude?: number, latitude: number, longitude: number, station_id: string, external_id?: string }

## Example prompts
- "What can I do in OpenWeather API?"
- "Show me a summary of my OpenWeather API account"

## More
- Page: https://mcp.ai/openweather_api
- Agent spec (llms.txt): https://mcp.ai/openweather_api/llms.txt
- Postman collection: https://mcp.ai/openweather_api/postman.json
