@unclick/willyweather-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +35 -0
- package/dist/index.js +83 -0
- package/dist/willyweather-tool.js +127 -0
- package/package.json +46 -0
- package/server.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UnClick / malamutemayhem
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# WillyWeather MCP by UnClick
|
|
2
|
+
|
|
3
|
+
Australian weather, surf, and tide forecasts from WillyWeather.
|
|
4
|
+
|
|
5
|
+
> By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Installs straight from GitHub, no npm account needed.
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"willyweather": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "https://github.com/malamutemayhem/unclick/releases/download/standalone-mcps-latest/willyweather.tgz"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Tools
|
|
23
|
+
|
|
24
|
+
- `willyweather_forecast`
|
|
25
|
+
- `willyweather_surf`
|
|
26
|
+
- `willyweather_tide`
|
|
27
|
+
|
|
28
|
+
## Want the rest?
|
|
29
|
+
|
|
30
|
+
This is one connector. [UnClick](https://unclick.world) bundles 180+ tools plus
|
|
31
|
+
persistent cross-session agent memory in a single install.
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
Apache-2.0
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// WillyWeather MCP. Standalone MCP server by UnClick.
|
|
3
|
+
// By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
|
|
4
|
+
//
|
|
5
|
+
// Generated from the UnClick connector by scripts/generate-standalone-mcp.mjs.
|
|
6
|
+
// Edit the connector in the UnClick monorepo, not here.
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import { getWillyweatherForecast, getWillyweatherSurf, getWillyweatherTide, } from "./willyweather-tool.js";
|
|
11
|
+
const TOOLS = [
|
|
12
|
+
{
|
|
13
|
+
name: "willyweather_forecast",
|
|
14
|
+
description: "Get weather forecast from WillyWeather for an Australian location.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
properties: {
|
|
19
|
+
location_id: { type: "number", description: "WillyWeather location ID" },
|
|
20
|
+
days: { type: "number" },
|
|
21
|
+
api_key: { type: "string" },
|
|
22
|
+
},
|
|
23
|
+
required: ["location_id"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "willyweather_surf",
|
|
28
|
+
description: "Get surf report from WillyWeather.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
location_id: { type: "number" },
|
|
34
|
+
days: { type: "number" },
|
|
35
|
+
api_key: { type: "string" },
|
|
36
|
+
},
|
|
37
|
+
required: ["location_id"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "willyweather_tide",
|
|
42
|
+
description: "Get tide times from WillyWeather.",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
additionalProperties: false,
|
|
46
|
+
properties: {
|
|
47
|
+
location_id: { type: "number" },
|
|
48
|
+
days: { type: "number" },
|
|
49
|
+
api_key: { type: "string" },
|
|
50
|
+
},
|
|
51
|
+
required: ["location_id"],
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
const HANDLERS = {
|
|
56
|
+
willyweather_forecast: (args) => getWillyweatherForecast(args),
|
|
57
|
+
willyweather_surf: (args) => getWillyweatherSurf(args),
|
|
58
|
+
willyweather_tide: (args) => getWillyweatherTide(args),
|
|
59
|
+
};
|
|
60
|
+
const server = new Server({ name: "io.github.malamutemayhem/willyweather", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
61
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
62
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
63
|
+
const handler = HANDLERS[req.params.name];
|
|
64
|
+
if (!handler) {
|
|
65
|
+
return { content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }], isError: true };
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const result = await handler((req.params.arguments ?? {}));
|
|
69
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
73
|
+
return { content: [{ type: "text", text: message }], isError: true };
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
async function main() {
|
|
77
|
+
const transport = new StdioServerTransport();
|
|
78
|
+
await server.connect(transport);
|
|
79
|
+
}
|
|
80
|
+
main().catch((err) => {
|
|
81
|
+
process.stderr.write(`[willyweather-mcp] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// WillyWeather AU integration.
|
|
2
|
+
// Australian weather, surf, tide, UV, and swell forecasts.
|
|
3
|
+
// Docs: https://www.willyweather.com.au/api/docs/v2.html
|
|
4
|
+
// Auth: WILLYWEATHER_KEY env var (passed as key query param in base URL).
|
|
5
|
+
// Base URL: https://api.willyweather.com.au/v2/{key}/
|
|
6
|
+
const WILLY_BASE = "https://api.willyweather.com.au/v2";
|
|
7
|
+
function getApiKey(args) {
|
|
8
|
+
const key = String(args.api_key ?? process.env.WILLYWEATHER_KEY ?? "").trim();
|
|
9
|
+
if (!key)
|
|
10
|
+
throw new Error("api_key is required (or set WILLYWEATHER_KEY env var).");
|
|
11
|
+
return key;
|
|
12
|
+
}
|
|
13
|
+
async function willyGet(apiKey, path, params) {
|
|
14
|
+
const qs = params ? "?" + new URLSearchParams(params).toString() : "";
|
|
15
|
+
const res = await fetch(`${WILLY_BASE}/${apiKey}${path}${qs}`, {
|
|
16
|
+
headers: { "User-Agent": "UnClickMCP/1.0 (https://unclick.io)" },
|
|
17
|
+
});
|
|
18
|
+
if (res.status === 401 || res.status === 403)
|
|
19
|
+
throw new Error("Invalid WillyWeather API key.");
|
|
20
|
+
if (res.status === 404)
|
|
21
|
+
throw new Error("Location not found.");
|
|
22
|
+
if (res.status === 429)
|
|
23
|
+
throw new Error("WillyWeather API rate limit exceeded.");
|
|
24
|
+
if (!res.ok) {
|
|
25
|
+
const body = await res.text().catch(() => "");
|
|
26
|
+
throw new Error(`WillyWeather HTTP ${res.status}${body ? `: ${body.slice(0, 200)}` : ""}`);
|
|
27
|
+
}
|
|
28
|
+
return res.json();
|
|
29
|
+
}
|
|
30
|
+
async function searchLocation(apiKey, query) {
|
|
31
|
+
const data = await willyGet(apiKey, "/search.json", { q: query, limit: "1" });
|
|
32
|
+
const locations = data["locations"];
|
|
33
|
+
if (!locations?.length)
|
|
34
|
+
return null;
|
|
35
|
+
const loc = locations[0];
|
|
36
|
+
return {
|
|
37
|
+
id: Number(loc["id"]),
|
|
38
|
+
name: String(loc["name"] ?? ""),
|
|
39
|
+
state: String(loc["state"]?.["abbreviation"] ?? ""),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// ─── get_willyweather_forecast ────────────────────────────────────────────────
|
|
43
|
+
export async function getWillyweatherForecast(args) {
|
|
44
|
+
try {
|
|
45
|
+
const apiKey = getApiKey(args);
|
|
46
|
+
const query = String(args.location ?? args.suburb ?? args.postcode ?? "").trim();
|
|
47
|
+
if (!query)
|
|
48
|
+
return { error: "location is required (suburb name or postcode)." };
|
|
49
|
+
const loc = await searchLocation(apiKey, query);
|
|
50
|
+
if (!loc)
|
|
51
|
+
return { error: `Location "${query}" not found in WillyWeather.` };
|
|
52
|
+
const days = Math.min(7, Math.max(1, Number(args.days ?? 3)));
|
|
53
|
+
const data = await willyGet(apiKey, `/locations/${loc.id}/weather.json`, {
|
|
54
|
+
forecasts: "weather,temperature,rainfall,wind,sunrisesunset",
|
|
55
|
+
days: String(days),
|
|
56
|
+
});
|
|
57
|
+
const forecasts = data["forecasts"];
|
|
58
|
+
return {
|
|
59
|
+
location: `${loc.name}, ${loc.state}`,
|
|
60
|
+
location_id: loc.id,
|
|
61
|
+
days_requested: days,
|
|
62
|
+
weather: forecasts?.["weather"],
|
|
63
|
+
temperature: forecasts?.["temperature"],
|
|
64
|
+
rainfall: forecasts?.["rainfall"],
|
|
65
|
+
wind: forecasts?.["wind"],
|
|
66
|
+
sunrise_sunset: forecasts?.["sunrisesunset"],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// ─── get_willyweather_surf ────────────────────────────────────────────────────
|
|
74
|
+
export async function getWillyweatherSurf(args) {
|
|
75
|
+
try {
|
|
76
|
+
const apiKey = getApiKey(args);
|
|
77
|
+
const query = String(args.location ?? args.suburb ?? args.postcode ?? "").trim();
|
|
78
|
+
if (!query)
|
|
79
|
+
return { error: "location is required (suburb name or postcode)." };
|
|
80
|
+
const loc = await searchLocation(apiKey, query);
|
|
81
|
+
if (!loc)
|
|
82
|
+
return { error: `Location "${query}" not found in WillyWeather.` };
|
|
83
|
+
const days = Math.min(7, Math.max(1, Number(args.days ?? 3)));
|
|
84
|
+
const data = await willyGet(apiKey, `/locations/${loc.id}/weather.json`, {
|
|
85
|
+
forecasts: "swell,surfConditions",
|
|
86
|
+
days: String(days),
|
|
87
|
+
});
|
|
88
|
+
const forecasts = data["forecasts"];
|
|
89
|
+
return {
|
|
90
|
+
location: `${loc.name}, ${loc.state}`,
|
|
91
|
+
location_id: loc.id,
|
|
92
|
+
days_requested: days,
|
|
93
|
+
swell: forecasts?.["swell"],
|
|
94
|
+
surf_conditions: forecasts?.["surfConditions"],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ─── get_willyweather_tide ────────────────────────────────────────────────────
|
|
102
|
+
export async function getWillyweatherTide(args) {
|
|
103
|
+
try {
|
|
104
|
+
const apiKey = getApiKey(args);
|
|
105
|
+
const query = String(args.location ?? args.suburb ?? args.postcode ?? "").trim();
|
|
106
|
+
if (!query)
|
|
107
|
+
return { error: "location is required (suburb name or postcode)." };
|
|
108
|
+
const loc = await searchLocation(apiKey, query);
|
|
109
|
+
if (!loc)
|
|
110
|
+
return { error: `Location "${query}" not found in WillyWeather.` };
|
|
111
|
+
const days = Math.min(7, Math.max(1, Number(args.days ?? 2)));
|
|
112
|
+
const data = await willyGet(apiKey, `/locations/${loc.id}/weather.json`, {
|
|
113
|
+
forecasts: "tides",
|
|
114
|
+
days: String(days),
|
|
115
|
+
});
|
|
116
|
+
const forecasts = data["forecasts"];
|
|
117
|
+
return {
|
|
118
|
+
location: `${loc.name}, ${loc.state}`,
|
|
119
|
+
location_id: loc.id,
|
|
120
|
+
days_requested: days,
|
|
121
|
+
tides: forecasts?.["tides"],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
126
|
+
}
|
|
127
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unclick/willyweather-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"mcpName": "io.github.malamutemayhem/willyweather",
|
|
5
|
+
"description": "Australian weather, surf, and tide forecasts from WillyWeather. By UnClick (https://unclick.world).",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"unclick",
|
|
10
|
+
"willyweather",
|
|
11
|
+
"weather",
|
|
12
|
+
"surf",
|
|
13
|
+
"tide",
|
|
14
|
+
"australia"
|
|
15
|
+
],
|
|
16
|
+
"author": "UnClick (https://unclick.world)",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"bin": {
|
|
19
|
+
"willyweather-mcp": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"server.json"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"start": "node dist/index.js",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@modelcontextprotocol/sdk": "^1.15.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^5.6.0",
|
|
37
|
+
"@types/node": "^22.0.0"
|
|
38
|
+
},
|
|
39
|
+
"license": "Apache-2.0",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/malamutemayhem/unclick.git",
|
|
43
|
+
"directory": "packages/standalone/willyweather-mcp"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://unclick.world"
|
|
46
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.malamutemayhem/willyweather",
|
|
4
|
+
"title": "WillyWeather MCP by UnClick",
|
|
5
|
+
"description": "Australian weather, surf, and tide forecasts from WillyWeather. By UnClick.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://unclick.world",
|
|
8
|
+
"icons": [
|
|
9
|
+
{
|
|
10
|
+
"src": "https://unclick.world/favicon.png",
|
|
11
|
+
"mimeType": "image/png",
|
|
12
|
+
"sizes": [
|
|
13
|
+
"512x512"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"url": "https://github.com/malamutemayhem/unclick.git",
|
|
19
|
+
"source": "github",
|
|
20
|
+
"subfolder": "packages/standalone/willyweather-mcp"
|
|
21
|
+
},
|
|
22
|
+
"packages": [
|
|
23
|
+
{
|
|
24
|
+
"registryType": "npm",
|
|
25
|
+
"identifier": "@unclick/willyweather-mcp",
|
|
26
|
+
"version": "0.1.0",
|
|
27
|
+
"runtimeHint": "npx",
|
|
28
|
+
"transport": {
|
|
29
|
+
"type": "stdio"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|