/ 目錄 / 演練場 / weather-mcp-server
● 社群 ezh0v ⚡ 即開即用

weather-mcp-server

作者 ezh0v · ezh0v/weather-mcp-server

A tiny Go MCP that answers 'what's the weather in X?' using WeatherAPI — one tool, one env var, zero ceremony.

weather-mcp-server is a minimal Go server exposing a single current_weather tool that calls WeatherAPI.com. Useful as a 'hello world' MCP, a building block for location-aware agents, or a quick way to add weather awareness without pulling in a heavier maps MCP.

為什麼要用

核心特性

即時演示

實際使用效果

weather.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "weather": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/ezh0v/weather-mcp-server"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "weather": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/ezh0v/weather-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "weather": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/ezh0v/weather-mcp-server"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "weather": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/ezh0v/weather-mcp-server"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "weather",
      "command": "TODO",
      "args": [
        "See README: https://github.com/ezh0v/weather-mcp-server"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "weather": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/ezh0v/weather-mcp-server"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add weather -- TODO 'See README: https://github.com/ezh0v/weather-mcp-server'

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: weather-mcp-server

Give your personal assistant weather awareness

👤 Anyone using Claude as a daily assistant ⏱ ~10 min beginner

何時使用: You ask Claude for weather and it keeps saying 'I don't have real-time data'. Fix that in 5 minutes.

前置條件
  • WeatherAPI.com free API key — weatherapi.com/signup — 1M calls/month free
步驟
  1. Set up and connect
    Install weather-mcp-server via Docker with WEATHER_API_KEY=... and connect from Claude Desktop.✓ 已複製
    current_weather tool visible
  2. Ask naturally
    What's the weather like in Tokyo right now? Should I bring a jacket for a walk?✓ 已複製
    → Real-time conditions + actionable suggestion

結果: Instant weather checks without a separate app.

注意事項
  • Free tier limits + no forecast endpoint here — This tool is current-conditions only; use weatherapi's REST API directly for 7-day forecast or swap to a more feature-rich weather MCP

Generate a morning travel briefing for multiple cities

👤 Frequent travelers, remote teams ⏱ ~5 min beginner

何時使用: You coordinate with colleagues in 4 time zones and want to know if the New York team is in a blizzard before your 9 AM call.

步驟
  1. Call per city
    Get current weather for New York, London, Tokyo, São Paulo. Summarize in one sentence each.✓ 已複製
    → 4-city brief

結果: 30-second daily ops awareness across your distributed team.

注意事項
  • API rate limit if called every minute across many cities — Cache for 15 minutes; weather doesn't change that fast

組合

與其他 MCP 搭配,撬動十倍槓桿

weather + google-map

Plan an outdoor trip weighing both route and weather

Plan a route for 3 outdoor stops in LA. For each, also check current weather; warn if precipitation.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
current_weather city: str Anything weather-related 1 WeatherAPI call (free up to 1M/mo)

成本與限制

運行它的成本

API 配額
WeatherAPI free: 1M calls/month, 10/sec
每次呼叫 Token 數
~200 tokens per response
費用
Free for personal use; paid plans start at $4/mo for higher tiers
提示
Cache results for 10-15 minutes — weather doesn't change faster than that.

安全

權限、密鑰、影響範圍

憑證儲存: WEATHER_API_KEY env var
資料出站: Outbound to api.weatherapi.com only

故障排查

常見錯誤與修復

401 from WeatherAPI

WEATHER_API_KEY not set or invalid. Get one at weatherapi.com/my/.

驗證: curl 'http://api.weatherapi.com/v1/current.json?key=$KEY&q=London'
City not found

Use full name with country: 'Paris, France' not 'Paris'. Or use coordinates 'lat,lng'.

Build fails: go module errors

Requires Go 1.21+. go version to check. Or use the Docker image.

替代方案

weather-mcp-server 對比其他方案

替代方案何時用它替代權衡
Open-Meteo MCPYou want no API key at allFree, no key, but requires lat/lng (no city name geocoding)
National Weather Service MCPUS-only and you want forecasts + alertsUS-only; richer data

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills