Open-Meteo Model Context Protocol Server

1.6.1 · active · verified Tue Apr 21

The `open-meteo-mcp-server` package provides a comprehensive Model Context Protocol (MCP) server designed to interface Large Language Models (LLMs) with the various Open-Meteo weather APIs. It currently stands at stable version `1.6.1` and releases are frequent, typically addressing bug fixes, schema updates, and security enhancements as seen in the recent changelog. Key differentiators include its full support for a wide array of Open-Meteo APIs (Forecast, Archive, Air Quality, Marine, Geocoding, Elevation, and specialized models like DWD ICON, NOAA GFS, ECMWF, etc.) and its robust implementation of the Model Context Protocol, enabling structured interaction with LLMs. The server offers features like cryptographic session IDs, authentication middleware, rate limiting, and trusted-proxy IP validation for enhanced security. It is primarily consumed as a standalone Node.js server, often orchestrated via `npx` or Docker, but also provides a programmatic API for embedding within applications.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to programmatically start the Open-Meteo MCP server using `startMcpServer`, configuring its host and port through environment variables or defaults.

import { startMcpServer } from 'open-meteo-mcp-server';

async function runServer() {
  const port = parseInt(process.env.PORT ?? '3000', 10);
  const host = process.env.HOST ?? '0.0.0.0';
  console.log(`Starting Open-Meteo MCP Server on ${host}:${port}...`);

  try {
    const server = await startMcpServer({
      port,
      host,
      // Optional: Configure trusted proxies for security features
      // trustedProxy: process.env.TRUSTED_PROXY_CIDR || undefined,
      // Optional: Configure rate limiting
      // rateLimitWindowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '60000', 10),
      // rateLimitMax: parseInt(process.env.RATE_LIMIT_MAX || '100', 10),
      // Optional: Specify Open-Meteo API URLs if not default
      // openMeteoApiUrl: process.env.OPEN_METEO_API_URL || 'https://api.open-meteo.com'
    });
    console.log(`Server started successfully. MCP URL: http://${host}:${port}/mcp`);
  } catch (error) {
    console.error('Failed to start MCP server:', error);
    process.exit(1);
  }
}

// To run this script, ensure your Node.js version is >= 22.0.0
// You can also run it directly via npx: npx -y -p open-meteo-mcp-server open-meteo-mcp-server
runServer();

view raw JSON →