knmi mcp
A FastMCP server that provides real-time weather data from KNMI weather stations, allowing users to access temperature, humidity, wind speed, and other weather metrics for any location in the Netherlands through natural language queries.
A FastMCP server that provides real-time weather data from KNMI weather stations, allowing users to access temperature, humidity, wind speed, and other weather metrics for any location in the Netherlands through natural language queries.
A FastMCP server that provides real-time weather data from KNMI (Royal Netherlands Meteorological Institute) weather stations. This application fetches the latest 10-minute measurements from the nearest weather station to any location in the Netherlands.
uv
package managergit clone <repository-url>
cd knmi-mcp
.env
file in the project root:
KNMI_API_KEY=your_api_key_here
To use this application with Claude AI, run the following command in the folder of the project:
uv run fastmcp install src/knmi_weather_mcp/server.py
This will add the following configuration to your Claude configuration file (typically located at ~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"KNMI Weather": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"--with",
"httpx",
"--with",
"netCDF4",
"--with",
"numpy",
"--with",
"pandas",
"--with",
"pydantic",
"--with",
"python-dotenv",
"--with",
"xarray",
"fastmcp",
"run",
"/Users/<username>/<git location>/knmi-mcp/src/knmi_weather_mcp/server.py"
]
}
}
Note: If you see an error like this:
spawn uv ENOENT
Replace the uv
command with the full path to the uv
command. On *nix systems this can be found with the command which uv
.
For development or standalone usage:
uv run fastmcp run src/knmi_weather_mcp/server.py
Get a natural language interpretation of current weather conditions for any location in the Netherlands.
Example:
await what_is_the_weather_like_in("Amsterdam")
Get raw weather data for a location.
Example:
await get_location_weather("Rotterdam")
Search for locations in the Netherlands.
Example:
await search_location("Utrecht")
Find the nearest KNMI weather station to given coordinates.
Example:
await get_nearest_station(52.3676, 4.9041)
The application logs are stored in the logs/knmi_weather.log
file, providing detailed information about:
This application uses the KNMI Data Platform API to fetch data from the "Actuele10mindataKNMIstations" dataset, which provides 10-minute interval measurements from all KNMI weather stations in the Netherlands.
The application includes robust error handling for:
[
{
"description": "Get current weather data for a location",
"inputSchema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
}
},
"required": [
"location"
],
"title": "get_location_weatherArguments",
"type": "object"
},
"name": "get_location_weather"
},
{
"description": " Search for locations in the Netherlands Args: query: Search term for location ",
"inputSchema": {
"properties": {
"query": {
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "search_locationArguments",
"type": "object"
},
"name": "search_location"
},
{
"description": " Find the nearest KNMI weather station to given coordinates Args: latitude: Latitude in degrees longitude: Longitude in degrees ",
"inputSchema": {
"properties": {
"latitude": {
"title": "Latitude",
"type": "number"
},
"longitude": {
"title": "Longitude",
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"title": "get_nearest_stationArguments",
"type": "object"
},
"name": "get_nearest_station"
},
{
"description": " Get and interpret weather data for a location in the Netherlands Args: location: City or place name in the Netherlands Returns: A natural language interpretation of the current weather conditions ",
"inputSchema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
}
},
"required": [
"location"
],
"title": "what_is_the_weather_like_inArguments",
"type": "object"
},
"name": "what_is_the_weather_like_in"
}
]