Cover image
Try Now
2025-04-05

利用台湾中央气象局的API建立MCP-Server

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

CWA MCP 伺服器

一個簡單的模型內容協定 (Model Context Protocol, MCP) 伺服器,可將 Claude Desktop 連接到台灣中央氣象署 (CWA) API 以獲取氣象資料。

功能特色

  • 簡單、輕量的 Node.js 實作
  • 容易設定並與 Claude Desktop 配合使用
  • 存取所有台灣縣市的 CWA 氣象預報資料

快速開始

  1. 取得 CWA API 金鑰:

  2. 使安裝腳本可執行:

    chmod +x install.sh
    
  3. 執行安裝腳本:

    ./install.sh
    
  4. 編輯位於 ~/.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"
          }
        }
      }
    }
    
  5. 重新啟動 Claude Desktop

  6. 開始在與 Claude 的對話中使用 CWA 氣象資料!

可用工具

get_weather_forecast

透過縣市名稱獲取台灣未來 36 小時的氣象預報。

在 Claude 中的使用範例:

台北市現在的天氣如何?

使用 Docker

你也可以使用 Docker 來執行這個 MCP 伺服器:

  1. 建立 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
    
  2. 你的_CWA_API_金鑰 替換為你實際的 CWA API 金鑰

  3. 更新你的 Claude Desktop 設定:

    {
      "mcpServers": {
        "cwa": {
          "command": "docker",
          "args": [
            "exec",
            "-i",
            "cwa-mcp-server",
            "node",
            "cwa-server.js"
          ]
        }
      }
    }
    
  4. 啟動 Docker 容器:

    docker-compose up -d
    
  5. 重新啟動 Claude Desktop

可用地區列表

支援以下縣市名稱:

  • 宜蘭縣、花蓮縣、臺東縣、澎湖縣、金門縣、連江縣
  • 臺北市、新北市、桃園市、臺中市、臺南市、高雄市
  • 基隆市、新竹縣、新竹市、苗栗縣、彰化縣、南投縣
  • 雲林縣、嘉義縣、嘉義市、屏東縣

故障排除

  • 確保已安裝 Node.js 18 或更高版本
  • 檢查你的 CWA API 金鑰是否有效並正確設定在設定檔中
  • 使用 ./test.sh 測試伺服器以確認其正常運作
  • 確保 Claude Desktop 已正確設定,並在設定變更後重新啟動

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • JackKuo666
  • 🔍使AI助手可以通过简单的MCP接口搜索和访问PYPI软件包信息。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

    Reviews

    2 (1)
    Avatar
    user_E5A9geab
    2025-04-18

    I've been using cwa-mcp-server and it's an exceptional tool for managing MCP applications. The seamless integration and user-friendly interface make it ideal for both beginners and advanced users. Kudos to lincw for developing such a robust server solution. If you're in need of a reliable MCP server, look no further!