CWA Weather Forecast
STDIOMCP server connecting Claude Desktop to Taiwan Central Weather Administration API for weather data.
MCP server connecting Claude Desktop to Taiwan Central Weather Administration API for weather data.
一個簡單的模型內容協定 (Model Context Protocol, MCP) 伺服器,可將 Claude Desktop 連接到台灣中央氣象署 (CWA) API 以獲取氣象資料。
取得 CWA API 金鑰:
使安裝腳本可執行:
chmod +x install.sh
執行安裝腳本:
./install.sh
編輯位於 ~/.config/claude/claude_desktop_config.json
的設定檔,加入你的 CWA API 金鑰:
{ "mcpServers": { "cwa": { "command": "node", "args": [ "/path/to/cwa-server.js" ], "env": { "CWA_API_KEY": "CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF" } } } }
重新啟動 Claude Desktop
開始在與 Claude 的對話中使用 CWA 氣象資料!
get_weather_forecast
透過縣市名稱獲取台灣未來 36 小時的氣象預報。
在 Claude 中的使用範例:
台北市現在的天氣如何?
你也可以使用 Docker 來執行這個 MCP 伺服器:
建立 docker-compose.yml
檔案:
version: '3' services: cwa-mcp-server: container_name: cwa-mcp-server image: node:18 volumes: - ./:/app working_dir: /app command: node cwa-server.js environment: - CWA_API_KEY=你的_CWA_API_金鑰 restart: unless-stopped
將 你的_CWA_API_金鑰
替換為你實際的 CWA API 金鑰
更新你的 Claude Desktop 設定:
{ "mcpServers": { "cwa": { "command": "docker", "args": [ "exec", "-i", "cwa-mcp-server", "node", "cwa-server.js" ] } } }
啟動 Docker 容器:
docker-compose up -d
重新啟動 Claude Desktop
支援以下縣市名稱:
./test.sh
測試伺服器以確認其正常運作