Home / MCP / CWA MCP Server

CWA MCP Server

Connect Claude Desktop to CWA API to fetch Taiwan weather data via a lightweight Node.js MCP server.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "cwa": {
            "command": "node",
            "args": [
                "/path/to/cwa-server.js"
            ],
            "env": {
                "CWA_API_KEY": "CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF"
            }
        }
    }
}

This MCP server lets Claude Desktop connect to the Taiwan Central Weather Bureau API to fetch weather data. It is a lightweight Node.js solution that is easy to configure and works with Claude Desktop to access weather forecasts for all counties and cities.

How to use

You use this MCP server by enabling it in Claude Desktop and then asking Claude questions related to weather. The server exposes a tool named get_weather_forecast that retrieves the next 36 hours of forecast data by county name. In conversations, you can ask for forecasts for a specific city or county and Claude will fetch the data through the MCP server.

How to install

Prerequisites you need before installing: Node.js 18 or newer, and a working Claude Desktop setup.

Step by step installation and setup you can follow exactly as shown:

#!/bin/bash
# Example install script steps (provided by your setup)

# 1. Make the install script executable
chmod +x install.sh

# 2. Run the installation script
./install.sh

# 3. Edit the Claude Desktop configuration to add your CWA API key
# Open the file at ~/.config/claude/claude_desktop_config.json and add the CWA API key under mcpServers.cwa
# Example configuration is shown in the next block.

# 4. Restart Claude Desktop to apply changes
# (Close and reopen Claude Desktop, or trigger a restart from your system)

Add the following configuration snippet to your Claude Desktop setup to enable the CWA MCP server. This maps the server to a local Node.js script that implements the MCP protocol for weather data retrieval.

{
  "mcpServers": {
    "cwa": {
      "command": "node",
      "args": [
        "/path/to/cwa-server.js"
      ],
      "env": {
        "CWA_API_KEY": "CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF"
      }
    }
  }
}

After updating the configuration, restart Claude Desktop and begin asking Claude about weather data. If you prefer running the server in a container, you can use Docker as described in the Docker setup section below.

Additional sections

Configuration and regions you can access: the MCP server exposes CWA weather data for the following regions in Taiwan, including counties and cities such as Yilan, Hualien, Taitung, Penghu, Kinmen, Lienchiang, Taipei, New Taipei, Taoyuan, Taichung, Tainan, Kaohsiung, Keelung, Hsinchu County, Hsinchu City, Miaoli, Changhua, Nantou, Yunlin, Chiayi County, Chiayi City, Pingtung, and others.

Docker-based deployment: you can run the MCP server in a Docker container. Create a docker-compose.yml with the following configuration, replacing your actual API key where indicated, then bring the container up and configure Claude Desktop to use the Docker command path.

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=YOUR_CWA_API_KEY_HERE
    restart: unless-stopped

Update Claude Desktop to use the Docker-based MCP server by setting the MCP client entry to run the container’s node script directly. Use these values in your Claude Desktop configuration to point to the container execution path.

{
  "mcpServers": {
    "cwa": {
      "command": "docker",
      "args": [
        "exec",
        "-i",
        "cwa-mcp-server",
        "node",
        "cwa-server.js"
      ]
    }
  }
}

Testing and troubleshooting notes: ensure Node.js version is 18 or newer, verify your CWA API key is valid and correctly configured in the server configuration, run the test script if provided (e.g., ./test.sh), and restart Claude Desktop after any configuration changes.

Troubleshooting notes

- Ensure Node.js 18 or higher is installed on your system. - Verify the CWA API key is valid and correctly placed in the mcpServers configuration. - If the server isn't responding, run ./test.sh to confirm the server is operational. - After making configuration changes, restart Claude Desktop to apply the new settings.

Available tools

get_weather_forecast

Fetches the 36-hour weather forecast for a specified county name from the CWA API.