smhi-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@smhi-mcp Will it rain in Uppsala this afternoon, and are there any warnings?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
smhi-mcp
An MCP server for Swedish weather data from SMHI (the Swedish Meteorological and Hydrological Institute). It lets an AI assistant fetch point forecasts, active weather warnings and live station observations for Sweden and the wider Nordic area.
No API key and no account needed: it uses SMHI's public open-data APIs.
Small: about 150 lines of Python. The SMHI client uses only the standard library, and the server needs only the official
mcpSDK.Returns structured JSON and passes Swedish/English text through as published by SMHI.
Tools
Tool | Arguments | Returns |
|
| Hourly rows: |
|
| Active warnings, one row per warning area: |
|
| Nearest active station: |
|
| Latest-hour value: |
Errors such as out-of-range coordinates, unknown stations or network failures come back as {"error": "..."} instead of crashing the session.
Example question: "Is it going to rain in Uppsala this afternoon, and are there any warnings for Uppsala län?" The assistant calls get_forecast(59.86, 17.64) and get_warnings(area="Uppsala").
symbol_code is SMHI's weather symbol (1 = clear sky … 27 = heavy snowfall). Parameter ids for find_nearest_station and get_observation follow SMHI's metobs API. For example, 1 is air temperature, 4 is wind speed, 6 is relative humidity and 7 is precipitation.
Related MCP server: Apiverket MCP Server
Install and run
Requires Python 3.10 or newer.
git clone https://github.com/MarkusIsaksson1982/smhi-mcp.git
cd smhi-mcp
python -m venv .venv && . .venv/bin/activate
pip install -e .
smhi-mcp # speaks MCP over stdioMCP client configuration (Claude Desktop, Cursor and others):
{
"mcpServers": {
"smhi": { "command": "smhi-mcp" }
}
}If smhi-mcp is not on your PATH, use the full path to the virtualenv's bin/smhi-mcp, or "command": "python", "args": ["-m", "smhi_mcp.server"].
The server is also listed on Smithery.
Development
pip install -e '.[dev]'
pytest # offline tests (recorded SMHI responses, no network)
python scripts/smoke_live.py # live smoke test: starts the server and calls all four tools against SMHIData source and attribution
All weather data comes from SMHI open data (opendata.smhi.se) and is licensed under Creative Commons Attribution 4.0 (CC BY 4.0). If you display or redistribute the data, attribute it to SMHI. Each tool response includes "source": "SMHI" where practical.
This is an independent project. It is not affiliated with or endorsed by SMHI. Forecasts and warnings are provided as is, so for safety-critical decisions use SMHI's official channels (smhi.se).
License
The code is MIT licensed (see LICENSE). The SMHI data it returns is CC BY 4.0, as described above.
Available Tools
4 toolsfind_nearest_stationB
Nearest active SMHI observation station for a point. parameter: SMHI metobs parameter id (1 = air temperature).
Inputs: lat (required), lon (required), parameter. Returns: object
get_forecastA
Hourly SMHI weather forecast for a point (lat 52-72, lon 2-35): temperature, wind, gusts, precipitation, humidity, symbol code.
Inputs: lat (required), lon (required), hours. Returns: object
get_observationB
Latest-hour observed value at an SMHI station (parameter 1 = air temperature in °C).
Inputs: station_id (required), parameter. Returns: object
get_warningsB
Active SMHI weather warnings. Optional area filter (substring, e.g. 'Skåne'); lang 'sv' or 'en'.
Inputs: area, lang. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a clearly distinct resource: station lookup, current observation, future forecast, and alerts. The find_nearest_station/get_observation pair is complementary (one supplies the station id the other needs) rather than overlapping, and observation vs. forecast is unambiguous from the descriptions.
All tools use snake_case with a verb_noun structure (find_nearest_station, get_observation, get_forecast, get_warnings). The find-vs-get distinction is semantically meaningful (search vs. retrieve) rather than an inconsistency.
Four tools is slightly lean but each earns its place, covering the core surface of a weather API: station lookup, observations, forecasts, and warnings. Nothing is redundant, though it sits at the lower end of a comfortable range.
The surface covers the main workflows of a weather service: locate a station, read its latest observation, get an hourly forecast, and check warnings. Minor gaps exist (e.g. no historical/archive data or multi-parameter observation queries), but core needs are met.
Maintenance
Related MCP Connectors
Nordic weather: forecasts, warnings, HD radar, rain nowcast, lightning, aurora, satellite AI.
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
MET Norway (api.met.no) MCP — global weather, Nordics specials.
Swiss weather data for AI assistants — forecasts, measurements, stations, pollen.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to current weather conditions and hourly forecasts for any location in Sweden using the SMHI Open Data API. It supports built-in city lists, coordinate inputs, and geocoding fallback to deliver detailed meteorological data without requiring authentication.2MIT
- AlicenseAqualityDmaintenanceQuery Swedish public data from AI tools. Includes company data, SCB statistics, weather, transport, public agencies, and more through the Apiverket API.251 npm2MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that provides real-time weather data, forecasts, and historical weather information from SMHI (Swedish Meteorological and Hydrological Institute) for any location in Sweden.2-
- FlicenseAqualityDmaintenanceProvides access to Swedish weather data from SMHI, including 10-day forecasts and historical observations from over 996 stations.4-