{
  "markdown": "# met-mcp\n\nAn MCP server for weather forecasts from MET Norway (Yr). Built as a learning project.\n\nAvailable three ways:\n\n- **npm**: [`met-mcp`](https://www.npmjs.com/package/met-mcp) — run locally over stdio\n- **Remote**: `https://met-mcp.met-mcp-worker.workers.dev/mcp` — Streamable HTTP on Cloudflare Workers, add it as a claude.ai connector\n- **MCP registry**: [`io.github.trondbjoroy/met-mcp`](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.trondbjoroy/met-mcp)\n\n## Tools\n\n- `geocode_location(name, count)` — find coordinates for a place name. Uses the free Open-Meteo geocoder, because MET has no geocoding API.\n- `get_forecast(latitude, longitude, hours)` — hourly forecast from MET Locationforecast 2.0. Works worldwide, best in the Nordics.\n- `get_nowcast(latitude, longitude)` — radar-based precipitation for the next 2 hours. Nordics only.\n- `get_weather_alerts(latitude?, longitude?)` — official Norwegian danger warnings (MetAlerts). Omit coordinates for all of Norway.\n- `get_sun_events(latitude, longitude, date, utc_offset)` — sunrise, sunset, and solar noon. Worldwide.\n- `get_ocean_forecast(latitude, longitude, hours)` — wave height and sea temperature along the Norwegian coast.\n- `find_weather_stations(latitude, longitude, count)` — nearest official weather stations (Frost).\n- `get_historical_weather(station_id, from, to, elements)` — daily historical observations from the Frost archive; some stations go back over 100 years.\n\nThe two Frost tools need a free client ID from https://frost.met.no/auth/requestCredentials.html, set as the `FROST_CLIENT_ID` env var (or a Cloudflare secret for the worker). The other tools need nothing.\n\nTool definitions live in `src/tools.ts`, shared between the stdio server and the worker.\n\n## Build and test\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\nThe test spawns the server over stdio and calls both tools against the live APIs.\n\n## Use with Claude Code\n\n```bash\nclaude mcp add met-weather -- node C:\\Users\\trond\\met-mcp\\dist\\index.js\n```\n\nThen ask Claude: \"What is the weather in Bergen tomorrow?\"\n\n## MET terms of service\n\n- Send an identifying User-Agent with contact info. Set the `MET_USER_AGENT` env var, e.g. `met-mcp/0.1.0 you@example.com`.\n- Send at most 4 decimals in coordinates. The server rounds for you.\n- Data license: NLOD / CC BY 4.0. Credit MET Norway when you show the data.\n\n## Remote version\n\n`worker/` holds the Cloudflare Workers deployment: the same two tools served over MCP Streamable HTTP with `createMcpHandler` (MCP SDK v2). Develop with `npm run dev`, ship with `npm run deploy` (both from `worker/`).\n\n## How it works\n\n- `src/index.ts` is the whole server. It speaks MCP over stdio: JSON-RPC on stdin/stdout.\n- Each tool declares an input schema with Zod. The MCP client (Claude) reads the schema and validates arguments.\n- Tool results are `content` blocks. This server returns JSON as text, trimmed to what an LLM needs — the raw MET response has ~90 timesteps with far more fields.\n- Never write to stdout with `console.log`. It corrupts the protocol stream. Log to stderr.\n",
  "bytes": 3101,
  "sha": "4fa0043d12ba2515ec5b4eb73ec32b374495716be0c3df128d0e27fb1046f967",
  "repo_slug": "trondbjoroy/met-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_trondbjoroy_met_mcp_1ce58d02/readme"
}