met-mcp
met-mcp
一个用于获取挪威气象局(MET Norway,Yr)天气预报的 MCP 服务器,作为学习项目而构建。
可通过三种方式使用:
npm:
met-mcp— 通过 stdio 在本地运行远程:
https://met-mcp.met-mcp-worker.workers.dev/mcp— 基于 Cloudflare Workers 的 Streamable HTTP,可将其添加为 claude.ai 连接器MCP 注册表:
io.github.trondbjoroy/met-mcp
工具
geocode_location(name, count)— 查找地名的坐标。使用免费的 Open-Meteo 地理编码器,因为 MET 没有地理编码 API。get_forecast(latitude, longitude, hours)— 来自 MET Locationforecast 2.0 的逐小时预报。适用于全球,北欧效果最佳。get_nowcast(latitude, longitude)— 基于雷达的未来 2 小时降水预报。仅限北欧。get_weather_alerts(latitude?, longitude?)— 挪威官方危险警告(MetAlerts)。省略坐标可获取全挪威的警告。get_sun_events(latitude, longitude, date, utc_offset)— 日出、日落和正午太阳高度。全球可用。get_ocean_forecast(latitude, longitude, hours)— 挪威海岸沿线的浪高和海温。find_weather_stations(latitude, longitude, count)— 最近的官方气象站(Frost)。get_historical_weather(station_id, from, to, elements)— 来自 Frost 档案的每日历史观测数据;部分站点可追溯 100 多年。
这两个 Frost 工具需要从 https://frost.met.no/auth/requestCredentials.html 获取免费的客户端 ID,并设置为 FROST_CLIENT_ID 环境变量(或作为 worker 的 Cloudflare 密钥)。其他工具则无需任何配置。
工具定义位于 src/tools.ts 中,由 stdio 服务器和 worker 共享。
Related MCP server: OpenWeatherMap MCP Server
构建和测试
npm install
npm run build
npm test测试通过 stdio 启动服务器,并针对实时 API 调用这两个工具。
与 Claude Code 一起使用
claude mcp add met-weather -- node C:\Users\trond\met-mcp\dist\index.js然后询问 Claude:“明天卑尔根的天气怎么样?”
MET 服务条款
发送带有联系信息的可识别 User-Agent。设置
MET_USER_AGENT环境变量,例如met-mcp/0.1.0 you@example.com。坐标最多保留 4 位小数。服务器会为您四舍五入。
数据许可:NLOD / CC BY 4.0。展示数据时请注明来源为挪威气象局(MET Norway)。
远程版本
worker/ 目录包含 Cloudflare Workers 部署:通过 createMcpHandler(MCP SDK v2)在 MCP Streamable HTTP 上提供相同的两个工具。使用 npm run dev 开发,使用 npm run deploy 部署(均在 worker/ 目录下执行)。
工作原理
src/index.ts就是整个服务器。它通过 stdio 使用 MCP 协议:在 stdin/stdout 上进行 JSON-RPC 通信。每个工具都使用 Zod 声明输入模式。MCP 客户端(Claude)读取该模式并验证参数。
工具结果以
content块的形式返回。此服务器以文本形式返回 JSON,并精简为 LLM 所需的内容——MET 原始响应包含约 90 个时间步,字段要多得多。切勿使用
console.log写入 stdout。这会破坏协议流。请使用 stderr 记录日志。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides LLM-friendly weather tools and Norwegian place name resolution via MCP, enabling weather forecasts, air quality, marine conditions, and activity planning.1MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenWeatherMap API with MCP to provide weather data, forecasts, air quality, maps, alerts, and geocoding via natural language.10MIT
- AlicenseNot gradedqualityBmaintenanceProvides weather data including current conditions, forecasts, and summaries via Open-Meteo with no API key required, enabling natural language queries through an MCP interface.MIT
- AlicenseNot gradedqualityCmaintenanceEnables access to MET Norway weather data including global forecasts, Nordic nowcast, sunrise/sunset times, air quality, and ocean forecasts via natural language queries.3MIT
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Visual Crossing Weather MCP — wraps the Visual Crossing Weather Timeline API
Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/trondbjoroy/met-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server