The CWA MCP Server is a lightweight Node.js implementation that connects Claude Desktop to Taiwan's Central Weather Administration (CWA) API for accessing weather data. It allows Claude to retrieve and use real-time weather forecasts for all cities and counties in Taiwan.
Make the installation script executable:
chmod +x install.sh
Run the installation script:
./install.sh
Edit the Claude Desktop configuration file located at ~/.config/claude/claude_desktop_config.json
:
{
"mcpServers": {
"cwa": {
"command": "node",
"args": [
"/path/to/cwa-server.js"
],
"env": {
"CWA_API_KEY": "YOUR-CWA-API-KEY"
}
}
}
}
Replace YOUR-CWA-API-KEY
with your actual CWA API key.
Restart Claude Desktop
Create a docker-compose.yml
file:
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
restart: unless-stopped
Replace YOUR-CWA-API-KEY
with your actual CWA API key.
Update your Claude Desktop configuration:
{
"mcpServers": {
"cwa": {
"command": "docker",
"args": [
"exec",
"-i",
"cwa-mcp-server",
"node",
"cwa-server.js"
]
}
}
}
Start the Docker container:
docker-compose up -d
Restart Claude Desktop
Once installed and configured, you can start asking Claude about weather forecasts in Taiwan. The server provides the get_weather_forecast
tool that retrieves weather forecasts for the next 36 hours based on the city or county name.
Example query in Claude:
What's the current weather in Taipei?
The following cities and counties are supported:
If you encounter issues with the MCP server:
./test.sh
to test the server and confirm it's working properlyTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "cwa" '{"command":"node","args":["/path/to/cwa-server.js"],"env":{"CWA_API_KEY":"CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cwa": {
"command": "node",
"args": [
"/path/to/cwa-server.js"
],
"env": {
"CWA_API_KEY": "CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"cwa": {
"command": "node",
"args": [
"/path/to/cwa-server.js"
],
"env": {
"CWA_API_KEY": "CWA-1E740A28-FFDC-4186-BE0D-B02662F066EF"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect